Spaces:
Sleeping
Sleeping
Commit
·
b501271
1
Parent(s):
4569928
little change
Browse files- core/llm/llm.py +2 -13
core/llm/llm.py
CHANGED
|
@@ -14,19 +14,8 @@ class LLM:
|
|
| 14 |
self.model_name = model_name
|
| 15 |
self.logger = logger
|
| 16 |
self.user_id = user_id
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
self.api_base = os.getenv('DEEPSEEK_API_BASE')
|
| 20 |
-
else:
|
| 21 |
-
self.api_key = "key" # os.getenv('OPENAI_API_KEY')
|
| 22 |
-
# self.api_base = "https://gpt-api.hkust-gz.edu.cn/v1/chat/completions" # os.getenv('OPENAI_API_BASE')
|
| 23 |
-
self.api_key = os.getenv('OPENAI_API_KEY')
|
| 24 |
-
self.api_base = "https://api.openai.com/v1/chat/completions"
|
| 25 |
-
|
| 26 |
-
# if not self.api_key:
|
| 27 |
-
# raise ValueError('API key not found in environment variables')
|
| 28 |
-
|
| 29 |
-
self.client = openai.Client(api_key=self.api_key, base_url=self.api_base)
|
| 30 |
|
| 31 |
def reset(self, api_key=None, api_base=None, model_name=None):
|
| 32 |
if api_key:
|
|
|
|
| 14 |
self.model_name = model_name
|
| 15 |
self.logger = logger
|
| 16 |
self.user_id = user_id
|
| 17 |
+
self.api_key = None
|
| 18 |
+
self.api_base = None
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
def reset(self, api_key=None, api_base=None, model_name=None):
|
| 21 |
if api_key:
|