Dinesh310 commited on
Commit
365b212
·
verified ·
1 Parent(s): c00effc

Update src/config/config.py

Browse files
Files changed (1) hide show
  1. src/config/config.py +41 -33
src/config/config.py CHANGED
@@ -1,33 +1,41 @@
1
- """Configuration module for Agentic RAG system"""
2
-
3
- import os
4
- from dotenv import load_dotenv
5
- from langchain.chat_models import init_chat_model
6
-
7
- # Load environment variables
8
- load_dotenv()
9
-
10
- class Config:
11
- """Configuration class for RAG system"""
12
-
13
- # API Keys
14
- OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
15
-
16
- # Model Configuration
17
- LLM_MODEL = "openai:gpt-4o"
18
-
19
- # Document Processing
20
- CHUNK_SIZE = 500
21
- CHUNK_OVERLAP = 50
22
-
23
- # Default URLs
24
- DEFAULT_URLS = [
25
- "https://lilianweng.github.io/posts/2023-06-23-agent/",
26
- "https://lilianweng.github.io/posts/2024-04-12-diffusion-video/"
27
- ]
28
-
29
- @classmethod
30
- def get_llm(cls):
31
- """Initialize and return the LLM model"""
32
- os.environ["OPENAI_API_KEY"] = cls.OPENAI_API_KEY
33
- return init_chat_model(cls.LLM_MODEL)
 
 
 
 
 
 
 
 
 
1
+ """Configuration module for Agentic RAG system"""
2
+
3
+ import os
4
+ from dotenv import load_dotenv
5
+ # from langchain.chat_models import init_chat_model
6
+ from langchain_openai import ChatOpenAI
7
+ # Load environment variables
8
+ load_dotenv()
9
+
10
+
11
+
12
+
13
+
14
+ class Config:
15
+ """Configuration class for RAG system"""
16
+
17
+ # API Keys
18
+ OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
19
+
20
+ # Model Configuration
21
+ LLM_MODEL = "openai/gpt-oss-120b:free"
22
+
23
+ # Document Processing
24
+ CHUNK_SIZE = 500
25
+ CHUNK_OVERLAP = 50
26
+
27
+ # Default URLs
28
+ DEFAULT_URLS = [
29
+ "https://lilianweng.github.io/posts/2023-06-23-agent/",
30
+ "https://lilianweng.github.io/posts/2024-04-12-diffusion-video/"
31
+ ]
32
+
33
+ @classmethod
34
+ def get_llm(cls):
35
+ """Initialize and return the LLM model"""
36
+ os.environ["OPENAI_API_KEY"] = cls.OPENAI_API_KEY
37
+ return ChatOpenAI(
38
+ model=cls.LLM_MODEL,
39
+ base_url="https://openrouter.ai/api/v1",
40
+ extra_body={"reasoning": {"enabled": True}})
41
+ # return init_chat_model(cls.LLM_MODEL)