ruff
This commit is contained in:
@@ -19,12 +19,10 @@ from agentlite import (
|
||||
Message,
|
||||
TextPart,
|
||||
ToolCall,
|
||||
ToolOk,
|
||||
ToolError,
|
||||
tool,
|
||||
)
|
||||
from agentlite.provider import ChatProvider, StreamedMessage, TokenUsage
|
||||
from agentlite.tool import Tool, ToolResult
|
||||
from agentlite.provider import StreamedMessage, TokenUsage
|
||||
from agentlite.tool import Tool
|
||||
|
||||
|
||||
# =============================================================================
|
||||
|
||||
@@ -8,7 +8,7 @@ from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from agentlite import Agent, TextPart
|
||||
from agentlite import Agent
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
|
||||
@@ -17,7 +17,7 @@ import pytest
|
||||
# Add src to path
|
||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent / "src"))
|
||||
|
||||
from agentlite import Agent, OpenAIProvider, LLMClient, llm_complete
|
||||
from agentlite import Agent, OpenAIProvider, LLMClient
|
||||
from agentlite.skills import discover_skills, SkillTool, index_skills_by_name
|
||||
from agentlite.tools import ConfigurableToolset
|
||||
|
||||
@@ -74,7 +74,7 @@ async def test_agent_with_tools():
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
from agentlite.tools import ToolSuiteConfig, ReadFile, Glob
|
||||
from agentlite.tools import ToolSuiteConfig
|
||||
|
||||
provider = get_provider()
|
||||
|
||||
@@ -173,7 +173,6 @@ async def test_subagents():
|
||||
print("=" * 60)
|
||||
|
||||
try:
|
||||
from agentlite.labor_market import LaborMarket
|
||||
from agentlite.tools.multiagent.task import Task
|
||||
|
||||
provider = get_provider()
|
||||
@@ -246,7 +245,7 @@ async def test_skills():
|
||||
skill_tool = SkillTool(skill_index, parent_agent=agent)
|
||||
agent.tools.add(skill_tool)
|
||||
|
||||
print(f"✅ Added SkillTool to agent")
|
||||
print("✅ Added SkillTool to agent")
|
||||
print("✅ Skills test PASSED")
|
||||
return True
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ from __future__ import annotations
|
||||
import os
|
||||
import sys
|
||||
import asyncio
|
||||
import signal
|
||||
|
||||
sys.path.insert(0, "/home/tcmofashi/proj/l2d_backend/agentlite/src")
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ async def main():
|
||||
start_time = time.time()
|
||||
message = "Run 'echo test' and tell me the result."
|
||||
|
||||
logger.info(f"\n=== Starting Agent Run ===")
|
||||
logger.info("\n=== Starting Agent Run ===")
|
||||
logger.info(f"Message: {message}")
|
||||
logger.info(f"Max iterations: {agent.max_iterations}")
|
||||
logger.info(f"Tools: {[t.name for t in agent.tools.tools]}")
|
||||
@@ -178,7 +178,7 @@ async def main():
|
||||
output_preview = output[:100] if output else "None"
|
||||
logger.info(f" Output preview: {output_preview}...")
|
||||
except asyncio.TimeoutError:
|
||||
logger.error(f" !!! Tool execution TIMEOUT")
|
||||
logger.error(" !!! Tool execution TIMEOUT")
|
||||
output = "Tool execution timed out"
|
||||
is_error = True
|
||||
except Exception as e:
|
||||
@@ -209,7 +209,7 @@ async def main():
|
||||
final_response = f"Max iterations ({agent.max_iterations}) reached"
|
||||
|
||||
logger.info(f"\n{'=' * 60}")
|
||||
logger.info(f"FINAL RESULT:")
|
||||
logger.info("FINAL RESULT:")
|
||||
logger.info(f"{'=' * 60}")
|
||||
logger.info(f"{final_response}")
|
||||
logger.info(f"Total iterations: {iterations}")
|
||||
|
||||
@@ -22,11 +22,6 @@ from agentlite import Agent, OpenAIProvider
|
||||
from agentlite.tools import (
|
||||
ConfigurableToolset,
|
||||
ToolSuiteConfig,
|
||||
Shell,
|
||||
ReadFile,
|
||||
WriteFile,
|
||||
Glob,
|
||||
Grep,
|
||||
)
|
||||
|
||||
# =============================================================================
|
||||
|
||||
@@ -17,7 +17,7 @@ from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from agentlite import Agent, TextPart, tool
|
||||
from agentlite import Agent, tool
|
||||
|
||||
|
||||
# =============================================================================
|
||||
|
||||
@@ -16,7 +16,7 @@ from typing import Any
|
||||
import pytest
|
||||
import yaml
|
||||
|
||||
from agentlite import Agent, Message, TextPart, tool
|
||||
from agentlite import Agent, tool
|
||||
|
||||
|
||||
def tool_output(result: Any) -> Any:
|
||||
|
||||
@@ -6,7 +6,6 @@ and all exception types.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import pytest
|
||||
|
||||
from agentlite.provider import (
|
||||
TokenUsage,
|
||||
@@ -106,7 +105,6 @@ class TestChatProviderProtocol:
|
||||
def test_protocol_is_runtime_checkable(self):
|
||||
"""Test that ChatProvider is runtime checkable."""
|
||||
# ChatProvider should have @runtime_checkable
|
||||
from typing import runtime_checkable
|
||||
|
||||
assert hasattr(ChatProvider, "__protocol_attrs__")
|
||||
|
||||
|
||||
@@ -195,7 +195,6 @@ class TestToolDecoratorMemorixBug:
|
||||
This is an integration-style test to ensure the decorated tool
|
||||
has all required attributes for Agent usage.
|
||||
"""
|
||||
from agentlite import Agent, OpenAIProvider
|
||||
|
||||
@tool()
|
||||
async def add_memory(content: str, importance: float = 0.5) -> dict:
|
||||
|
||||
Reference in New Issue
Block a user