mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-28 23:52:09 -04:00
fix ask-user choices across reloads (#4669)
This commit is contained in:
+8
-2
@@ -467,7 +467,7 @@ FUNCTION_TOOL_SCHEMAS = [
|
||||
"question": {"type": "string", "description": "The question to ask. Be specific and self-contained."},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"description": "2-6 mutually exclusive choices. Each is an object with a short `label` and an optional `description` explaining the trade-off.",
|
||||
"description": "2-6 choices. Each is an object with a short `label` and an optional `description` explaining the trade-off.",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@@ -477,7 +477,7 @@ FUNCTION_TOOL_SCHEMAS = [
|
||||
"required": ["label"]
|
||||
}
|
||||
},
|
||||
"multi": {"type": "boolean", "description": "Set true to let the user select multiple options instead of one. Default false."}
|
||||
"multi": {"type": "boolean", "description": "Set true ONLY when the question explicitly allows choosing more than one option. Otherwise omit it or set false. Default false."}
|
||||
},
|
||||
"required": ["question", "options"]
|
||||
}
|
||||
@@ -1406,6 +1406,12 @@ def function_call_to_tool_block(name: str, arguments: str) -> Optional[ToolBlock
|
||||
content = json.dumps(args)
|
||||
elif tool_type == "ask_teacher":
|
||||
content = args.get("model", "auto") + "\n" + args.get("problem", "")
|
||||
elif tool_type == "ask_user":
|
||||
# Keep user-facing labels readable in the tool trace. The outer SSE
|
||||
# JSON encoder will escape them for transport and JSON.parse restores
|
||||
# them once; pre-escaping here caused literal ``\u00f1`` sequences to
|
||||
# remain visible in the debug panel.
|
||||
content = json.dumps(args, ensure_ascii=False)
|
||||
else:
|
||||
content = json.dumps(args)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user