Skip to content

Create diff for generator for multipart/form-data; if ClientModel adds a wrapper type for MultipartFormDataContent#2

Open
annelo-msft wants to merge 20 commits intoopenai-generate-multipartfrom
openai-generate-multipart2
Open

Create diff for generator for multipart/form-data; if ClientModel adds a wrapper type for MultipartFormDataContent#2
annelo-msft wants to merge 20 commits intoopenai-generate-multipartfrom
openai-generate-multipart2

Conversation

@annelo-msft
Copy link
Copy Markdown
Owner

No description provided.

@annelo-msft annelo-msft changed the base branch from openai-generate-clean to openai-generate-multipart March 16, 2024 00:13
Comment thread tsp-output/@azure-tools/typespec-csharp/src/Generated/Audio.cs
private static readonly char[] _boundaryValues = "0123456789=ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".ToCharArray();

internal async Task<(BinaryContent, string, RequestOptions)> ToMultipartContentAsync()
internal MultipartFormDataBinaryContent ToMultipartContent()
Copy link
Copy Markdown
Owner Author

@annelo-msft annelo-msft Mar 26, 2024

Choose a reason for hiding this comment

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

This feels like a nice simplification to the generated code for MPFD in #1 🤞

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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


(BinaryContent content, string contentType, RequestOptions options) = await audio.ToMultipartContentAsync().ConfigureAwait(false);
ClientResult result = await CreateTranscriptionAsync(content, contentType, options).ConfigureAwait(false);
using MultipartFormDataBinaryContent content = audio.ToMultipartContent();
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

In this version, the content-creation is not async, and the call pattern is a bit simplified.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

annelo-msft pushed a commit that referenced this pull request Apr 8, 2024
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