fix: improve tool call handling and UI adjustments

This commit is contained in:
Siddhant Rai
2025-02-13 05:02:10 +05:30
parent e209699b19
commit 8a3612e56c
4 changed files with 61 additions and 34 deletions

View File

@@ -144,7 +144,11 @@ class Agent:
if isinstance(resp, str):
yield resp
return
if hasattr(resp, "message") and hasattr(resp.message, "content"):
if (
hasattr(resp, "message")
and hasattr(resp.message, "content")
and resp.message.content is not None
):
yield resp.message.content
return
@@ -152,7 +156,11 @@ class Agent:
if isinstance(resp, str):
yield resp
elif hasattr(resp, "message") and hasattr(resp.message, "content"):
elif (
hasattr(resp, "message")
and hasattr(resp.message, "content")
and resp.message.content is not None
):
yield resp.message.content
else:
completion = self.llm.gen_stream(