Find answers from the community

Home
Members
Ricky Spanish
R
Ricky Spanish
Offline, last seen 3 months ago
Joined September 25, 2024
does anyone have any advice on the react-agent when with some LLMS it typically responds a lot with "Thought: (Implicit) I can answer without any more tools!" even if it then goes on to provide me a garbage answer..for example i ask for an example of code from my documentation and instead it outputs a a similar java example (not even the same language i asked for the example in)
3 comments
L
R
i keep having an issue with the reactiveagent suddenly...it just keeps saying : An error occurred: 'doc_agent' to any possible query in the prompt, its triggered only after agent.chat is called, but i am providing the tools correctly:
Plain Text
query_engine_tools_step = [
    QueryEngineTool(
        query_engine=myqueryengine.as_query_engine(similarity_top_k=5),
        metadata=ToolMetadata(
            name="doc_agent",
            description="Useful for getting documentation."),
    )
]
agent = ReActAgent.from_tools(query_engine_tools_step, llm=llm, verbose=True, context_window=2000, max_iterations=100)
react_system_prompt = PromptTemplate(react_system_header_str)
agent.update_prompts({"agent_worker:system_prompt": react_system_prompt})

and in my prompt i reference the tool:

Plain Text
react_system_header_str = """ ## Tools
        You are responsible for using the tools in any sequence you deem appropriate to complete the task at hand.
        You have access to the following tools, all of which takes a simple string query as an argument: 
  
        {doc_agent}
 """ 


i removed some of the react_system_header_str since its quite long
10 comments
R
L
R
Ricky Spanish
·

React

how do i set max iterations of a reactagent?
2 comments
R
L
thanks this was exactly the issue, didnt realise how much it change and migration tool also seems to bug out so manually rewrite it is
2 comments
R
L
can i do a raw call to a llm without having any document/indexing? i cant figure out where to call .query() on if i just want a direct tool that can call to openai
2 comments
R
W
is set_global_service_context still required? when i tried swapping to a local LLM it didnt like (wanted Settings.embed_model) the call with a service context on the vector store, but now after swapping back to azureopenai it requires the service context, im not sure i understand why there is a difference
7 comments
W
R
L