mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 09:08:31 +00:00
Initial commit for the Canary Crew project using crewAI. Includes workflow for GitHub Actions, project configuration, agent and task YAML files, main execution and utility scripts, a custom tool example, user knowledge file, and documentation. Enables multi-agent AI research and reporting with markdown output.
20 lines
668 B
Python
20 lines
668 B
Python
from crewai.tools import BaseTool
|
|
from typing import Type
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class MyCustomToolInput(BaseModel):
|
|
"""Input schema for MyCustomTool."""
|
|
argument: str = Field(..., description="Description of the argument.")
|
|
|
|
class MyCustomTool(BaseTool):
|
|
name: str = "Name of my tool"
|
|
description: str = (
|
|
"Clear description for what this tool is useful for, your agent will need this information to use it."
|
|
)
|
|
args_schema: Type[BaseModel] = MyCustomToolInput
|
|
|
|
def _run(self, argument: str) -> str:
|
|
# Implementation goes here
|
|
return "this is an example of a tool output, ignore it and move along."
|