-
Notifications
You must be signed in to change notification settings - Fork 182
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
feat(go/plugins/googlegenai): add constrained generation #2467
base: main
Are you sure you want to change the base?
Conversation
@@ -172,6 +174,8 @@ func TestValidMessage(t *testing.T) { | |||
outputSchema := &ModelOutputConfig{ | |||
Format: string(OutputFormatJSON), | |||
} | |||
// FIX: validMessage compares response against a given schema, but |
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.
Since validMessage
checks if the response message matches the given schema (but no schema is provided), would it make sense to rework this and the next two test cases to not expect an error?
@@ -531,7 +582,7 @@ func validResponse(ctx context.Context, resp *ModelResponse) (*Message, error) { | |||
// validMessage will validate the message against the expected schema. | |||
// It will return an error if it does not match, otherwise it will return a message with JSON content and type. | |||
func validMessage(m *Message, output *ModelOutputConfig) (*Message, error) { | |||
if output != nil && output.Format == string(OutputFormatJSON) { | |||
if output != nil && output.Format == string(OutputFormatJSON) && output.Constrained { |
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.
I wanted to check if this condition makes sense at this place. From what I understand, we don't require to validate the response message if no output schema is provided.
Checklist (if applicable):