Merge PR #184: feat: Home Assistant integration (REST tools + WebSocket gateway)
Authored by 0xbyt4. Adds smart home control via REST tools (ha_list_entities, ha_get_state, ha_call_service) with domain blocklist and entity_id validation, plus WebSocket gateway adapter for real-time event monitoring. Also includes Gemini 3 thought_signature preservation fix (extra_content on tool calls) needed for multi-turn tool calling via OpenRouter.
This commit is contained in:
commit
db0521ce0e
15 changed files with 2494 additions and 7 deletions
12
run_agent.py
12
run_agent.py
|
|
@ -2212,7 +2212,7 @@ class AIAgent:
|
|||
response_item_id if isinstance(response_item_id, str) else None,
|
||||
)
|
||||
|
||||
tool_calls.append({
|
||||
tc_dict = {
|
||||
"id": call_id,
|
||||
"call_id": call_id,
|
||||
"response_item_id": response_item_id,
|
||||
|
|
@ -2222,7 +2222,15 @@ class AIAgent:
|
|||
"arguments": tool_call.function.arguments
|
||||
},
|
||||
}
|
||||
)
|
||||
# Preserve extra_content (e.g. Gemini thought_signature) so it
|
||||
# is sent back on subsequent API calls. Without this, Gemini 3
|
||||
# thinking models reject the request with a 400 error.
|
||||
extra = getattr(tool_call, "extra_content", None)
|
||||
if extra is not None:
|
||||
if hasattr(extra, "model_dump"):
|
||||
extra = extra.model_dump()
|
||||
tc_dict["extra_content"] = extra
|
||||
tool_calls.append(tc_dict)
|
||||
msg["tool_calls"] = tool_calls
|
||||
|
||||
return msg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue