Find answers from the community

Updated 6 months ago

@Logan M I'm trying to use a CoA agent

At a glance

The community member is trying to use a CoA agent, but is encountering an error with the as_agent() method. They have tried using different versions of the llama-index-core library, but the error persists. Some community members suggest that the as_agent() method should be available in the CoAAgentWorker class, which inherits from BaseAgentWorker. Another community member confirms that the method works fine for them locally and on Google Colab. However, there is no explicitly marked answer to the issue.

Useful resources
I'm trying to use a CoA agent but the method .as_agent() results in an error "AttributeError: 'CoAAgentWorker' object has no attribute 'as_agent'":

worker = CoAAgentWorker.from_tools(
tools=query_engine_tools,
llm=Settings.llm,
verbose=True,
)

agent = worker.as_agent()

I have already tried using the current version 0.10.49 and the version 0.10.33 for llama index and llama index core where the as_agent() method was added and both give the same error. as_agent() wasn't reported to be deprecated in the changelogs
L
h
7 comments
its not deprecated? It works fine for me in the latest versions of llama-index-core
If you are running in a notebook, you'll need to restart after changing versions
I'm using vsc and I've already tried restarting both the computer and ide between versions
Is there supposed to be an as_agent() method defined in CoAAgentWorker? I can't see it in the sourcecode but it is present in BaseAgentWorker
CoAAgentWorker inherits from BaseAgentWorker
You can see in the colab above it works fine
Add a reply
Sign up and join the conversation on Discord