mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-23 07:08:14 +00:00
ignore
This commit is contained in:
@@ -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")["name"])
|
name: str = Field(default_factory=lambda: i18n.tools("add_image")["name"]) # type: ignore
|
||||||
description: str = Field(default_factory=lambda: i18n.tools("add_image")["description"])
|
description: str = Field(default_factory=lambda: i18n.tools("add_image")["description"]) # type: ignore
|
||||||
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")["default_action"]
|
action = action or i18n.tools("add_image")["default_action"] # type: ignore
|
||||||
content = [
|
content = [
|
||||||
{"type": "text", "text": action},
|
{"type": "text", "text": action},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ class ToolUsage:
|
|||||||
self._printer.print(content=f"\n\n{error}\n", color="red")
|
self._printer.print(content=f"\n\n{error}\n", color="red")
|
||||||
return error
|
return error
|
||||||
|
|
||||||
if isinstance(tool, CrewStructuredTool) and tool.name == self._i18n.tools("add_image")["name"]:
|
if isinstance(tool, CrewStructuredTool) and tool.name == self._i18n.tools("add_image")["name"]: # type: ignore
|
||||||
try:
|
try:
|
||||||
result = self._use(tool_string=tool_string, tool=tool, calling=calling)
|
result = self._use(tool_string=tool_string, tool=tool, calling=calling)
|
||||||
return result
|
return result
|
||||||
|
|||||||
Reference in New Issue
Block a user