-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An error occurs when calling flowasTool using ToolCallAagent #3865
Comments
I found a similar issue that might help you resolve the error. The issue titled Asyncio Thread error when running Flow as Tool with a Agent was closed by a pull request that refactored Additionally, ensure that your async def run_agent(self) -> Message:
if "input" not in self.user_prompt:
raise ValueError("Prompt must contain 'input' key.")
messages = [
("system", self.system_prompt),
("placeholder", "{chat_history}"),
("human", self.user_prompt),
("placeholder", "{agent_scratchpad}"),
]
prompt = ChatPromptTemplate.from_messages(messages)
agent = create_tool_calling_agent(self.llm, self.tools, prompt)
runnable = AgentExecutor.from_agent_and_tools(
agent=cast(BaseSingleActionAgent, agent),
tools=self.tools,
verbose=True,
handle_parsing_errors=self.handle_parsing_errors,
)
input_dict: dict[str, str | list[Dict[str, str]]] = {"input": self.input_value}
if hasattr(self, "memory") and self.memory:
input_dict["chat_history"] = self.convert_chat_history(self.memory)
result = await runnable.ainvoke(input_dict)
self.status = result
if "output" not in result:
raise ValueError("Output key not found in result. Tried 'output'.")
result_string = result["output"]
return Message(text=result_string) Make sure your user_prompt = "Please process the following input: {input}" |
I'm sure I added {input} to the ToolCallAgent component promnt |
hi @alex-ge123, can you please provide the JSON file with your flows (the main flow you want to run and the others you want to use as a Tool). this way I can debug here to understand what can be causing the error for you. thanks! |
@alex-ge123 |
Bug Description
Reproduction
An error occurs when calling flowasTool using ToolCallAagent
Expected behavior
An error occurs when calling flowasTool using ToolCallAagent
Who can help?
No response
Operating System
windows
Langflow Version
1.0.18
Python Version
3.11
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered: