Find answers from the community

Updated 3 weeks ago

Building a Generic Agent with Various Language Models

Hi guys! In my project I've been using OpenAiAgent with llms from OpenAI and, in some cases, AzureOpenAI. Now I would like to be able to use Agents outside OpenAI's ecocystem, like Calude, Bedrock deploys and so on. I couldn't find a "generic" way of building an Agent with other LLMs, I understand the possibility is also constraint in some cases with the capability of function calling, but maybe I didn't search enough. Have anyone faced a similar challenge?
W
L
2 comments
Hey, For using llm other than OpenAI just need to pass the new llm reference or just define it globally:
Plain Text
from llama_index.core import Settings
Settings.llm = llm # your claude llm reference


Also for creating agents, you can use ReactAgent: https://docs.llamaindex.ai/en/stable/examples/agent/react_agent/

There are lots of examples as well there, just check the left section on this page
Assuming the llm has a function calling api, you can use FunctionCallingAgent. Otherwise, use the ReActAgent yea
Add a reply
Sign up and join the conversation on Discord