Skip to content

Fix data URI TryParse contract#1230

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/data-uri-tryparse-contract
Open

Fix data URI TryParse contract#1230
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/data-uri-tryparse-contract

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • catch invalid base64 payloads in DataEncodingHelpers.TryParseDataUri and return false instead of leaking FormatException
  • add a chat smoke test that deserializes an invalid file data URI and verifies it is rejected with ArgumentException

Notes

  • this keeps the existing file-content validation behavior intact while fixing the Try* helper contract underneath it
  • I intentionally did not change the separate image_url fallback behavior in this PR
  • I was not able to run the test suite locally because the dotnet SDK is not installed in this environment

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

Successfully merging this pull request may close these issues.

1 participant