Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

validate json schema for OpenAI function calling result #139

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

acatav
Copy link
Contributor

@acatav acatav commented Nov 5, 2023

Problem

Function calling only validate that the result is a valid json, but not that it's following the required schema

Solution

Validate output json schema, and retry for failures

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Infrastructure change (CI configs, etc)
  • Non-code change (docs, etc)
  • None of the above: (explain here)

Test Plan

Added a test for wrong schema. Happy path covered by existing tests

@acatav acatav changed the title validate json schema validate json schema for OpenAI function calling result Nov 5, 2023
Copy link
Contributor

@miararoy miararoy left a comment

Choose a reason for hiding this comment

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

lg, @acatav - fwiw this requires at least one test, wdyt?

@acatav
Copy link
Contributor Author

acatav commented Nov 6, 2023

lg, @acatav - fwiw this requires at least one test, wdyt?

added

Copy link
Contributor

@igiloh-pinecone igiloh-pinecone left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@miararoy miararoy left a comment

Choose a reason for hiding this comment

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

lgtm

@igiloh-pinecone igiloh-pinecone added this pull request to the merge queue Nov 6, 2023
Merged via the queue into dev with commit 9868f41 Nov 6, 2023
10 checks passed
@igiloh-pinecone igiloh-pinecone deleted the function-calling-jsonschema-validation branch November 6, 2023 10:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants