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]: Creating a message for an Open AI Assistant fails because of unexpected "file_ids" parameter. #13187

Closed
shermmyy opened this issue May 1, 2024 · 4 comments
Labels
bug Something isn't working triage Issue needs to be triaged/prioritized

Comments

@shermmyy
Copy link

shermmyy commented May 1, 2024

Bug Description

Creating a message for an Open AI Assistant throws an error because of unexpected "file_ids" parameter.

Exception: TypeError: Messages.create() got an unexpected keyword argument 'file_ids'

Version

0.10.33

Steps to Reproduce

Fetch an existing Open ai assistant:

  agent = OpenAIAssistantAgent.from_existing(
      assistant_id=...,
      tools=....,
      thread_id=....,
  )

Try and send a text message

response = agent.chat(new_message)
Exception: TypeError: Messages.create() got an unexpected keyword argument 'file_ids'
Screenshot 2024-05-01 at 12 30 10 AM

Relevant Logs/Tracbacks

File ".../.venv/lib/python3.11/site-packages/llama_index/core/callbacks/utils.py", line 41, in wrapper
[2024-05-01T04:15:13.578Z]     return func(self, *args, **kwargs)
[2024-05-01T04:15:13.578Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-01T04:15:13.578Z]   File ".../.venv/lib/python3.11/site-packages/llama_index/agent/openai/openai_assistant_agent.py", line 513, in chat
[2024-05-01T04:15:13.578Z]     chat_response = self._chat(
[2024-05-01T04:15:13.578Z]                     ^^^^^^^^^^^
[2024-05-01T04:15:13.578Z]   File ".../.venv/lib/python3.11/site-packages/llama_index/agent/openai/openai_assistant_agent.py", line 472, in _chat
[2024-05-01T04:15:13.578Z]     _added_message_obj = self.add_message(message)
[2024-05-01T04:15:13.578Z]                          ^^^^^^^^^^^^^^^^^^^^^^^^^
[2024-05-01T04:15:13.578Z]   File ".../..venv/lib/python3.11/site-packages/llama_index/agent/openai/openai_assistant_agent.py", line 339, in add_message
[2024-05-01T04:15:13.578Z]     return self._client.beta.threads.messages.create(
[2024-05-01T04:15:13.578Z]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@shermmyy shermmyy added bug Something isn't working triage Issue needs to be triaged/prioritized labels May 1, 2024
Copy link

dosubot bot commented May 1, 2024

The error you're encountering with the file_ids parameter in the Messages.create() method suggests a compatibility or implementation issue. Here's how to address it:

  1. Check OpenAI API Documentation: Verify that the version of the OpenAI API you're using supports the file_ids parameter. Since it's used in the beta namespace, ensure your API version aligns with this feature.

  2. Update or Rollback OpenAI Python SDK: The issue might stem from the version of the OpenAI Python SDK you're using. Consider updating to the latest version or rolling back to a version known to support file_ids properly.

  3. Review Code Implementation: Ensure that the file_ids parameter is correctly implemented in your code. This includes verifying that it's correctly passed to the OpenAI API call and that any necessary preprocessing or validation is performed.

Without specific details on how file_ids is used in your application or the exact version of the OpenAI Python SDK in use, these steps are your best course of action to resolve the issue. If the problem persists, providing more context on your setup and usage of file_ids could help pinpoint the solution.

Details

Sources


About Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

To continue the conversation, mention @dosu.

@shermmyy shermmyy changed the title [Bug]: [Bug]: Creating a message for an Open AI Assistant fails because of unexpected "file_ids" parameter. May 1, 2024
@RussellLuo
Copy link
Contributor

Hi @shermmyy, there's a similar issue, see #13099.

@shermmyy
Copy link
Author

shermmyy commented May 1, 2024

Rolled back to openai 1.20.0 for the time being, that worked, thanks

@shermmyy shermmyy closed this as completed May 1, 2024
@nick-youngblut
Copy link

nick-youngblut commented May 23, 2024

Rolled back to openai 1.20.0 for the time being, that worked, thanks

Why is this issue closed? Isn't this still an issue, given that the llama-index code does not support the most recent versions of the openai package?

The most recent version of the openai package is 1.30.2, so users of llama-index are currently expected to roll back all the way to 1.20.0?

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

No branches or pull requests

3 participants