Open efenocchi opened 1 month ago
Hey @efenocchi! 👋 I'm here to help you with any bugs, questions, or contributions while you wait for a human maintainer. Let's tackle this together!
To resolve the error "Failed to find python package for class MixtureOfAgents" when trying to download the Mixture-Of-Agents package using the llamaindex-cli
, ensure that you are using the correct package name and import statements. The correct usage should be:
llamaindex-cli
:llamaindex-cli download-llamapack MixtureOfAgentsPack --download-dir ./mixture_of_agents_pack
from llama_index.core.llama_pack import download_llama_pack
# Download and install dependencies
MixtureOfAgentsPack = download_llama_pack(
"MixtureOfAgentsPack", "./mixture_of_agents_pack"
)
from llama_index.llms.openai import OpenAI
from llama_index.llms.mistralai import MistralAI
# Add OPENAI_API_KEY and MISTRAL_API_KEY to your environment variables
mixture_of_agents_pack = MixtureOfAgentsPack(
llm=OpenAI(model="gpt-4"), # Aggregator
reference_llms=[
OpenAI(model="gpt-3.5-turbo"),
MistralAI(model="mistral-medium"),
], # Proposers
num_layers=3,
temperature=0.1,
)
# Use the pack
response = mixture_of_agents_pack.run("What is LlamaIndex?")
Make sure your code reflects these steps and import statements. If you are using MixtureOfAgents
instead of MixtureOfAgentsPack
, you need to update your code to use MixtureOfAgentsPack
[1][2].
To continue talking to Dosu, mention @dosu.
I looked at some example notebooks from other LlamaPacks and found this temporary solution (but the pip install command is nowhere)
pip install llama-index-packs-mixture-of-agents
from llama_index.packs.mixture_of_agents import MixtureOfAgentsPack
...
@efenocchi Thanks for pointing it out. I will update the readme.
Yeah, pip install llama-index-packs-mixture-of-agents
should ideally work.
@ravi03071991 Thank you!
Hi @ravi03071991, I saw your PR, be careful that this doesn't solve the problem.
The errors are here:
llamaindex-cli download-llamapack MixtureOfAgentsPack --download-dir ./mixture_of_agents_pack
and here:
from llama_index.core.llama_pack import download_llama_pack
# download and install dependencies
MixtureOfAgentsPack = download_llama_pack(
"MixtureOfAgentsPack", "./mixture_of_agents_pack"
)
The solution is:
1) install the package with pip install llama-index-packs-mixture-of-agents
2) call it directly from llama_index.packs.mixture_of_agents
:
from llama_index.packs.mixture_of_agents import MixtureOfAgentsPack
from llama_index.llms.openai import OpenAI
from llama_index.llms.mistralai import MistralAI
# Add OPENAI_API_KEY and MISTRAL_API_KEY to your env variable
mixture_of_agents_pack = MixtureOfAgentsPack(
llm=OpenAI(model="gpt-4"), # Aggregator
reference_llms=[
OpenAI(model="gpt-3.5-turbo"),
MistralAI(model="mistral-medium"),
], # Proposers
num_layers=3,
temperature=0.1,
)
response = mixture_of_agents_pack.run("What is LlamaIndex?")
the download syntax is very annoying to maintain -- we need a better way to manage it I think
Hi @logan-markewich, have anything in mind? Would like to work on this task. Else can send a simple fix for by updating given mapping/
Bug Description
Hi @ravi03071991, I tried to download the Mixture-Of-Agents package but got the following error:
Version
0.10.47
Steps to Reproduce
run
llamaindex-cli download-llamapack MixtureOfAgentsPack --download-dir ./mixture_of_agents_pack
or try downloading the package from codeRelevant Logs/Tracbacks
No response