fix assert used

This commit is contained in:
Michael Ingvarsson
2026-07-16 11:48:55 +02:00
parent a341a67727
commit cf1e33474e
3 changed files with 49 additions and 5 deletions
+4 -2
View File
@@ -71,7 +71,8 @@ class BaseAgent(Agent):
"""Run a single interaction with the agent."""
if self.model is None:
await self.initialize()
assert self.model is not None
if self.model is None:
raise RuntimeError("Model initialization failed: model is None")
messages: list[dict[str, str]] = [
{"role": "system", "content": self.system_prompt},
@@ -91,7 +92,8 @@ class BaseAgent(Agent):
"""Run the agent with tool calling capability."""
if self.model is None:
await self.initialize()
assert self.model is not None
if self.model is None:
raise RuntimeError("Model initialization failed: model is None")
try:
capture = _ActResponseCapture()