mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-26 16:48:13 +00:00
fix
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
from typing import Optional
|
from typing import Dict, Optional, Union
|
||||||
|
|
||||||
from pydantic import BaseModel, Field
|
from pydantic import BaseModel, Field
|
||||||
|
|
||||||
@@ -18,8 +18,8 @@ class AddImageToolSchema(BaseModel):
|
|||||||
class AddImageTool(BaseTool):
|
class AddImageTool(BaseTool):
|
||||||
"""Tool for adding images to the content"""
|
"""Tool for adding images to the content"""
|
||||||
|
|
||||||
name: str = Field(default_factory=lambda: i18n.tools("add_image").get("name"))
|
name: str = Field(default_factory=lambda: i18n.tools("add_image")["name"])
|
||||||
description: str = Field(default_factory=lambda: i18n.tools("add_image").get("description"))
|
description: str = Field(default_factory=lambda: i18n.tools("add_image")["description"])
|
||||||
args_schema: type[BaseModel] = AddImageToolSchema
|
args_schema: type[BaseModel] = AddImageToolSchema
|
||||||
|
|
||||||
def _run(
|
def _run(
|
||||||
@@ -28,7 +28,7 @@ class AddImageTool(BaseTool):
|
|||||||
action: Optional[str] = None,
|
action: Optional[str] = None,
|
||||||
**kwargs,
|
**kwargs,
|
||||||
) -> dict:
|
) -> dict:
|
||||||
action = action or i18n.tools("add_image").get("default_action")
|
action = action or i18n.tools("add_image")["default_action"]
|
||||||
content = [
|
content = [
|
||||||
{"type": "text", "text": action},
|
{"type": "text", "text": action},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,13 +20,13 @@ class AgentTools:
|
|||||||
delegate_tool = DelegateWorkTool(
|
delegate_tool = DelegateWorkTool(
|
||||||
agents=self.agents,
|
agents=self.agents,
|
||||||
i18n=self.i18n,
|
i18n=self.i18n,
|
||||||
description=self.i18n.tools("delegate_work").format(coworkers=coworkers),
|
description=self.i18n.tools("delegate_work").format(coworkers=coworkers), # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
ask_tool = AskQuestionTool(
|
ask_tool = AskQuestionTool(
|
||||||
agents=self.agents,
|
agents=self.agents,
|
||||||
i18n=self.i18n,
|
i18n=self.i18n,
|
||||||
description=self.i18n.tools("ask_question").format(coworkers=coworkers),
|
description=self.i18n.tools("ask_question").format(coworkers=coworkers), # type: ignore
|
||||||
)
|
)
|
||||||
|
|
||||||
return [delegate_tool, ask_tool]
|
return [delegate_tool, ask_tool]
|
||||||
|
|||||||
Reference in New Issue
Block a user