Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix docstring
  • Loading branch information
dargilco committed Jan 8, 2025
commit 1afef5d4ded6bb9702eb51570c42f7ce31d0ad39
28 changes: 18 additions & 10 deletions specification/ai/ModelClient/models/chat_completions.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -266,25 +266,33 @@ model ChatCompletionsResponseFormatJsonObject
}

@doc("""
The definition of a JSON schema, used to define the output format of a chat completion message. The AI model
Defines the response format for chat completions as JSON with a given schema. The AI model
will need to adhere to this schema when generating completions.
""")
model ChatCompletionsResponseFormatJsonSchemaDefinition {
/** A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. */
@doc("""
A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
""")
name: string;

/** The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema.
Note that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model documentation
to determine what is supported. */
@doc("""
The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema.
Note that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model documentation
to determine what is supported.
""")
schema: Record<unknown>;

/** A description of the response format, used by the AI model to determine how to generate responses in this format. */
@doc("""
A description of the response format, used by the AI model to determine how to generate responses in this format.
""")
description?: string;

/** If set to true, the service will error out if the provided JSON schema contains keywords
not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.
If false, and the provided JSON schema contains keywords not supported
by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.*/
@doc("""
If set to true, the service will error out if the provided JSON schema contains keywords
not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.
If false, and the provided JSON schema contains keywords not supported
by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.
""")
strict?: boolean = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,15 @@
},
"ChatCompletionsResponseFormatJsonSchemaDefinition": {
"type": "object",
"description": "The definition of a JSON schema, used to define the output format of a chat completion message. The AI model\nwill need to adhere to this schema when generating completions.",
"description": "Defines the response format for chat completions as JSON with a given schema. The AI model\nwill need to adhere to this schema when generating completions.",
"properties": {
"name": {
"type": "string",
"description": "A name that labels this JSON schema. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64."
},
"schema": {
"type": "object",
"description": "The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema.\n Note that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model documentation\n to determine what is supported.",
"description": "The definition of the JSON schema. See https://json-schema.org/overview/what-is-jsonschema.\nNote that AI models usually only support a subset of the keywords defined by JSON schema. Consult your AI model documentation\nto determine what is supported.",
"additionalProperties": {}
},
"description": {
Expand All @@ -705,7 +705,7 @@
},
"strict": {
"type": "boolean",
"description": "If set to true, the service will error out if the provided JSON schema contains keywords\n not supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.\n If false, and the provided JSON schema contains keywords not supported\n by the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.",
"description": "If set to true, the service will error out if the provided JSON schema contains keywords\nnot supported by the AI model. An example of such keyword may be `maxLength` for JSON type `string`.\nIf false, and the provided JSON schema contains keywords not supported\nby the AI model, the AI model will not error out. Instead it will ignore the unsupported keywords.",
"default": false
}
},
Expand Down
Loading