Skip to content

PNG and JPEG returning error #27

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

Open
apexerainc opened this issue Jul 8, 2024 · 5 comments
Open

PNG and JPEG returning error #27

apexerainc opened this issue Jul 8, 2024 · 5 comments

Comments

@apexerainc
Copy link

When I go to upload an image to my assistant I get this call back (other file types work)
Traceback:
File "/Users/portal/Library/Caches/pypoetry/virtualenvs/gpt-assistants-api-ui-FZcNcgmK-py3.11/lib/python3.11/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 600, in _run_script
exec(code, module.dict)
File "/Users/portal/gpt-assistants-api-ui/app.py", line 336, in
main()
File "/Users/portal/gpt-assistants-api-ui/app.py", line 330, in main
load_chat_screen(single_agent_id, single_agent_title)
File "/Users/portal/gpt-assistants-api-ui/app.py", line 288, in load_chat_screen
run_stream(user_msg, file, assistant_id)
File "/Users/portal/gpt-assistants-api-ui/app.py", line 208, in run_stream
create_message(st.session_state.thread, user_input, file)
File "/Users/portal/gpt-assistants-api-ui/app.py", line 171, in create_message
client.beta.threads.messages.create(
File "/Users/portal/Library/Caches/pypoetry/virtualenvs/gpt-assistants-api-ui-FZcNcgmK-py3.11/lib/python3.11/site-packages/openai/resources/beta/threads/messages.py", line 88, in create
return self._post(
^^^^^^^^^^^
File "/Users/portal/Library/Caches/pypoetry/virtualenvs/gpt-assistants-api-ui-FZcNcgmK-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1240, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/portal/Library/Caches/pypoetry/virtualenvs/gpt-assistants-api-ui-FZcNcgmK-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 921, in request
return self._request(
^^^^^^^^^^^^^^
File "/Users/portal/Library/Caches/pypoetry/virtualenvs/gpt-assistants-api-ui-FZcNcgmK-py3.11/lib/python3.11/site-packages/openai/_base_client.py", line 1020, in _request
raise self._make_status_error_from_response(err.response) from None

Any idea why?

@bzbwqz
Copy link
Contributor

bzbwqz commented Aug 26, 2024

Are you using Azure Openai instead of Openai? Azure doesn't support image file from file search of assistant api.

@trotor
Copy link

trotor commented Sep 8, 2024

Same problem, but also with openai api:
BadRequestError: Error code: 400 - {'error': {'message': 'Files with extensions

[.jpg] are not supported for retrieval. See

https://platform.openai.com/docs/assistants/tools/file-search/supported-files',

'type': 'invalid_request_error', 'param': None, 'code': 'unsupported_file'}}

And the page includes no image files.

@ryo-ma
Copy link
Owner

ryo-ma commented Sep 23, 2024

#30
done.

But I want to support image uploading as a message.
Would anyone like to try it?

@ryo-ma
Copy link
Owner

ryo-ma commented Sep 23, 2024

https://platform.openai.com/docs/assistants/deep-dive/creating-image-input-content

@trotor
Copy link

trotor commented Sep 23, 2024

#30 done.

But I want to support image uploading as a message. Would anyone like to try it?

absolutely!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants