yooke commited on
Commit
1593f05
·
verified ·
1 Parent(s): 9dbc28b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -140,14 +140,18 @@ class BasicAgent:
140
  raise ValueError("DEEPSEEK_API_KEY environment variable not set.")
141
 
142
 
143
- # Assuming you've set GOOGLE_API_KEY in secrets
144
- google_api_key = os.environ.get("GOOGLE_API_KEY")
145
- if not google_api_key:
146
- raise ValueError("GOOGLE_API_KEY environment variable not set.")
147
-
148
- # Check if the global credential setup was successful
149
- if not CREDENTIALS_CONFIGURED:
150
- raise ValueError("Google Cloud credentials could not be configured. Check startup logs and HF Secrets (ensure 'GOOGLE_APPLICATION_CREDENTIALS_JSON' is set correctly).")
 
 
 
 
151
  self.agent = CodeAgent(
152
  model=LiteLLMModel(model_id="deepseek-chat"),
153
  tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), ExcelToTextTool()],
 
140
  raise ValueError("DEEPSEEK_API_KEY environment variable not set.")
141
 
142
 
143
+ # # Assuming you've set GOOGLE_API_KEY in secrets
144
+ # google_api_key = os.environ.get("GOOGLE_API_KEY")
145
+ # if not google_api_key:
146
+ # raise ValueError("GOOGLE_API_KEY environment variable not set.")
147
+
148
+ # # Check if the global credential setup was successful
149
+ # if not CREDENTIALS_CONFIGURED:
150
+ # raise ValueError("Google Cloud credentials could not be configured. Check startup logs and HF Secrets (ensure 'GOOGLE_APPLICATION_CREDENTIALS_JSON' is set correctly).")
151
+
152
+ # 设置环境变量,使LiteLLM能够使用DeepSeek API密钥
153
+ os.environ["DEEPSEEK_API_KEY"] = deepseek_api_key
154
+
155
  self.agent = CodeAgent(
156
  model=LiteLLMModel(model_id="deepseek-chat"),
157
  tools=[DuckDuckGoSearchTool(), WikipediaSearchTool(), ExcelToTextTool()],