Skip to content

Commit

Permalink
style: Fix mypy issues
Browse files Browse the repository at this point in the history
  • Loading branch information
RezaRahemtola committed Feb 16, 2025
1 parent c758b40 commit 88b0700
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libertai_agents/libertai_agents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(
self.system_prompt = system_prompt
self.tools = tools
self.llamacpp_params = llamacpp_params
self.call_session = None
self.call_session: ClientSession | None = None

if expose_api:
# Define API routes
Expand Down Expand Up @@ -121,10 +121,10 @@ async def generate_answer(
# TODO: handle error correctly
raise ValueError("Model didn't respond")

tool_calls = self.model.extract_tool_calls_from_response(response)
if len(tool_calls) == 0:
yield Message(role="assistant", content=response)
return
tool_calls = self.model.extract_tool_calls_from_response(response)
if len(tool_calls) == 0:
yield Message(role="assistant", content=response)
return

# Executing the detected tool calls
tool_calls_message = self.__create_tool_calls_message(tool_calls)
Expand Down

0 comments on commit 88b0700

Please sign in to comment.