Skip to content

Fix: filename not provided in chatcmpl_converter.py #1513

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

Merged
merged 1 commit into from
Aug 18, 2025
Merged

Conversation

Nifury
Copy link
Contributor

@Nifury Nifury commented Aug 17, 2025

When a file is provided in base64 encoding, only the file_data part is converted to the chat completion API format.
However, now without the filename field, OpenAI returns
openai.BadRequestError: Error code: 400 - {'error': {'message': "Missing required parameter: 'messages[1].content[1].file.file_id'.", 'type': 'invalid_request_error', 'param': 'messages[1].content[1].file.file_id', 'code': 'missing_required_parameter'}}

@seratch seratch added feature:chat-completions bug Something isn't working labels Aug 18, 2025
Copy link
Member

@seratch seratch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this; I've confirmed this is a bug and your change resolves it.

@seratch seratch merged commit a4f7204 into openai:main Aug 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature:chat-completions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants