Skip to content

com.openai.unity 8.7.2#385

Merged
StephenHodgson merged 7 commits intomainfrom
development
Jun 25, 2025
Merged

com.openai.unity 8.7.2#385
StephenHodgson merged 7 commits intomainfrom
development

Conversation

@StephenHodgson
Copy link
Copy Markdown
Member

@StephenHodgson StephenHodgson commented 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

- 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
sorting
@StephenHodgson StephenHodgson marked this pull request as ready for review June 25, 2025 02:03
Copilot AI review requested due to automatic review settings June 25, 2025 02:03
Copy link
Copy Markdown
Contributor

Copilot AI left a 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 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();
Copy link

Copilot AI Jun 25, 2025

Choose a reason for hiding this comment

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

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();

Copilot uses AI. Check for mistakes.
@StephenHodgson StephenHodgson merged commit be2d8f6 into main Jun 25, 2025
4 checks passed
@StephenHodgson StephenHodgson deleted the development branch June 25, 2025 02:05
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Streaming crash with web_search_preview Add prompt to CreateModelResponse

2 participants