Spaces:
Running
Running
Update agent_logic.py
Browse files- agent_logic.py +5 -5
agent_logic.py
CHANGED
|
@@ -115,20 +115,20 @@ class StrategicSelectorAgent:
|
|
| 115 |
}
|
| 116 |
|
| 117 |
# --- INIT GEMINI ---
|
| 118 |
-
if api_keys.get("google"):
|
| 119 |
try:
|
| 120 |
genai.configure(api_key=api_keys["google"])
|
| 121 |
self.api_clients["Gemini"] = genai.GenerativeModel(config.MODELS["Gemini"]["default"])
|
| 122 |
except Exception as e: print(f"Warning: Gemini init failed: {e}")
|
| 123 |
|
| 124 |
# --- INIT ANTHROPIC ---
|
| 125 |
-
if api_keys.get("anthropic"):
|
| 126 |
try:
|
| 127 |
self.api_clients["Anthropic"] = AsyncAnthropic(api_key=api_keys["anthropic"])
|
| 128 |
except Exception as e: print(f"Warning: Anthropic init failed: {e}")
|
| 129 |
|
| 130 |
# --- INIT SAMBANOVA ---
|
| 131 |
-
if api_keys.get("sambanova"):
|
| 132 |
try:
|
| 133 |
self.api_clients["SambaNova"] = AsyncOpenAI(
|
| 134 |
api_key=api_keys["sambanova"],
|
|
@@ -137,13 +137,13 @@ class StrategicSelectorAgent:
|
|
| 137 |
except Exception as e: print(f"Warning: SambaNova init failed: {e}")
|
| 138 |
|
| 139 |
# --- INIT OPENAI (NEW) ---
|
| 140 |
-
if api_keys.get("openai"):
|
| 141 |
try:
|
| 142 |
self.api_clients["OpenAI"] = AsyncOpenAI(api_key=api_keys["openai"])
|
| 143 |
except Exception as e: print(f"Warning: OpenAI init failed: {e}")
|
| 144 |
|
| 145 |
# --- INIT NEBIUS (NEW) ---
|
| 146 |
-
if api_keys.get("nebius"):
|
| 147 |
try:
|
| 148 |
self.api_clients["Nebius"] = AsyncOpenAI(
|
| 149 |
api_key=api_keys["nebius"],
|
|
|
|
| 115 |
}
|
| 116 |
|
| 117 |
# --- INIT GEMINI ---
|
| 118 |
+
if api_keys.get("google") and api_keys["google"].strip():
|
| 119 |
try:
|
| 120 |
genai.configure(api_key=api_keys["google"])
|
| 121 |
self.api_clients["Gemini"] = genai.GenerativeModel(config.MODELS["Gemini"]["default"])
|
| 122 |
except Exception as e: print(f"Warning: Gemini init failed: {e}")
|
| 123 |
|
| 124 |
# --- INIT ANTHROPIC ---
|
| 125 |
+
if api_keys.get("anthropic") and api_keys["anthropic"].strip():
|
| 126 |
try:
|
| 127 |
self.api_clients["Anthropic"] = AsyncAnthropic(api_key=api_keys["anthropic"])
|
| 128 |
except Exception as e: print(f"Warning: Anthropic init failed: {e}")
|
| 129 |
|
| 130 |
# --- INIT SAMBANOVA ---
|
| 131 |
+
if api_keys.get("sambanova") and api_keys["sambanova"].strip():
|
| 132 |
try:
|
| 133 |
self.api_clients["SambaNova"] = AsyncOpenAI(
|
| 134 |
api_key=api_keys["sambanova"],
|
|
|
|
| 137 |
except Exception as e: print(f"Warning: SambaNova init failed: {e}")
|
| 138 |
|
| 139 |
# --- INIT OPENAI (NEW) ---
|
| 140 |
+
if api_keys.get("openai") and api_keys["openai"].strip():
|
| 141 |
try:
|
| 142 |
self.api_clients["OpenAI"] = AsyncOpenAI(api_key=api_keys["openai"])
|
| 143 |
except Exception as e: print(f"Warning: OpenAI init failed: {e}")
|
| 144 |
|
| 145 |
# --- INIT NEBIUS (NEW) ---
|
| 146 |
+
if api_keys.get("nebius") and api_keys["nebius"].strip():
|
| 147 |
try:
|
| 148 |
self.api_clients["Nebius"] = AsyncOpenAI(
|
| 149 |
api_key=api_keys["nebius"],
|