rare-sapphire
rare-sapphire4w ago

Get started LLM issue

I was trying and testing get started llm, but it says Error code: 404 - {'error': {'message': 'The model gpt-4-turbo-preview does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}} I tried switching to different model like "gpt-4o-mini" etc , but all of those resist on: 'message': 'You exceeded your current quota, please check your plan and billing details.
12 Replies
conventional-tan
conventional-tan4w ago
Can you try to create a new API Key from OpenAI and add it to the environment, once?! If you still receive the issues, then you could share the code (or partial, where the issue is happening) with us, if you are comfortable
rare-sapphire
rare-sapphire4w ago
the issue still persist
from composio_openai import ComposioToolSet, App, Action
from openai import OpenAI

openai_client = OpenAI()
composio_toolset = ComposioToolSet()


tools = composio_toolset.get_actions(actions=[Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER])

task = "Star a repo composiohq/composio on GitHub"

response = openai_client.chat.completions.create(
model="gpt-4-turbo-preview",
tools=tools,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": task},
],
)

result = composio_toolset.handle_tool_calls(response)
print(result)
from composio_openai import ComposioToolSet, App, Action
from openai import OpenAI

openai_client = OpenAI()
composio_toolset = ComposioToolSet()


tools = composio_toolset.get_actions(actions=[Action.GITHUB_ACTIVITY_STAR_REPO_FOR_AUTHENTICATED_USER])

task = "Star a repo composiohq/composio on GitHub"

response = openai_client.chat.completions.create(
model="gpt-4-turbo-preview",
tools=tools,
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": task},
],
)

result = composio_toolset.handle_tool_calls(response)
print(result)
conventional-tan
conventional-tan4w ago
Can you try to add your API key in code (getting it through .env) As in my case, it works fine
Soham
Soham4w ago
I think your account doesn't have access to the models. Can you try using gemini may be or upgrade the openai account by going into settings.
rare-sapphire
rare-sapphire4w ago
yeah i have added it already might be the case. let me try these workarounds
like-gold
like-gold3w ago
Did you get it working with Gemini? I am facing the same issue currently
conventional-tan
conventional-tan3w ago
It will work with Gemini
like-gold
like-gold3w ago
The example source code I am using seems to rely on openAI. And the openAI npm package etc. I think I have to rewrite the code to use Gemini, do you happen to know what the Gemini npm package is called?
Soham
Soham3w ago
Composio Docs
Using Composio JS SDK with Langchain - Composio
Composio enables your agents to connect with Various Tools and work with them
Soham
Soham3w ago
This is using the langchain package. You can use this with gemini.
like-gold
like-gold3w ago
I am trying to get the SWE agent template to run. I think I need to make changes here? https://github.com/ComposioHQ/swe-js-template/blob/master/src/agents/swe.ts
GitHub
swe-js-template/src/agents/swe.ts at master · ComposioHQ/swe-js-tem...
Contribute to ComposioHQ/swe-js-template development by creating an account on GitHub.
Soham
Soham3w ago
Hey sure, so you can run the template using langchain and use gemini along with it. The only thing I have observed langchain js is okish and not a great experience. I will also try to do the same and send you an example.