Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: OpenAIAssistantAgent now breaks because of OpenAI api changes #12968

Closed
parnell opened this issue Apr 20, 2024 · 2 comments · Fixed by #13341
Closed

[Bug]: OpenAIAssistantAgent now breaks because of OpenAI api changes #12968

parnell opened this issue Apr 20, 2024 · 2 comments · Fixed by #13341
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@parnell
Copy link

parnell commented Apr 20, 2024

Bug Description

OpenAI changed their api and now llama-index has errors with OpenAIAssistantAgent.

Comment from OpenAI about the issue I believe.
From [https://docs.llamaindex.ai/en/stable/examples/agent/openai_assistant_agent/](LLama Index example code)

from llama_index.agent.openai import OpenAIAssistantAgent

agent = OpenAIAssistantAgent.from_new(
    name="Math Tutor",
    instructions="You are a personal math tutor. Write and run code to answer math questions.",
    openai_tools=[{"type": "code_interpreter"}],
    instructions_prefix="Please address the user as Jane Doe. The user has a premium account.",
)

How should I resolve this until it gets resolved in a better manner?

Version

0.10.30

Steps to Reproduce

from llama_index.agent.openai import OpenAIAssistantAgent

agent = OpenAIAssistantAgent.from_new(
    name="Math Tutor",
    instructions="You are a personal math tutor. Write and run code to answer math questions.",
    openai_tools=[{"type": "code_interpreter"}],
    instructions_prefix="Please address the user as Jane Doe. The user has a premium account.",
)

Relevant Logs/Tracbacks

Traceback (most recent call last):
  File ".../projects/server/error.py", line 7, in <module>
    agent = OpenAIAssistantAgent.from_new(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/.../lib/python3.11/site-packages/llama_index/agent/openai/openai_assistant_agent.py", line 230, in from_new
    assistant = client.beta.assistants.create(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Assistants.create() got an unexpected keyword argument 'file_ids'
@parnell parnell added bug Something isn't working triage Issue needs to be triaged/prioritized labels Apr 20, 2024
Copy link

dosubot bot commented Apr 20, 2024

Hello @parnell! 👋 I'm Dosu, a bot here to help you squash bugs, answer your questions, and guide you towards becoming a contributor while we wait for a human maintainer to chime in. I'm looking into your issue with the OpenAIAssistantAgent and will get back to you with a solution shortly!

@logan-markewich
Copy link
Collaborator

logan-markewich commented Apr 20, 2024

Nothing to be done except a PR that fixes it 👍🏻 Will try to take a look this weekend, but feel free to make a PR now if you are motivated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants