openai / openai-dotnet

The official .NET library for the OpenAI API
https://www.nuget.org/packages/OpenAI
MIT License
707 stars 60 forks source link

Address non-ASCII filename support for files, audio, etc. #75

Closed trrwilson closed 1 week ago

trrwilson commented 1 week ago

Fixes #72.

The library's multipart/form-data implementation uses custom logic to bypass the use of the filename* Content-Disposition parameter, which is RFC 6266's method of encoding non-ASCII filenames in multipart/form-data requests. This bypass was made in deference to an interpretation of RFC 7578 wherein the use of filename* is disallowed.

This PR removes the restriction by directly using System.Net.Http.MultipartFormDataContent.Add()'s filename* behavior.

Although pending discussion with the Base Common Library team is still needed to clarify best interoperability practices, this is a better current state because: