-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfiguration.py
More file actions
30 lines (24 loc) · 819 Bytes
/
configuration.py
File metadata and controls
30 lines (24 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
class Config:
"""
The Config class sets the API keys for the RAG process.
Attributes
----------
langchain_api_key: str
The Langchain API key.
openai_api_key: str
The OpenAI API key.
Methods
-------
setup_environment:
Set up the environment for the RAG process.
"""
def __init__(self, langchain_api_key, openai_api_key):
self.langchain_api_key = langchain_api_key
self.openai_api_key = openai_api_key
self.setup_environment()
def setup_environment(self):
os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com"
os.environ["LANGCHAIN_API_KEY"] = self.langchain_api_key
os.environ["OPENAI_API_KEY"] = self.openai_api_key