Legal-Chatbot / core /config.py
MISSAOUI's picture
Update core/config.py
3874ccc verified
raw
history blame contribute delete
739 Bytes
from pymongo import MongoClient
from openai import OpenAI, AzureOpenAI
import os
# ======================================================
# CONFIGURATION
# ======================================================
MONGO_DATABASE_HOST=os.getenv('MONGO_DATABASE_HOST')
# MongoDB
client_mongo = MongoClient(MONGO_DATABASE_HOST)
db = client_mongo["douane_db"]
collection = db["douane_code"]
# Azure OpenAI
endpoint = os.getenv('endpoint')
embedding_model = "text-embedding-ada-002"
chat_model = "gpt-5-chat"
api_key = os.getenv('api_key')
api_version = "2024-12-01-preview"
client_embedding = OpenAI(base_url=f"{endpoint}openai/v1/", api_key=api_key)
client_chat = AzureOpenAI(api_version=api_version, azure_endpoint=endpoint, api_key=api_key)