File size: 421 Bytes
09410eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# app/core/config.py
import os
import google.generativeai as genai
from dotenv import load_dotenv

def init_config():
    # Load environment variables
    load_dotenv()
    
    # Get API key
    api_key = os.getenv('GEMINI_API_KEY')
    
    if not api_key:
        raise ValueError("GEMINI_API_KEY not found in environment variables")
        
    # Configure Gemini
    genai.configure(api_key=api_key)