com.openai.unity 8.7.2#385
Merged
StephenHodgson merged 7 commits intomainfrom Jun 25, 2025
Merged
Conversation
- Add support for predefined prompts in Responses endpoint - Fixed WebSearchToolPreview streaming annotation deserialization - Added IAnnotation - Added UrlCitation - Added ContainerFileCitation - Responses.TextContent.Annotations array type changed from Annotation to IAnnotation - Added Responses.TextContent.LogProbs
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR upgrades the Unity package to version 8.7.2, adding support for predefined prompts in the Responses endpoint and addressing deserialization issues with streaming annotations.
- Adds new JSON constructors and converts properties to get-only auto-properties for several response types.
- Updates switch-case logic in the ResponsesEndpoint to merge handling of several tool call statuses.
- Introduces a new Prompt class and adjusts serialization for annotations and log probability information.
Reviewed Changes
Copilot reviewed 39 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Updated version from 8.7.1 to 8.7.2. |
| WebSearchPreviewTool.cs, UserLocation.cs, TextContent.cs | Refactored constructors and properties for immutability; added LogProbs property in TextContent. |
| ResponsesEndpoint.cs | Reorganized switch cases for tool and file search events. |
| MCPToolList.cs | Removed null check exception in tool names initialization. |
| MCPTool.cs | Added JsonConstructor overload and changed requireApproval parameter type. |
| Annotation.cs and related common annotation files | Modified annotation properties to use nullable types and adjusted property names. |
| Various converter and support files | Updated serialization converters to serialize rather than throwing on write. |
Comments suppressed due to low confidence (2)
OpenAI/Packages/com.openai.unity/Runtime/Responses/MCPTool.cs:64
- The parameter 'requireApproval' is typed as object, which may be ambiguous. Consider using a more specific type (e.g., bool or a custom type) to clarify its intended usage and improve type safety.
[JsonProperty("require_approval")] object requireApproval)
OpenAI/Packages/com.openai.unity/Runtime/Common/Annotation.cs:26
- The constructor references an undeclared variable 'index'. It is likely that the intended assignment was to use one of the provided constructor parameters (such as 'startIndex'). Please update the assignment to reference the correct variable.
Index = index;
| public MCPToolList(IEnumerable<string> toolNames) | ||
| { | ||
| ToolNames = toolNames?.ToList() ?? throw new ArgumentNullException(nameof(toolNames)); | ||
| ToolNames = toolNames?.ToList(); |
There was a problem hiding this comment.
The removal of the null check that previously threw an ArgumentNullException may allow a null value for ToolNames. Consider adding explicit null validation or a default empty list to prevent potential null reference issues.
Suggested change
| ToolNames = toolNames?.ToList(); | |
| ToolNames = (toolNames ?? new List<string>()).ToList(); |
github-actions Bot
pushed a commit
that referenced
this pull request
Jun 25, 2025
- Add support for predefined prompts in Responses endpoint - Fixed WebSearchToolPreview streaming annotation deserialization - Added IAnnotation - Added UrlCitation - Added ContainerFileCitation - Responses.TextContent.Annotations array type changed from Annotation to IAnnotation - Added Responses.TextContent.LogProbs - Fixed Responses Tool serialization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.