We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
When using OpenAI version > 1.13.4 in pip dependencies, the following error occurs:
ImportError: cannot import name 'MessageContentText' from 'openai.types.beta.threads'
This error arises because MessageContentText is not present in openai.types.beta.threads.
MessageContentText
openai.types.beta.threads
OpenAIAssistant
from embedchain.store.assistants import OpenAIAssistant
Please ensure the OpenAI version in your dependencies is <= 1.13.4 to avoid this issue.
The text was updated successfully, but these errors were encountered:
It looks like they changed up the typing to do unions of Image and Text on MessageContent
MessageContent
You can take a look at these types: MessageContent and TextContentBlock
from openai.types.beta.threads.message_content import MessageContent from openai.types.beta.threads.text_content_block import TextContentBlock
In my case, I had to update:
From: if isinstance(messages.data[0].content[0], MessageContentText):
if isinstance(messages.data[0].content[0], MessageContentText):
To: if isinstance(messages.data[0].content[0], TextContentBlock):
if isinstance(messages.data[0].content[0], TextContentBlock):
Sorry, something went wrong.
No branches or pull requests
馃悰 Describe the bug
Issue: ImportError with OpenAI Version > 1.13.4
Description:
When using OpenAI version > 1.13.4 in pip dependencies, the following error occurs:
This error arises because
MessageContentText
is not present inopenai.types.beta.threads
.Steps to Reproduce:
OpenAIAssistant
using:Please ensure the OpenAI version in your dependencies is <= 1.13.4 to avoid this issue.
The text was updated successfully, but these errors were encountered: