You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like there's a mistake in the LATS Agent Cookbook documentation you've encountered. The correct initialization should indeed use agent = AgentRunner(agent_worker) instead of agent = agent.as_worker(), which would result in an undefined 'agent' error due to the incorrect reference.
The AgentRunner class is designed to manage the execution of tasks, utilizing LATSAgentWorker for specific task operations within the LlamaIndex framework. This setup is crucial for the Language Agent Tree Search (LATS) algorithm, where num_expansions controls the number of candidate actions generated during each expansion phase, and max_rollouts limits the search algorithm's iterations.
I'll ensure this documentation inconsistency is highlighted for correction. For further details or guidance, you might want to check the LlamaIndex GitHub repository or the specific documentation links provided for LATSAgentWorker and AgentRunner.
If you have any more questions or need further assistance, feel free to reach out.
About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
Bug Description
Under this cell, "agent" is not defined. Therefore the agent = agent.as_worker() control function will fail.
`from llama_index.agent.lats import LATSAgentWorker
agent_worker = LATSAgentWorker.from_tools(
query_engine_tools,
llm=llm,
num_expansions=2,
max_rollouts=3, # using -1 for unlimited rollouts
verbose=True,
)
agent = agent.as_worker()`
The correct code is written in the llama-index integration link (https://llamahub.ai/l/agent/llama-index-agent-lats?from=agent).
agent = AgentRunner(agent_worker)
and everything will turn out ok :)Version
0.10.32
Steps to Reproduce
`from llama_index.agent.lats import LATSAgentWorker
agent_worker = LATSAgentWorker.from_tools(
query_engine_tools,
llm=llm,
num_expansions=2,
max_rollouts=3, # using -1 for unlimited rollouts
verbose=True,
)
agent = agent.as_worker()`
Relevant Logs/Tracbacks
No response
The text was updated successfully, but these errors were encountered: