demo2 / src /config /config.py
Dinesh310's picture
Update src/config/config.py
365b212 verified
"""Configuration module for Agentic RAG system"""
import os
from dotenv import load_dotenv
# from langchain.chat_models import init_chat_model
from langchain_openai import ChatOpenAI
# Load environment variables
load_dotenv()
class Config:
"""Configuration class for RAG system"""
# API Keys
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
# Model Configuration
LLM_MODEL = "openai/gpt-oss-120b:free"
# Document Processing
CHUNK_SIZE = 500
CHUNK_OVERLAP = 50
# Default URLs
DEFAULT_URLS = [
"https://lilianweng.github.io/posts/2023-06-23-agent/",
"https://lilianweng.github.io/posts/2024-04-12-diffusion-video/"
]
@classmethod
def get_llm(cls):
"""Initialize and return the LLM model"""
os.environ["OPENAI_API_KEY"] = cls.OPENAI_API_KEY
return ChatOpenAI(
model=cls.LLM_MODEL,
base_url="https://openrouter.ai/api/v1",
extra_body={"reasoning": {"enabled": True}})
# return init_chat_model(cls.LLM_MODEL)