Fix lint issues and update agent.execute_task for recursion depth

- Remove unused imports and variables in test files
- Replace bare except with specific exception in structured_output_converter.py
- Fix None comparison in llm_test.py
- Update agent.execute_task to accept recursion_depth parameter

Resolves all remaining lint issues for A2A protocol implementation.

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-25 04:20:26 +00:00
parent 14145268d2
commit b7e4d074a5
9 changed files with 34 additions and 44 deletions

View File

@@ -225,6 +225,7 @@ class Agent(BaseAgent):
task: Task,
context: Optional[str] = None,
tools: Optional[List[BaseTool]] = None,
recursion_depth: int = 0,
) -> str:
"""Execute a task with the agent.

View File

@@ -1,4 +1,4 @@
from typing import Any, AsyncIterable, Dict, List, Optional
from typing import Any, Dict, List, Optional
from pydantic import Field, PrivateAttr
@@ -22,7 +22,6 @@ from crewai.utilities.events.agent_events import (
)
try:
from langchain_core.messages import ToolMessage
from langgraph.checkpoint.memory import MemorySaver
from langgraph.prebuilt import create_react_agent

View File

@@ -74,7 +74,7 @@ The output should be raw JSON that exactly matches the specified schema.
# Validate it's proper JSON
json.loads(extracted)
return extracted
except:
except json.JSONDecodeError:
pass
return result