mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-08 07:38:29 +00:00
* move base_tool to main package and consolidate tool desscription generation * update import path * update tests * update doc * add base_tool test * migrate agent delegation tools to use BaseTool * update tests * update import path for tool * fix lint * update param signature * add from_langchain to BaseTool for backwards support of langchain tools * fix the case where StructuredTool doesn't have func --------- Co-authored-by: c0dez <li@vitablehealth.com> Co-authored-by: Brandon Hancock (bhancock_ai) <109994880+bhancockio@users.noreply.github.com>
38 lines
985 B
Python
38 lines
985 B
Python
import hashlib
|
|
from typing import Any, List, Optional
|
|
|
|
from crewai.agents.agent_builder.base_agent import BaseAgent
|
|
from crewai.tools.base_tool import BaseTool
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class TestAgent(BaseAgent):
|
|
def execute_task(
|
|
self,
|
|
task: Any,
|
|
context: Optional[str] = None,
|
|
tools: Optional[List[BaseTool]] = None,
|
|
) -> str:
|
|
return ""
|
|
|
|
def create_agent_executor(self, tools=None) -> None: ...
|
|
|
|
def _parse_tools(self, tools: List[BaseTool]) -> List[BaseTool]:
|
|
return []
|
|
|
|
def get_delegation_tools(self, agents: List["BaseAgent"]): ...
|
|
|
|
def get_output_converter(
|
|
self, llm: Any, text: str, model: type[BaseModel] | None, instructions: str
|
|
): ...
|
|
|
|
|
|
def test_key():
|
|
agent = TestAgent(
|
|
role="test role",
|
|
goal="test goal",
|
|
backstory="test backstory",
|
|
)
|
|
hash = hashlib.md5("test role|test goal|test backstory".encode()).hexdigest()
|
|
assert agent.key == hash
|