cscore icon indicating copy to clipboard operation
cscore copied to clipboard

Feature/urp blur

Open cs-util opened this issue 4 months ago • 0 comments

This pull request introduces several improvements and new features across the codebase, focusing primarily on OpenAI API integration, Unity UI enhancements, and CI workflow automation. The most significant changes include stricter validation and configuration for OpenAI chat requests, the addition of a custom blur shader for Unity's Universal Render Pipeline (URP), and a new GitHub Actions workflow for running and reporting .NET tests.

OpenAI API improvements:

  • Replaced the max_tokens property with max_completion_tokens in OpenAi.cs to align with the latest OpenAI API specification and clarified its usage in both request classes. The constructors were updated to remove manual token calculation logic. [1] [2] [3]
  • Added stricter validation for JSON schema response formats: now throws exceptions if additionalProperties is set to true, if the schema name does not match the required pattern, or if the schema type is not "object". This ensures compatibility with OpenAI's strict JSON schema requirements. [1] [2]
  • Introduced a convenience method to set the response format to a JSON schema based on a generic type, simplifying API usage.

Unity UI and rendering enhancements:

  • Added a new custom blur shader (BlurUrp.shader) and associated material (BlurUrp.mat) for the Universal Render Pipeline, enabling advanced blur effects for UI elements. Included all necessary Unity asset metadata files for integration. [1] [2] [3] [4] [5] [6]

Continuous Integration and Testing:

  • Added a new GitHub Actions workflow (dotnet-tests.yml) for building, running, and reporting .NET tests, with safe caching and exclusion of integration tests for faster feedback. Automated test result reporting is included for non-forked pull requests.

Miscellaneous improvements:

  • Improved enum validation by excluding system enums from power-of-two checks, reducing unnecessary warnings for enums outside developer control.
  • Updated JsonModelExtensions.cs to use the correct schema source (anyOf) when creating new list entries and child views, improving compatibility with complex JSON schemas. [1] [2]
  • Added missing using statements in OpenAi.cs for regex and model support.

This change is Reviewable

cs-util avatar Aug 18 '25 07:08 cs-util