langflow icon indicating copy to clipboard operation
langflow copied to clipboard

RetrieverTool not workin

Open Owe1n opened this issue 1 year ago • 2 comments

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

image

Flow File

Vector Store RAG (1).json

Owe1n avatar Nov 20 '24 22:11 Owe1n

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:

  1. Check for Method Implementation: Verify if the RetrieverToolComponent class or its parent class CustomComponent has the set_event_manager method implemented. If not, you may need to implement this method in the RetrieverToolComponent class.

  2. Implement the Method: If the method is missing, you can implement it similarly to how it's used in other components. The set_event_manager method typically assigns an EventManager instance 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
    
  3. Review Related Code: Ensure that any other parts of the code that interact with RetrieverToolComponent are compatible with this change. This includes checking how the build method 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.

dosubot[bot] avatar Nov 20 '24 22:11 dosubot[bot]

https://github.com/langflow-ai/langflow/issues/4640 Similar Issue! We are working on it! Thank you for the feedback

edwinjosechittilappilly avatar Nov 20 '24 23:11 edwinjosechittilappilly

Tested in current main. The fix will be available in the upcoming release!

edwinjosechittilappilly avatar Nov 21 '24 14:11 edwinjosechittilappilly

@edwinjosechittilappilly I notice this issue prevents using agents with tools in the online version. Might you know please when it will be released?

dividor avatar Nov 25 '24 18:11 dividor

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: @.***>

edwinjosechittilappilly avatar Nov 25 '24 18:11 edwinjosechittilappilly

looking forward to have the fix. thank you...I'm facing the same issue.

cpizetta avatar Nov 25 '24 20:11 cpizetta

did someone try to fix it mannualy like @dosubot suggested? it worked?

cpizetta avatar Nov 25 '24 20:11 cpizetta

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.

zeeiyerWork avatar Mar 16 '25 16:03 zeeiyerWork

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

dosubot[bot] avatar Mar 16 '25 16:03 dosubot[bot]