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

Threads messages list misinterprets the block type #1346

Open
1 task done
sketch873 opened this issue Apr 19, 2024 · 0 comments
Open
1 task done

Threads messages list misinterprets the block type #1346

sketch873 opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@sketch873
Copy link

sketch873 commented Apr 19, 2024

Confirm this is an issue with the Python library and not an underlying OpenAI API

  • This is an issue with the Python library

Describe the bug

When getting the messages list for the last response in a run, I sometimes get the following content
content=[ImageFileContentBlock(image_file=None, type='text', text={'value': '...'}, (...) ) ]
instead of
content=[TextContentBlock(text=Text(annotations=[], value="..."), (...))]

The ImageFileContentBlock comes when asking for data from files and the TextContentBlock when asking generic questions like "how are you?". Even if it is the default behavior (not sure why image file of type text), these structures are not structured in the same way, the first one has the 'text' field a dictionary and the second one has a Text object

To Reproduce

  1. create a message (client.beta.threads.messages.create)
  2. create a run and wait for response (client.beta.threads.runs.create_and_poll)
  3. get response (client.beta.threads.messages.list)

Code snippets

messages = client.beta.threads.messages.list(
            thread_id=thread_id,
            run_id=run_id,
            timeout=requests_timeout
        )

OS

Linux

Python version

Python v3.11.4

Library version

openai v1.23.1

@sketch873 sketch873 added the bug Something isn't working label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants