* feat: CrewAI components static files * feat: CrewAI add .md guide files * feat: CrewAI add CrewAI_components_bundle.json * chore: Comment out CrewAI section in sidebars.js --------- Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
764 lines
34 KiB
JSON
764 lines
34 KiB
JSON
{
|
|
"id": "8e7f4928-36e5-4348-bec2-166e24801b47",
|
|
"data": {
|
|
"nodes": [
|
|
{
|
|
"id": "CustomComponent-j27OA",
|
|
"type": "genericNode",
|
|
"position": { "x": 257.58598820460725, "y": -171.98904954008663 },
|
|
"data": {
|
|
"type": "CustomComponent",
|
|
"node": {
|
|
"template": {
|
|
"_type": "Component",
|
|
"llm": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "llm",
|
|
"display_name": "Language Model",
|
|
"advanced": false,
|
|
"input_types": ["LanguageModel"],
|
|
"dynamic": false,
|
|
"info": "Language model that will run the agent.",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"tools": {
|
|
"trace_as_metadata": true,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": [],
|
|
"name": "tools",
|
|
"display_name": "Tools",
|
|
"advanced": false,
|
|
"input_types": ["Tool"],
|
|
"dynamic": false,
|
|
"info": "Tools at agents disposal",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"allow_delegation": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": true,
|
|
"name": "allow_delegation",
|
|
"display_name": "Allow Delegation",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "Whether the agent is allowed to delegate tasks to other agents.",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"backstory": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "backstory",
|
|
"display_name": "Backstory",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "The backstory of the agent.",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"code": {
|
|
"type": "code",
|
|
"required": true,
|
|
"placeholder": "",
|
|
"list": false,
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "# from langflow.field_typing import Data\nfrom langflow.custom import Component\nfrom langflow.io import MessageTextInput, Output\nfrom langflow.schema import Data\nfrom langflow.io import BoolInput, IntInput, DictInput, DropdownInput, MessageTextInput, HandleInput\nfrom crewai import Agent\n\n\nclass CrewAIAgent(Component):\n display_name = \"CrewAIAgent\"\n description = \"Represents an agent of CrewAI.\"\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n\n inputs = [\n MessageTextInput(name=\"role\", display_name=\"Role\", info=\"The role of the agent.\", required=True),\n MessageTextInput(name=\"goal\", display_name=\"Goal\", info=\"The objective of the agent.\", required=True),\n MessageTextInput(name=\"backstory\", display_name=\"Backstory\", info=\"The backstory of the agent.\", required=True),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"Tools at agents disposal\",\n value=[],\n ),\n HandleInput(\n name=\"llm\",\n display_name=\"Language Model\", \n info=\"Language model that will run the agent.\",\n input_types=[\"LanguageModel\"],\n ),\n BoolInput(\n name=\"memory\",\n display_name=\"Memory\",\n info=\"Whether the agent should have memory or not\",\n advanced=True,\n value=True,\n ),\n BoolInput(\n name=\"verbose\",\n display_name=\"Verbose\",\n advanced=True,\n value=False,\n ),\n BoolInput(\n name=\"allow_delegation\",\n display_name=\"Allow Delegation\",\n info=\"Whether the agent is allowed to delegate tasks to other agents.\",\n value=True,\n ),\n DictInput(\n name=\"kwargs\",\n display_name=\"kwargs\",\n info=\"kwargs of agent.\",\n is_list=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Output\", name=\"output\", method=\"build_output\"),\n ]\n \n\n def build_output(self) -> Agent:\n kwargs = self.kwargs if self.kwargs else {}\n agent = Agent(\n role=self.role,\n goal=self.goal,\n backstory=self.backstory,\n llm=self.llm,\n verbose=self.verbose,\n memory=self.memory,\n tools=self.tools if self.tools else [],\n allow_delegation=self.allow_delegation,\n **kwargs\n )\n self.status = agent\n return agent\n",
|
|
"fileTypes": [],
|
|
"file_path": "",
|
|
"password": false,
|
|
"name": "code",
|
|
"advanced": true,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"load_from_db": false,
|
|
"title_case": false
|
|
},
|
|
"goal": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "goal",
|
|
"display_name": "Goal",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "The objective of the agent.",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"kwargs": {
|
|
"trace_as_input": true,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": {},
|
|
"name": "kwargs",
|
|
"display_name": "kwargs",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "kwargs of agent.",
|
|
"title_case": false,
|
|
"type": "dict"
|
|
},
|
|
"memory": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": true,
|
|
"name": "memory",
|
|
"display_name": "Memory",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "Whether the agent should have memory or not",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"role": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "role",
|
|
"display_name": "Role",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "The role of the agent.",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"verbose": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": false,
|
|
"name": "verbose",
|
|
"display_name": "Verbose",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
}
|
|
},
|
|
"description": "Represents an agent of CrewAI.",
|
|
"icon": "CrewAI",
|
|
"base_classes": ["Agent"],
|
|
"display_name": "CrewAIAgent",
|
|
"documentation": "https://docs.crewai.com/how-to/LLM-Connections/",
|
|
"custom_fields": {},
|
|
"output_types": [],
|
|
"pinned": false,
|
|
"conditional_paths": [],
|
|
"frozen": false,
|
|
"outputs": [
|
|
{
|
|
"types": ["Agent"],
|
|
"selected": "Agent",
|
|
"name": "output",
|
|
"display_name": "Output",
|
|
"method": "build_output",
|
|
"value": "__UNDEFINED__",
|
|
"cache": true
|
|
}
|
|
],
|
|
"field_order": [
|
|
"role",
|
|
"goal",
|
|
"backstory",
|
|
"tools",
|
|
"llm",
|
|
"memory",
|
|
"verbose",
|
|
"allow_delegation",
|
|
"kwargs"
|
|
],
|
|
"beta": false,
|
|
"edited": true
|
|
},
|
|
"id": "CustomComponent-j27OA",
|
|
"description": "Represents an agent of CrewAI.",
|
|
"display_name": "CrewAIAgent"
|
|
},
|
|
"selected": false,
|
|
"width": 384,
|
|
"height": 668,
|
|
"positionAbsolute": {
|
|
"x": 257.58598820460725,
|
|
"y": -171.98904954008663
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "CustomComponent-4UaNS",
|
|
"type": "genericNode",
|
|
"position": { "x": 677.4952370910181, "y": -169.34324846822471 },
|
|
"data": {
|
|
"type": "CustomComponent",
|
|
"node": {
|
|
"template": {
|
|
"_type": "Component",
|
|
"agent": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "agent",
|
|
"display_name": "Agent",
|
|
"advanced": false,
|
|
"input_types": ["Agent"],
|
|
"dynamic": false,
|
|
"info": "Agent responsible for task execution. Represents entity performing task.",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"tools": {
|
|
"trace_as_metadata": true,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "tools",
|
|
"display_name": "Tools",
|
|
"advanced": false,
|
|
"input_types": ["Tool"],
|
|
"dynamic": false,
|
|
"info": "List of tools/resources limited for task execution.",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"async_execution": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": true,
|
|
"name": "async_execution",
|
|
"display_name": "Async Execution",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "Boolean flag indicating asynchronous task execution.",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"code": {
|
|
"type": "code",
|
|
"required": true,
|
|
"placeholder": "",
|
|
"list": false,
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "from langflow.custom import Component\nfrom langflow.io import BoolInput, DictInput, DropdownInput, MessageTextInput, HandleInput\nfrom crewai import Task, Agent\n\nclass CrewAITask(Component):\n display_name: str = \"CrewAITask\"\n description: str = \"Each task must have a description, an expected output and an agent responsible for execution.\"\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\n icon = \"CrewAI\"\n \n inputs = [\n MessageTextInput(\n name=\"description\",\n display_name=\"Description\",\n info=\"Descriptive text detailing task's purpose and execution.\",\n required=True,\n ),\n MessageTextInput(\n name=\"expected_output\",\n display_name=\"Expected Output\",\n info=\"Clear definition of expected task outcome.\",\n required=True,\n ),\n HandleInput(\n name=\"tools\",\n display_name=\"Tools\",\n input_types=[\"Tool\"],\n is_list=True,\n info=\"List of tools/resources limited for task execution.\",\n ),\n HandleInput(\n name=\"agent\",\n display_name=\"Agent\",\n input_types=[\"Agent\"],\n info=\"Agent responsible for task execution. Represents entity performing task.\",\n ),\n BoolInput(\n name=\"async_execution\",\n display_name=\"Async Execution\",\n value=False,\n advanced=True,\n info=\"Boolean flag indicating asynchronous task execution.\",\n ),\n ]\n \n outputs = [\n # Output(display_name=\"Agent\", name=\"agent_output\", method=\"agent_response\"),\n Output(display_name=\"Task\", name=\"task_output\", method=\"build_task\"),\n ]\n\n def agent_response(self) -> Agent:\n output = self.agent\n self.status = output\n return output\n\n def build_task(self) -> Task:\n task = Task(\n description=self.description,\n expected_output=self.expected_output,\n tools=self.tools if self.tools else [],\n async_execution=self.async_execution,\n agent=self.agent\n )\n self.status = task\n return task\n",
|
|
"fileTypes": [],
|
|
"file_path": "",
|
|
"password": false,
|
|
"name": "code",
|
|
"advanced": true,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"load_from_db": false,
|
|
"title_case": false
|
|
},
|
|
"description": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "description",
|
|
"display_name": "Description",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "Descriptive text detailing task's purpose and execution.",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"expected_output": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "expected_output",
|
|
"display_name": "Expected Output",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "Clear definition of expected task outcome.",
|
|
"title_case": false,
|
|
"type": "str"
|
|
}
|
|
},
|
|
"description": "Each task must have a description, an expected output and an agent responsible for execution.",
|
|
"icon": "CrewAI",
|
|
"base_classes": ["Task"],
|
|
"display_name": "CrewAITask",
|
|
"documentation": "https://docs.crewai.com/how-to/LLM-Connections/",
|
|
"custom_fields": {},
|
|
"output_types": [],
|
|
"pinned": false,
|
|
"conditional_paths": [],
|
|
"frozen": false,
|
|
"outputs": [
|
|
{
|
|
"types": ["Task"],
|
|
"selected": "Task",
|
|
"name": "task_output",
|
|
"display_name": "Task",
|
|
"method": "build_task",
|
|
"value": "__UNDEFINED__",
|
|
"cache": true
|
|
}
|
|
],
|
|
"field_order": [
|
|
"description",
|
|
"expected_output",
|
|
"tools",
|
|
"agent",
|
|
"async_execution"
|
|
],
|
|
"beta": false,
|
|
"edited": true
|
|
},
|
|
"id": "CustomComponent-4UaNS",
|
|
"description": "Each task must have a description, an expected output and an agent responsible for execution.",
|
|
"display_name": "CrewAITask"
|
|
},
|
|
"selected": false,
|
|
"width": 384,
|
|
"height": 526,
|
|
"dragging": false,
|
|
"positionAbsolute": { "x": 677.4952370910181, "y": -169.34324846822471 }
|
|
},
|
|
{
|
|
"id": "CustomComponent-OiXk9",
|
|
"type": "genericNode",
|
|
"position": { "x": 1096.3000687375263, "y": -163.76595453399347 },
|
|
"data": {
|
|
"type": "CustomComponent",
|
|
"node": {
|
|
"template": {
|
|
"_type": "Component",
|
|
"agents": {
|
|
"trace_as_metadata": true,
|
|
"list": true,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "agents",
|
|
"display_name": "Agents",
|
|
"advanced": false,
|
|
"input_types": ["Agent"],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"tasks": {
|
|
"trace_as_metadata": true,
|
|
"list": true,
|
|
"required": true,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "tasks",
|
|
"display_name": "Tasks",
|
|
"advanced": false,
|
|
"input_types": ["Task"],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "other"
|
|
},
|
|
"code": {
|
|
"type": "code",
|
|
"required": true,
|
|
"placeholder": "",
|
|
"list": false,
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "from langflow.custom import Component\r\nfrom crewai import Crew, Task, Agent, Process\r\nfrom typing import List, Optional\r\nfrom langflow.field_typing import Text\r\nfrom langflow.io import NestedDictInput, DropdownInput, MessageTextInput, HandleInput\r\nfrom langflow.schema.message import Message\r\n\r\nclass CrewAICrew(Component):\r\n display_name: str = \"CrewAICrew\"\r\n description: str = \"Represents a group of agents, defining how they should collaborate and the tasks they should perform.\"\r\n documentation: str = \"https://docs.crewai.com/how-to/LLM-Connections/\"\r\n icon = \"CrewAI\"\r\n\r\n inputs = [\r\n HandleInput(name=\"agents\", display_name=\"Agents\", input_types=[\"Agent\"], is_list=True, required=True),\r\n HandleInput(name=\"tasks\", display_name=\"Tasks\", input_types=[\"Task\"], is_list=True, required=True),\r\n MessageTextInput(name=\"topic\", display_name=\"Topic\", value = \"\"),\r\n IntInput(name=\"verbose\", display_name=\"Verbose\", value=0, advanced=True),\r\n BoolInput(name=\"memory\", display_name=\"Memory\", value=False, advanced=True),\r\n BoolInput(name=\"use_cache\", display_name=\"Cache\", value=True, advanced=True),\r\n IntInput(name=\"max_rpm\", display_name=\"Max RPM\", value=100, advanced=True),\r\n DropdownInput(name=\"process\", display_name=\"Process\", value=Process.sequential, options=[Process.sequential,Process.hierarchical]),\r\n BoolInput(name=\"share_crew\", display_name=\"Share Crew\", value=False, advanced=True),\r\n NestedDictInput(name=\"input\", display_name=\"Input\", value={\"topic\": \"\"}, is_list=True),\r\n ]\r\n \r\n outputs = [\r\n Output(display_name=\"Output\", name=\"output\", method=\"build_output\"),\r\n ]\r\n\r\n async def build_output(self) -> Message:\r\n if not self.agents or not self.tasks:\r\n raise ValueError(\"No agents or tasks have been added.\")\r\n with open(\"dir.txt\",\"w\") as f:\r\n f.write(str(dir(Crew)))\r\n response = Crew(\r\n agents=self.agents,\r\n tasks=self.tasks,\r\n process=Process.sequential,\r\n verbose=self.verbose,\r\n memory=self.memory,\r\n cache=self.use_cache,\r\n max_rpm=self.max_rpm,\r\n share_crew=self.share_crew,\r\n )\r\n message = await response.kickoff_async(inputs=self.input)\r\n self.status = message\r\n return message\r\n\r\n",
|
|
"fileTypes": [],
|
|
"file_path": "",
|
|
"password": false,
|
|
"name": "code",
|
|
"advanced": true,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"load_from_db": false,
|
|
"title_case": false
|
|
},
|
|
"input": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": { "topic": "" },
|
|
"name": "input",
|
|
"display_name": "Input",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "NestedDict"
|
|
},
|
|
"max_rpm": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": 100,
|
|
"name": "max_rpm",
|
|
"display_name": "Max RPM",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "int"
|
|
},
|
|
"memory": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": false,
|
|
"name": "memory",
|
|
"display_name": "Memory",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"process": {
|
|
"trace_as_metadata": true,
|
|
"options": ["sequential", "hierarchical"],
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "sequential",
|
|
"name": "process",
|
|
"display_name": "Process",
|
|
"advanced": false,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"share_crew": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": true,
|
|
"name": "share_crew",
|
|
"display_name": "Share Crew",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"topic": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "topic",
|
|
"display_name": "Topic",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"use_cache": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": true,
|
|
"name": "use_cache",
|
|
"display_name": "Cache",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "bool"
|
|
},
|
|
"verbose": {
|
|
"trace_as_metadata": true,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "0",
|
|
"name": "verbose",
|
|
"display_name": "Verbose",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"type": "int"
|
|
}
|
|
},
|
|
"description": "Represents a group of agents, defining how they should collaborate and the tasks they should perform.",
|
|
"icon": "CrewAI",
|
|
"base_classes": ["Message"],
|
|
"display_name": "CrewAICrew",
|
|
"documentation": "https://docs.crewai.com/how-to/LLM-Connections/",
|
|
"custom_fields": {},
|
|
"output_types": [],
|
|
"pinned": false,
|
|
"conditional_paths": [],
|
|
"frozen": false,
|
|
"outputs": [
|
|
{
|
|
"types": ["Message"],
|
|
"selected": "Message",
|
|
"name": "output",
|
|
"display_name": "Output",
|
|
"method": "build_output",
|
|
"value": "__UNDEFINED__",
|
|
"cache": true
|
|
}
|
|
],
|
|
"field_order": [
|
|
"agents",
|
|
"tasks",
|
|
"topic",
|
|
"verbose",
|
|
"memory",
|
|
"use_cache",
|
|
"max_rpm",
|
|
"process",
|
|
"share_crew",
|
|
"input"
|
|
],
|
|
"beta": false,
|
|
"edited": true
|
|
},
|
|
"id": "CustomComponent-OiXk9",
|
|
"description": "Represents a group of agents, defining how they should collaborate and the tasks they should perform.",
|
|
"display_name": "CrewAICrew"
|
|
},
|
|
"selected": false,
|
|
"width": 384,
|
|
"height": 631,
|
|
"positionAbsolute": {
|
|
"x": 1096.3000687375263,
|
|
"y": -163.76595453399347
|
|
},
|
|
"dragging": false
|
|
},
|
|
{
|
|
"id": "CustomComponent-ZGe4u",
|
|
"type": "genericNode",
|
|
"position": { "x": -181.09156441161912, "y": -164.86510111633868 },
|
|
"data": {
|
|
"type": "CustomComponent",
|
|
"node": {
|
|
"template": {
|
|
"_type": "Component",
|
|
"code": {
|
|
"type": "code",
|
|
"required": true,
|
|
"placeholder": "",
|
|
"list": false,
|
|
"show": true,
|
|
"multiline": true,
|
|
"value": "# from langflow.field_typing import Data\nfrom langflow.custom import Component\nfrom langflow.schema import Data\nfrom langchain.agents import Tool\nfrom langflow.io import MessageTextInput, Output, SecretStrInput\nfrom crewai_tools import GithubSearchTool\n\n\nclass CrewAIGithubSearchTool(Component):\n display_name = \"CrewAIGithubSearchTool\"\n description = \"Search a github repo's content\"\n icon = \"CrewAI\"\n\n inputs = [\n MessageTextInput(name=\"github_repo\", display_name=\"Github Repo\", info=\"Fill it if you want to filter by specific github repo\"),\n SecretStrInput(name=\"gh_token\", display_name=\"Github Token\"),\n MessageTextInput(\n name=\"content_types\",\n display_name=\"Content Types\",\n value=[],\n info=\"Specifies the types of content to include in your search, options=['code', 'repo', 'pr', 'issue']\",\n is_list=True\n ),\n DictInput(\n name=\"kwargs\",\n display_name=\"kwargs\",\n info=\"kwargs of agent.\",\n is_list=True,\n advanced=True,\n ),\n ]\n\n outputs = [\n Output(display_name=\"Output\", name=\"output\", method=\"build_output\"),\n ]\n \n\n def build_output(self) -> Tool:\n if self.content_types is None or not all([(item in ['code', 'repo', 'pr', 'issue']) for item in self.content_types]):\n raise Exception(\"Each content_type must be one of: ['code', 'repo', 'pr', 'issue']\")\n kwargs = self.kwargs if self.kwargs else {}\n tool = GithubSearchTool(\n github_repo=self.github_repo,\n content_types=self.content_types,\n **kwargs\n ).to_langchain()\n self.status = tool\n return tool\n",
|
|
"fileTypes": [],
|
|
"file_path": "",
|
|
"password": false,
|
|
"name": "code",
|
|
"advanced": true,
|
|
"dynamic": true,
|
|
"info": "",
|
|
"load_from_db": false,
|
|
"title_case": false
|
|
},
|
|
"content_types": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": ["repo"],
|
|
"name": "content_types",
|
|
"display_name": "Content Types",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "Specifies the types of content to include in your search, options=['code', 'repo', 'pr', 'issue']",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"gh_token": {
|
|
"load_from_db": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "gh_token",
|
|
"display_name": "Github Token",
|
|
"advanced": false,
|
|
"input_types": [],
|
|
"dynamic": false,
|
|
"info": "",
|
|
"title_case": false,
|
|
"password": true,
|
|
"type": "str"
|
|
},
|
|
"github_repo": {
|
|
"trace_as_input": true,
|
|
"trace_as_metadata": true,
|
|
"load_from_db": false,
|
|
"list": false,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": "",
|
|
"name": "github_repo",
|
|
"display_name": "Github Repo",
|
|
"advanced": false,
|
|
"input_types": ["Message"],
|
|
"dynamic": false,
|
|
"info": "Fill it if you want to filter by specific github repo",
|
|
"title_case": false,
|
|
"type": "str"
|
|
},
|
|
"kwargs": {
|
|
"trace_as_input": true,
|
|
"list": true,
|
|
"required": false,
|
|
"placeholder": "",
|
|
"show": true,
|
|
"value": {},
|
|
"name": "kwargs",
|
|
"display_name": "kwargs",
|
|
"advanced": true,
|
|
"dynamic": false,
|
|
"info": "kwargs of agent.",
|
|
"title_case": false,
|
|
"type": "dict"
|
|
}
|
|
},
|
|
"description": "Search a github repo's content",
|
|
"icon": "CrewAI",
|
|
"base_classes": ["Tool"],
|
|
"display_name": "GithubSearchToolSchema",
|
|
"documentation": "",
|
|
"custom_fields": {},
|
|
"output_types": [],
|
|
"pinned": false,
|
|
"conditional_paths": [],
|
|
"frozen": false,
|
|
"outputs": [
|
|
{
|
|
"types": ["Tool"],
|
|
"selected": "Tool",
|
|
"name": "output",
|
|
"display_name": "Output",
|
|
"method": "build_output",
|
|
"value": "__UNDEFINED__",
|
|
"cache": true,
|
|
"hidden": false
|
|
}
|
|
],
|
|
"field_order": [
|
|
"github_repo",
|
|
"gh_token",
|
|
"content_types",
|
|
"kwargs"
|
|
],
|
|
"beta": false,
|
|
"edited": false
|
|
},
|
|
"id": "CustomComponent-ZGe4u",
|
|
"description": "Search a github repo's content",
|
|
"display_name": "GithubSearchToolSchema"
|
|
},
|
|
"selected": false,
|
|
"width": 384,
|
|
"height": 495,
|
|
"positionAbsolute": {
|
|
"x": -181.09156441161912,
|
|
"y": -164.86510111633868
|
|
},
|
|
"dragging": false
|
|
}
|
|
],
|
|
"edges": [],
|
|
"viewport": {
|
|
"x": 200.0180336822798,
|
|
"y": 213.68209801369642,
|
|
"zoom": 0.6935154845656925
|
|
}
|
|
},
|
|
"description": "The CrewAI Bundle with Agent, Task, crew and tool components.",
|
|
"name": "CrewAI Bundle",
|
|
"last_tested_version": "",
|
|
"endpoint_name": null,
|
|
"is_component": false
|
|
}
|