mirror of https://github.com/aliasrobotics/cai.git
Merge b92fc723f0 into 62871b6f5a
This commit is contained in:
commit
5a1aa3d2ab
|
|
@ -132,7 +132,7 @@ def main() -> int:
|
|||
|
||||
try:
|
||||
with open(args.result_file, "w", encoding="utf-8") as f:
|
||||
json.dump(payload, f, ensure_ascii=False)
|
||||
json.dump(payload, f, ensure_ascii=False, default=str)
|
||||
except Exception as write_error: # pylint: disable=broad-except
|
||||
print(f"[CAI worker] failed to write result file: {write_error}", file=sys.stderr)
|
||||
return 2
|
||||
|
|
|
|||
|
|
@ -125,10 +125,13 @@ def _get_agent_token_info():
|
|||
from cai.sdk.agents.models.openai_chatcompletions import ACTIVE_MODEL_INSTANCES
|
||||
|
||||
if ACTIVE_MODEL_INSTANCES:
|
||||
# Get the most recent instance (highest instance ID)
|
||||
latest_key = max(ACTIVE_MODEL_INSTANCES.keys(), key=lambda x: x[1])
|
||||
model_ref = ACTIVE_MODEL_INSTANCES[latest_key]
|
||||
model = model_ref() if model_ref else None
|
||||
try:
|
||||
# Get the most recent instance (highest instance ID)
|
||||
latest_key = max(ACTIVE_MODEL_INSTANCES.keys(), key=lambda x: x[1])
|
||||
model_ref = ACTIVE_MODEL_INSTANCES.get(latest_key)
|
||||
model = model_ref() if model_ref else None
|
||||
except Exception:
|
||||
model = None
|
||||
|
||||
if model:
|
||||
# Get display name with ID
|
||||
|
|
|
|||
Loading…
Reference in New Issue