Fix some ruff issues in code
This commit is contained in:
+7
-4
@@ -2,7 +2,8 @@
|
||||
|
||||
import json
|
||||
import logging
|
||||
from typing import Any, AsyncGenerator
|
||||
from collections.abc import AsyncGenerator
|
||||
from typing import Any
|
||||
|
||||
from infrastructure.persistence import get_memory
|
||||
|
||||
@@ -77,7 +78,7 @@ class Agent:
|
||||
tools_spec = self.prompt_builder.build_tools_spec()
|
||||
|
||||
# Tool execution loop
|
||||
for iteration in range(self.max_tool_iterations):
|
||||
for _iteration in range(self.max_tool_iterations):
|
||||
# Call LLM with tools
|
||||
llm_result = self.llm.complete(messages, tools=tools_spec)
|
||||
|
||||
@@ -229,7 +230,7 @@ class Agent:
|
||||
tools_spec = self.prompt_builder.build_tools_spec()
|
||||
|
||||
# Tool execution loop
|
||||
for iteration in range(self.max_tool_iterations):
|
||||
for _iteration in range(self.max_tool_iterations):
|
||||
# Call LLM with tools
|
||||
llm_result = self.llm.complete(messages, tools=tools_spec)
|
||||
|
||||
@@ -317,7 +318,9 @@ class Agent:
|
||||
)
|
||||
|
||||
# Stream tool result as content
|
||||
result_text = f"\n🔧 {tool_name}: {json.dumps(tool_result, ensure_ascii=False)}\n"
|
||||
result_text = (
|
||||
f"\n🔧 {tool_name}: {json.dumps(tool_result, ensure_ascii=False)}\n"
|
||||
)
|
||||
yield {
|
||||
"id": completion_id,
|
||||
"object": "chat.completion.chunk",
|
||||
|
||||
Reference in New Issue
Block a user