mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-14 02:28:30 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user