Spaces:
Running
Running
key-pool rotation: per-session OpenAI key assignment from OPENAI_KEY_01..10 (core/manager_agent.py)
Browse files- core/manager_agent.py +4 -3
core/manager_agent.py
CHANGED
|
@@ -14,7 +14,7 @@ import json
|
|
| 14 |
import re
|
| 15 |
import time
|
| 16 |
from dataclasses import dataclass, asdict
|
| 17 |
-
from core.config_loader import client, MODEL, MANAGER_PROMPT
|
| 18 |
from core import plan_parsing
|
| 19 |
|
| 20 |
|
|
@@ -150,7 +150,7 @@ def _format_recent_turns(turns, k=None):
|
|
| 150 |
|
| 151 |
|
| 152 |
def classify(discussion_plan_subprobes, manager_history, recent_turns,
|
| 153 |
-
current_msg, initial_argument=""):
|
| 154 |
"""Run the manager LLM call. Returns a ManagerVerdict.
|
| 155 |
|
| 156 |
- `discussion_plan_subprobes`: parsed sub-probe list from plan_parsing
|
|
@@ -183,8 +183,9 @@ def classify(discussion_plan_subprobes, manager_history, recent_turns,
|
|
| 183 |
"Output your JSON verdict now. No prose around it, JSON only."
|
| 184 |
)
|
| 185 |
|
|
|
|
| 186 |
t0 = time.perf_counter()
|
| 187 |
-
response =
|
| 188 |
model=MODEL,
|
| 189 |
reasoning={"effort": "low"},
|
| 190 |
text={"verbosity": "low"},
|
|
|
|
| 14 |
import re
|
| 15 |
import time
|
| 16 |
from dataclasses import dataclass, asdict
|
| 17 |
+
from core.config_loader import client as _default_client, MODEL, MANAGER_PROMPT
|
| 18 |
from core import plan_parsing
|
| 19 |
|
| 20 |
|
|
|
|
| 150 |
|
| 151 |
|
| 152 |
def classify(discussion_plan_subprobes, manager_history, recent_turns,
|
| 153 |
+
current_msg, initial_argument="", client=None):
|
| 154 |
"""Run the manager LLM call. Returns a ManagerVerdict.
|
| 155 |
|
| 156 |
- `discussion_plan_subprobes`: parsed sub-probe list from plan_parsing
|
|
|
|
| 183 |
"Output your JSON verdict now. No prose around it, JSON only."
|
| 184 |
)
|
| 185 |
|
| 186 |
+
api = client if client is not None else _default_client
|
| 187 |
t0 = time.perf_counter()
|
| 188 |
+
response = api.responses.create(
|
| 189 |
model=MODEL,
|
| 190 |
reasoning={"effort": "low"},
|
| 191 |
text={"verbosity": "low"},
|