mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-07-03 14:09:24 +00:00
Merge branch 'main' into ci/python-pr-size-gate
This commit is contained in:
@@ -767,10 +767,11 @@ class CustomSearchTool(BaseTool):
|
||||
```python
|
||||
from crewai.tools import tool
|
||||
|
||||
@tool("Calculator")
|
||||
def calculator(expression: str) -> str:
|
||||
"""Evaluates a mathematical expression and returns the result."""
|
||||
return str(eval(expression))
|
||||
@tool("WordCount")
|
||||
def word_count(text: str) -> str:
|
||||
"""Counts the number of words in the given text."""
|
||||
count = len(text.split())
|
||||
return f"Word count: {count}"
|
||||
```
|
||||
|
||||
### Built-in Tools (install with `uv add crewai-tools`)
|
||||
|
||||
Reference in New Issue
Block a user