-
Notifications
You must be signed in to change notification settings - Fork 341
Add support for included properties (a.k.a. include) in Responses
#820
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
base: main
Are you sure you want to change the base?
Conversation
12196d4 to
7d0b7ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR renames the internal InternalIncludable type to IncludedResponseProperty and makes it public, supporting the new "include" feature for OpenAI Response API calls. The change enables developers to specify which optional properties (like encrypted reasoning content) should be included in responses.
Key changes:
- Renamed
InternalIncludable→IncludedResponsePropertyand made it public with[Experimental("OPENAI001")]attribute - Updated
ResponseCreationOptions.Includeproperty toIncludedPropertieswith public access - Added
include_obfuscationquery parameter support toGetResponseoperations - Added test coverage for reasoning with store disabled using the new include functionality
Reviewed Changes
Copilot reviewed 11 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Generated/Models/Responses/InternalIncludable.cs | Removed (deleted internal type) |
| src/Custom/Responses/Internal/InternalIncludable.cs | Removed (deleted internal type) |
| src/Generated/Models/Responses/IncludedResponseProperty.cs | New public struct replacing InternalIncludable |
| src/Custom/Responses/IncludedResponseProperty.cs | Custom partial with renamed property members |
| src/Generated/Models/Responses/ResponseCreationOptions.cs | Updated to use IncludedResponseProperty |
| src/Generated/Models/Responses/ResponseCreationOptions.Serialization.cs | Updated serialization for renamed property |
| src/Custom/Responses/ResponseCreationOptions.cs | Made IncludedProperties public |
| src/Generated/OpenAIResponseClient.cs | Added GetResponse overloads with new parameters |
| src/Generated/OpenAIResponseClient.RestClient.cs | Updated to use IncludedResponseProperty and add include_obfuscation parameter |
| src/Custom/Responses/OpenAIResponseClient.cs | Updated method signatures for GetResponse operations |
| src/Custom/Responses/OpenAIResponseClient.Protocol.cs | Removed (functionality moved to generated code) |
| src/Generated/OpenAIModelFactory.cs | Added factory method for ResponseCreationOptions |
| tests/Responses/ResponsesTests.cs | Added test for reasoning with store disabled |
| tests/SessionRecords/ResponsesTests/*.json | Test recordings for new test cases |
| specification/base/typespec/responses/operations.tsp | Updated getResponse operation signature |
| api/OpenAI.netstandard2.0.cs | Updated API surface |
| api/OpenAI.net8.0.cs | Updated API surface |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,11 @@ | |||
| namespace OpenAI.Responses; | |||
|
|
|||
| [CodeGenType("Includable")] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, Krzysztof would be twitching if he saw a member named "Includable"
| response_id: string, | ||
|
|
||
| @query(#{ name: "include[]", explode: true }) | ||
| includables?: Includable[] = #[], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTF even is #[] ?
| public readonly partial struct IncludedResponseProperty | ||
| { | ||
| [CodeGenMember("MessageInputImageImageUrl")] | ||
| public static IncludedResponseProperty MessageInputImageUri { get; } = new IncludedResponseProperty(MessageInputImageImageUrlValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@clientName can't do this? That seems like something it should cover...
In addition to offering the expected functionality, this change also fixes #779. That is because the failure reported in this issue is by design, and to fix it, users must request the encrypted reasoning content via the included properties like this:
For more context, see the following docs:
From: 🔗 https://platform.openai.com/docs/guides/reasoning#encrypted-reasoning-items