[Solved ✅] Error using composio with an openai compatible API like AIML
Hi, I'm trying to use composio's RAG and file i/o tools with crewai, with a custom backend. I'm defining the base and model as such:
While going through my crew which first embeds some documents and then does RAG query on them, I'm getting the error in the file attached:
Could this be because the RAG tool internally uses an embedding model that is not available at this API? I tried switching it to together ai api, but directly got an error related to the ada embedding model not being available. When I switched my backend back to the default openai api, it worked, but while RAG querying, the agent got outputs like:
20 Replies
sunny-green•6mo ago
Hey, can you show me some glimpses of your code, if okay to you??
continuing-cyanOP•6mo ago
Yes ofc, here you go. This seems to be the relevant part:
sunny-green•6mo ago
Composio Docs
RAG Tool Agent - Composio
Composio enables your agents to connect with Various Tools and work with them
continuing-cyanOP•6mo ago
i haven't but let me try that approach. it seems like that example is using a different rag tool and wrapping its llm in the langchain ChatOpenAI module
sunny-green•6mo ago
Okay, lemme know if you get any error from there or any others 🙌
continuing-cyanOP•6mo ago
thank you!!
sunny-green•6mo ago
It was my pleasure to help you 😄
continuing-cyanOP•6mo ago
hey, so i used this and indeed it's working better than the rag tool from the sdk catalogue, but as soon as i switch the api to aiml instead of openai and gpt-4o, i get the model error with the rag query tool that i shared above. is there a way to specify the embedding model for the rag tool?
if there isn't this is probably a good feature to suggest to the devs
sunny-green•6mo ago
When you are using tools, it's better to use
gpt-4o
and gpt-4-turbo
otherwise it doesn't even connect with composio many timescontinuing-cyanOP•6mo ago
when i use gpt-4o and gpt-4o-turbo from the same provider (aiml) instead of openai, i still get the same error
so i'm fairly sure this is not a model issue, but the fact that if you change the provider from openai to something else, maybe the other provider doesn't have the embedding model that the rag tool uses internally
sunny-green•6mo ago
Can you tell me what's the error??
continuing-cyanOP•6mo ago
``````
continuing-cyanOP•6mo ago
checked the composio repo, internally the ragtool uses https://docs.embedchain.ai/
continuing-cyanOP•6mo ago
trying to check what embedding model they use by default
my error is possibly related to the fact that that model is not available on the aiml api
sunny-green•6mo ago
Okay lemme see
continuing-cyanOP•6mo ago
the error i'm getting only happens when the ragtool queries the db
sunny-green•6mo ago
Why are you not using OpenAI's one, if asking...??
continuing-cyanOP•6mo ago
working on this hackathon and they've provided a bunch of free credits for these apis, not for openai
don't wanna use my own openai for prototyping since it's gonna need a lot of tokens
also, tried changing to together ai api, and got this error in the same place:
sunny-green•6mo ago
I am sharing your issue with the team, will notify you as soon as possible.
continuing-cyanOP•6mo ago
thank you! i think the solution is basically just being able to curry the rag tool to specify the embedding model