Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: LATS Agent Cookbook is incorrect #13140

Open
tituslhy opened this issue Apr 28, 2024 · 1 comment
Open

[Bug]: LATS Agent Cookbook is incorrect #13140

tituslhy opened this issue Apr 28, 2024 · 1 comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@tituslhy
Copy link

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

@tituslhy tituslhy added bug Something isn't working triage Issue needs to be triaged/prioritized labels Apr 28, 2024
Copy link

dosubot bot commented Apr 28, 2024

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.

Details

Sources


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.

To continue the conversation, mention @dosu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized
Projects
None yet
Development

No branches or pull requests

1 participant