Skip to content
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

Simplify structured outputs sample code #236

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

scottaddie
Copy link
Contributor

@scottaddie scottaddie commented Oct 1, 2024

When C# string interpolation is used, the ToString() method is automatically invoked. The ToString() method on System.Text.Json.JsonElement already invokes GetString(): https://github.com/dotnet/runtime/blob/5535e31a712343a63f5d7d796cd874e563e5ac14/src/libraries/System.Text.Json/src/System/Text/Json/Document/JsonElement.cs#L1424-L1425. This behavior is also publicly documented at https://learn.microsoft.com/dotnet/api/system.text.json.jsonelement.tostring?view=net-8.0#remarks.

@trrwilson trrwilson merged commit b8ec620 into openai:main Oct 15, 2024
1 check passed
@scottaddie scottaddie deleted the scottaddie/code-sample-cleanup branch October 15, 2024 16:02
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.

2 participants