-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
AstraDB + Tool Calling Agent + Retriever tool - does not work after upgrade to v1.1 #5294
Comments
Hello @TOWaB! I'm here to help you solve bugs, answer questions, and become a contributor. The error you're encountering, In the updated version, argument passing to the Here are a few steps you can take to troubleshoot and resolve the issue:
By focusing on how the arguments are constructed and passed, you should be able to identify the source of the error and make the necessary adjustments. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Dear @erichare, I am sorry to chase, but did you have a chance to look at the above, I have exhausted all the avenues and ideas I have on how to fix it. |
@TOWaB not yet, but would you be able to provide your flow file by exporting it in the Langflow UI? (if there's anything proprietary or sensitive please remove it first, minimal example of the error is ideal). I'll check it out today! |
@erichare I have attached a basic version of the flow. If you need more details, happy to share on an email or similar. Really appreciate the help, thank you very much. |
@TOWaB sorry, i might be missing something, but i loaded the flow, and im not actually seeing an Astra DB / similarity search component in the flow between the input and output? I see a couple that are isolated. could you highlight for me, maybe in a screenshot, where you're getting that error in the flow diagram you attached? Thank you! |
Bug Description
I am using a tool calling agent to retrieve information from 3 tools based on logic.
If Q is about X got to tool X and so on...
This worked absolutely fine until I upgraded to v1.1
I have managed to get it tested it and working in Datastax environment before moving to my own environment. In Datastax environment still works fine, but in my environment I get the following error in the tool calling agent:
TypeError: AstraDBVectorStore.asimilarity_search() got multiple values for argument 'query'
This is the fool error on the node:
Error building Component Context and Logic Agent:
Traceback (most recent call last):
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/base/agents/events.py", line 258, in process_agent_events
async for event in agent_executor:
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1388, in astream_events
async for event in event_stream:
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tracers/event_stream.py", line 1012, in _astream_events_implementation_v2
await task
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tracers/event_stream.py", line 967, in consume_astream
async for _ in event_streamer.tap_output_aiter(run_id, stream):
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tracers/event_stream.py", line 203, in tap_output_aiter
async for chunk in output:
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain/agents/agent.py", line 1805, in astream
async for step in iterator:
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain/agents/agent_iterator.py", line 266, in aiter
async for chunk in self.agent_executor._aiter_next_step(
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain/agents/agent.py", line 1551, in _aiter_next_step
result = await asyncio.gather(
^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain/agents/agent.py", line 1584, in _aperform_agent_action
observation = await tool.arun(
^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tools/base.py", line 839, in arun
raise error_to_raise
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tools/base.py", line 805, in arun
response = await asyncio.create_task(coro, context=context) # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tools/simple.py", line 111, in _arun
return await self.coroutine(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/tools/retriever.py", line 45, in _aget_relevant_documents
docs = await retriever.ainvoke(query, config={"callbacks": callbacks})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/retrievers.py", line 329, in ainvoke
raise e
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/retrievers.py", line 322, in ainvoke
result = await self._aget_relevant_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langchain_core/vectorstores/base.py", line 1101, in _aget_relevant_documents
docs = await self.vectorstore.asimilarity_search(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: AstraDBVectorStore.asimilarity_search() got multiple values for argument 'query'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/graph/vertex/base.py", line 709, in _build_results
result = await initialize.loading.get_instance_results(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/interface/initialize/loading.py", line 68, in get_instance_results
return await build_component(params=custom_params, custom_component=custom_component)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/interface/initialize/loading.py", line 145, in build_component
build_results, artifacts = await custom_component.build_results()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 837, in build_results
return await self._build_with_tracing()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 819, in _build_with_tracing
_results, _artifacts = await self._build_results()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/custom/custom_component/component.py", line 883, in _build_results
result = await method()
^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/base/agents/agent.py", line 82, in message_response
message = await self.run_agent(agent=agent)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/base/agents/agent.py", line 158, in run_agent
result = await process_agent_events(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/azureuser/langflow/lib/python3.12/site-packages/langflow/base/agents/events.py", line 269, in process_agent_events
raise ExceptionWithMessageError(agent_message) from e
langflow.base.agents.events.ExceptionWithMessageError
Reproduction
Expected behavior
Use logic to select the correct tools to perform a search and retrieve data to give an answer
Who can help?
No response
Operating System
Windows
Langflow Version
1.1.1
Python Version
None
Screenshot
No response
Flow File
No response
The text was updated successfully, but these errors were encountered: