Skip to content

Conversation

@sgoedecke
Copy link
Collaborator

@sgoedecke sgoedecke commented Jul 17, 2025

https://github.com/github/models/issues/2522

The CLI supports prompt.yml files, but it doesn't support json or json schema outputs. This PR adds that support.

Diff is mostly tests and fixtures.

@sgoedecke sgoedecke marked this pull request as ready for review July 17, 2025 04:36
Copilot AI review requested due to automatic review settings July 17, 2025 04:36
@sgoedecke sgoedecke requested a review from a team as a code owner July 17, 2025 04:36
Copy link
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 adds support for responseFormat configuration in prompt.yml files, enabling users to specify structured output formats including JSON objects and JSON schema validation for AI model responses.

  • Adds responseFormat and jsonSchema fields to prompt file structure with validation
  • Implements three response format types: "text", "json_object", and "json_schema"
  • Updates the Azure models types to include ResponseFormat in chat completion options

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/prompt/prompt.go Adds JsonSchema struct, responseFormat validation, and BuildChatCompletionOptions method updates
pkg/prompt/prompt_test.go Comprehensive test coverage for new responseFormat functionality
internal/azuremodels/types.go Adds ResponseFormat struct and updates ChatCompletionOptions
cmd/run/run.go Integrates prompt file's BuildChatCompletionOptions method for responseFormat support
cmd/run/run_test.go Tests responseFormat integration in run command
cmd/eval/eval_test.go Tests responseFormat functionality in evaluation command
examples/*.yml Example prompt files demonstrating responseFormat usage

Copy link
Contributor

@itsbagpack itsbagpack left a comment

Choose a reason for hiding this comment

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

Cool, thanks for adding JSON schema support!

@sgoedecke sgoedecke merged commit 8050279 into main Jul 17, 2025
5 checks passed
@sgoedecke sgoedecke deleted the sgoedecke/support-response-format branch July 17, 2025 06: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.

4 participants