Find answers from the community

B
Bo
Offline, last seen 2 months ago
Joined September 25, 2024
B
Bo
·

Return direct

Hi all, I was wondering if some of you worked with ReactAgents. I have tried the return_direct argument. In the backend, I can see the "Observation" from the agent that contains the final answer. I have then to wait to have the answer streamed in the front (the exact same answer). Do you understand why?

Plain Text
 top_level_sub_tools = [
    QueryEngineTool.from_defaults(
        query_engine=qualitative_question_engine,
        name="qualitative_question_engine",
        description="""
            A query engine that can answer qualitative questions about documents
            """.strip(),
        return_direct=True,
    ),
    ]

    chat_engine = ReActAgent.from_tools(
        tools=top_level_sub_tools,
        llm=chat_llm,
        chat_history=chat_history,
        verbose=True,
        callback_manager=Settings.callback_manager,
        max_function_calls=1,
    )
    
5 comments
B
L