-
Notifications
You must be signed in to change notification settings - Fork 328
Closed
Labels
area: imagesThis item is related to Images.This item is related to Images.issue-addressedWorkflow: The OpenAI maintainers believe the issue to be addressed and ready to close.Workflow: The OpenAI maintainers believe the issue to be addressed and ready to close.questionCategory: The issue is seeking information about the library or its usage.Category: The issue is seeking information about the library or its usage.
Description
Describe the bug
- Docs link: https://platform.openai.com/docs/guides/images-vision?api-mode=responses&format=base64-encoded
- While running the code sample, https://github.com/justinyoo/openai-dotnet/blob/docs/images-vision/docs/guides/images-vision/responses/analyze_images_passing_base64_string.cs, it's OK to use either stream or byte array. But base64-encoded string throws an exception like:
Unhandled exception. System.ClientModel.ClientResultException: HTTP 400 (invalid_request_error: invalid_value)
Parameter: input
The image data you provided does not represent a valid image. Please check your input and try again with one of the supported image formats: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].
Steps to reproduce
- Run this code, https://github.com/justinyoo/openai-dotnet/blob/docs/images-vision/docs/guides/images-vision/responses/analyze_images_passing_base64_string.cs
- See the error below:
Unhandled exception. System.ClientModel.ClientResultException: HTTP 400 (invalid_request_error: invalid_value)
Parameter: input
The image data you provided does not represent a valid image. Please check your input and try again with one of the supported image formats: ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].
at OpenAI.ClientPipelineExtensions.ProcessMessage(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
at OpenAI.Responses.OpenAIResponseClient.CreateResponse(BinaryContent content, RequestOptions options)
at OpenAI.Responses.OpenAIResponseClient.CreateResponse(IEnumerable`1 inputItems, ResponseCreationOptions options, CancellationToken cancellationToken)
at Program.<Main>$(String[] args) in C:\Users\justi\dev\gh\openai-dotnet\docs\guides\images-vision\responses\analyze_images_passing_base64_string.cs:line 43
at Program.<Main>(String[] args)
Code snippets
Here's the code snippet link: https://github.com/justinyoo/openai-dotnet/blob/docs/images-vision/docs/guides/images-vision/responses/analyze_images_passing_base64_string.cs
OS
Windows
.NET version
.NET 10 RC1
Library version
2.4.0
Metadata
Metadata
Assignees
Labels
area: imagesThis item is related to Images.This item is related to Images.issue-addressedWorkflow: The OpenAI maintainers believe the issue to be addressed and ready to close.Workflow: The OpenAI maintainers believe the issue to be addressed and ready to close.questionCategory: The issue is seeking information about the library or its usage.Category: The issue is seeking information about the library or its usage.