Unable to Pass Custom Component Result to Agent #5625
-
Hi, I created a custom Component to execute a "curl" commmand. If I execute as a "Component" I am able to get response in output but If I convert the same custom Componentas a "Tool" to agent. The result is not getting pass through. I am gettting below error; Error Screenshot:- If I understood correctly the response_format of the tool is coming as "Content" type. (Refer below Screenshot). I am not sure how to change to "String" or Any other datatype . Langflow Workflow :- (A Simple Agent to execute a curl command) "ExecuteCurlCommand" Component '# from langflow.field_typing import Data import subprocess class ExecuteCurlCommand(Component):
Response as a running component:- Let me know right way to pass the result to Agent . |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hey @JeraldPeter! I'm here to help you out with any bugs, questions, or contributions. Let's tackle this issue together! To resolve the issue of passing the result from your custom Here are a few steps you can take to address this:
By ensuring that the output from your component is a string and matches the expected format of the agent, you should be able to pass the result successfully. If the issue persists, reviewing the agent's input handling logic might provide further insights. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
-
How to change response_format from content to string ? |
Beta Was this translation helpful? Give feedback.
-
I tried but its not working. |
Beta Was this translation helpful? Give feedback.
@dosu
The solution also didnt work. Actually the problem lies on return type; In a tool chain method. The response will be accepted as "String" or "Object". In the current implemenation I am sending the data as json string which is unable to parse it using "Tool Chain" Implemention.
To over come this issue we need to implement "LCToolCompontent" from "langchain_utilities" and redirect the output as is to Agent.
Here is the new fix for "curlExecutorCompontent"
`# from langflow.field_typing import Data
from langflow.custom import Component
from langflow.io import MessageTextInput, Output
from langflow.schema import Data
from langflow.schema.dotdict import dotdict
from langflow.base.curl.par…