From ed0a4782a21d8e564f8956c87e022e8caef851ac Mon Sep 17 00:00:00 2001 From: Claude Code Date: Fri, 27 Nov 2026 20:03:34 +0530 Subject: Commit tracked-file changes required for a working Agentux install The committed provider/base.py, config.py, models.py, errors.py and tools were missing symbols (e.g. TextCallback) that agent.py imports, so a clean clone produced a broken install. Commit these so the remote's committed state is complete and cloneable. Co-Authored-By: Claude Code --- src/agentux/models.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/agentux/models.py') diff --git a/src/agentux/models.py b/src/agentux/models.py index afb17cd..0dc42f1 100644 --- a/src/agentux/models.py +++ b/src/agentux/models.py @@ -55,6 +55,33 @@ class Message(BaseModel): payload["tool_call_id"] = self.tool_call_id return payload + @classmethod + def from_dict(cls, data: Dict[str, Any]) -> Message: + role = data.get("role", "user") + content = data.get("content") + tool_call_id = data.get("tool_call_id") + raw_calls = data.get("tool_calls") + parsed_calls = None + if raw_calls: + parsed_calls = [] + for c in raw_calls: + fn = c.get("function", {}) if isinstance(c.get("function"), dict) else {} + args = fn.get("arguments", {}) + if isinstance(args, str): + import json + try: + args = json.loads(args) + except Exception: + args = {} + parsed_calls.append( + ToolCall( + id=c.get("id", ""), + name=fn.get("name", c.get("name", "")), + arguments=args if isinstance(args, dict) else {}, + ) + ) + return cls(role=role, content=content, tool_calls=parsed_calls, tool_call_id=tool_call_id) + class ToolDefinition(BaseModel): """A tool advertised to the model. -- cgit v1.2.3