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

Commit

Permalink
add strict field to FunctionDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmingtarja committed Aug 8, 2024
1 parent 1adbee8 commit c8b213f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/models/openai/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,17 @@ export class FunctionDefinition {
@omitnull()
description: string | null = null;

/**
* Whether to enable strict schema adherence when generating the function call.
* If set to true, the model will follow the exact schema defined in the parameters field.
*
* See https://openai.com/index/introducing-structured-outputs-in-the-api
*
* @default false
*/
@omitif("this.strict == false")
strict: bool = false;

/**
* The parameters the functions accepts, described as a JSON Schema object.
*
Expand Down

0 comments on commit c8b213f

Please sign in to comment.