RetrieverTool not workin
Bug Description
When trying to use RetrieverTool to have an agent connected to a VectorStore Getting the following error :
RetrieverToolComponent' object has no attribute 'set_event_manager'
Traceback (most recent call last):
File "/Users/d/miniconda3/envs/iagentflow-cookbook/lib/python3.10/site-packages/langflow/api/v1/chat.py", line 227, in _build_vertex
vertex_build_result = await graph.build_vertex(
File "/Users/d/miniconda3/envs/iagentflow-cookbook/lib/python3.10/site-packages/langflow/graph/graph/base.py", line 1419, in build_vertex
await vertex.build(
File "/Users/d/miniconda3/envs/iagentflow-cookbook/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 818, in build
await step(user_id=user_id, event_manager=event_manager, **kwargs)
File "/Users/d/miniconda3/envs/iagentflow-cookbook/lib/python3.10/site-packages/langflow/graph/vertex/base.py", line 493, in _build
self.custom_component.set_event_manager(event_manager)
AttributeError: 'RetrieverToolComponent' object has no attribute 'set_event_manager'
Reproduction
Connect a vectore store to a RetrieverTool and execute it.
Expected behavior
Compile the tool
Who can help?
No response
Operating System
Mac OS
Langflow Version
1.1
Python Version
3.10
Screenshot
Flow File
The error you're encountering, 'RetrieverToolComponent' object has no attribute 'set_event_manager', suggests that the RetrieverToolComponent class does not have a set_event_manager method implemented. This method is likely expected to be present in the component to handle event management, as indicated by the traceback.
To resolve this issue, you can consider the following steps:
-
Check for Method Implementation: Verify if the
RetrieverToolComponentclass or its parent classCustomComponenthas theset_event_managermethod implemented. If not, you may need to implement this method in theRetrieverToolComponentclass. -
Implement the Method: If the method is missing, you can implement it similarly to how it's used in other components. The
set_event_managermethod typically assigns anEventManagerinstance to an attribute, allowing the component to handle events like logging or sending messages.Here's a basic example of how you might implement it:
def set_event_manager(self, event_manager: EventManager | None = None) -> None: self._event_manager = event_manager -
Review Related Code: Ensure that any other parts of the code that interact with
RetrieverToolComponentare compatible with this change. This includes checking how thebuildmethod and other related methods are implemented.
By implementing the set_event_manager method, you should be able to resolve the AttributeError and allow the RetrieverToolComponent to function as expected.
To continue talking to Dosu, mention @dosu.
https://github.com/langflow-ai/langflow/issues/4640 Similar Issue! We are working on it! Thank you for the feedback
Tested in current main. The fix will be available in the upcoming release!
@edwinjosechittilappilly I notice this issue prevents using agents with tools in the online version. Might you know please when it will be released?
This issue is fixed and will be available in upcoming release. We have a release scheduled for this week,mostly today.
On Mon, Nov 25, 2024 at 1:13 PM Dividor @.***> wrote:
@edwinjosechittilappilly https://github.com/edwinjosechittilappilly I notice this issue prevents using agents with tools in the online version. Might you know please when it will be released?
— Reply to this email directly, view it on GitHub https://github.com/langflow-ai/langflow/issues/4740#issuecomment-2498718674, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADZ22L2EQDFI72LM5G4SPOT2CNSDJAVCNFSM6AAAAABSFS5ZDSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIOJYG4YTQNRXGQ . You are receiving this because you were mentioned.Message ID: @.***>
looking forward to have the fix. thank you...I'm facing the same issue.
did someone try to fix it mannualy like @dosubot suggested? it worked?
did someone try to fix it mannualy like @dosubot suggested? it worked? No you can't just add the method to your Retriever Component -> it errors out when trying to save.
The issue with the RetrieverToolComponent not having a set_event_manager method has been identified and is being addressed by the maintainers. A fix has been implemented and is expected to be included in an upcoming release, which is scheduled for this week. It is recommended to wait for the official release rather than attempting a manual fix, as adding the method manually may lead to further errors when trying to save the component [[id=4640]].
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other