Skip to content

Commit 23d556f

Browse files
[Bot] Update tasks specs (#1417)
This PR updates the @huggingface/tasks specs. It has been generated by running: ```sh pnpm run inference-tgi-import pnpm run inference-tei-import pnpm run inference-codegen ``` This PR was automatically created by the [Tasks - Update specs workflow](https://github.com/huggingface/huggingface.js/blob/main/.github/update-specs.yml). Make sure the changes are correct before merging. Co-authored-by: Wauplin <[email protected]>
1 parent 9397ee2 commit 23d556f

File tree

4 files changed

+58
-2
lines changed

4 files changed

+58
-2
lines changed

packages/tasks/src/tasks/chat-completion/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export interface ChatCompletionInputGrammarType {
146146
value: unknown;
147147
[property: string]: unknown;
148148
}
149-
export type ChatCompletionInputGrammarTypeType = "json" | "regex";
149+
export type ChatCompletionInputGrammarTypeType = "json" | "regex" | "json_schema";
150150
export interface ChatCompletionInputStreamOptions {
151151
/**
152152
* If set, an additional chunk will be streamed before the data: [DONE] message. The usage

packages/tasks/src/tasks/chat-completion/spec/input.json

+28
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,41 @@
315315
"type": "string"
316316
}
317317
}
318+
},
319+
{
320+
"type": "object",
321+
"required": ["type", "value"],
322+
"properties": {
323+
"type": {
324+
"type": "string",
325+
"enum": ["json_schema"]
326+
},
327+
"value": {
328+
"$ref": "#/$defs/ChatCompletionInputJsonSchemaConfig"
329+
}
330+
}
318331
}
319332
],
320333
"discriminator": {
321334
"propertyName": "type"
322335
},
323336
"title": "ChatCompletionInputGrammarType"
324337
},
338+
"ChatCompletionInputJsonSchemaConfig": {
339+
"type": "object",
340+
"required": ["schema"],
341+
"properties": {
342+
"name": {
343+
"type": "string",
344+
"description": "Optional name identifier for the schema",
345+
"nullable": true
346+
},
347+
"schema": {
348+
"description": "The actual JSON schema definition"
349+
}
350+
},
351+
"title": "ChatCompletionInputJsonSchemaConfig"
352+
},
325353
"ChatCompletionInputStreamOptions": {
326354
"type": "object",
327355
"properties": {

packages/tasks/src/tasks/text-generation/inference.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export interface TextGenerationInputGrammarType {
109109
value: unknown;
110110
[property: string]: unknown;
111111
}
112-
export type Type = "json" | "regex";
112+
export type Type = "json" | "regex" | "json_schema";
113113
/**
114114
* Text Generation Output.
115115
*

packages/tasks/src/tasks/text-generation/spec/input.json

+28
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,40 @@
208208
"type": "string"
209209
}
210210
}
211+
},
212+
{
213+
"type": "object",
214+
"required": ["type", "value"],
215+
"properties": {
216+
"type": {
217+
"type": "string",
218+
"enum": ["json_schema"]
219+
},
220+
"value": {
221+
"$ref": "#/$defs/TextGenerationInputJsonSchemaConfig"
222+
}
223+
}
211224
}
212225
],
213226
"discriminator": {
214227
"propertyName": "type"
215228
},
216229
"title": "TextGenerationInputGrammarType"
230+
},
231+
"TextGenerationInputJsonSchemaConfig": {
232+
"type": "object",
233+
"required": ["schema"],
234+
"properties": {
235+
"name": {
236+
"type": "string",
237+
"description": "Optional name identifier for the schema",
238+
"nullable": true
239+
},
240+
"schema": {
241+
"description": "The actual JSON schema definition"
242+
}
243+
},
244+
"title": "TextGenerationInputJsonSchemaConfig"
217245
}
218246
}
219247
}

0 commit comments

Comments
 (0)