@huggingface/tasks 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/hardware.d.ts +12 -0
- package/dist/commonjs/hardware.d.ts.map +1 -1
- package/dist/commonjs/hardware.js +15 -3
- package/dist/commonjs/snippets/curl.js +4 -4
- package/dist/commonjs/snippets/js.js +5 -5
- package/dist/commonjs/tasks/audio-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/audio-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts +1 -5
- package/dist/commonjs/tasks/automatic-speech-recognition/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/chat-completion/inference.d.ts +18 -6
- package/dist/commonjs/tasks/chat-completion/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/depth-estimation/inference.d.ts +1 -1
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts +1 -3
- package/dist/commonjs/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/feature-extraction/inference.d.ts +1 -1
- package/dist/commonjs/tasks/fill-mask/inference.d.ts +1 -3
- package/dist/commonjs/tasks/fill-mask/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/image-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/image-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/image-segmentation/inference.d.ts +1 -3
- package/dist/commonjs/tasks/image-segmentation/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/image-to-image/inference.d.ts +1 -3
- package/dist/commonjs/tasks/image-to-image/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/image-to-text/inference.d.ts +1 -5
- package/dist/commonjs/tasks/image-to-text/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/object-detection/inference.d.ts +1 -3
- package/dist/commonjs/tasks/object-detection/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/question-answering/inference.d.ts +1 -3
- package/dist/commonjs/tasks/question-answering/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/sentence-similarity/inference.d.ts +1 -1
- package/dist/commonjs/tasks/summarization/inference.d.ts +1 -3
- package/dist/commonjs/tasks/summarization/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/table-question-answering/inference.d.ts +1 -1
- package/dist/commonjs/tasks/text-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/text-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-audio/inference.d.ts +1 -5
- package/dist/commonjs/tasks/text-to-audio/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-image/inference.d.ts +1 -3
- package/dist/commonjs/tasks/text-to-image/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/text-to-speech/inference.d.ts +1 -5
- package/dist/commonjs/tasks/text-to-speech/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/text2text-generation/inference.d.ts +1 -3
- package/dist/commonjs/tasks/text2text-generation/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/token-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/token-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/translation/inference.d.ts +1 -3
- package/dist/commonjs/tasks/translation/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/video-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/video-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/visual-question-answering/inference.d.ts +1 -3
- package/dist/commonjs/tasks/visual-question-answering/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts +1 -3
- package/dist/commonjs/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts +1 -3
- package/dist/commonjs/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/dist/esm/hardware.d.ts +12 -0
- package/dist/esm/hardware.d.ts.map +1 -1
- package/dist/esm/hardware.js +15 -3
- package/dist/esm/snippets/curl.js +4 -4
- package/dist/esm/snippets/js.js +5 -5
- package/dist/esm/tasks/audio-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/audio-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/automatic-speech-recognition/inference.d.ts +1 -5
- package/dist/esm/tasks/automatic-speech-recognition/inference.d.ts.map +1 -1
- package/dist/esm/tasks/chat-completion/inference.d.ts +18 -6
- package/dist/esm/tasks/chat-completion/inference.d.ts.map +1 -1
- package/dist/esm/tasks/depth-estimation/inference.d.ts +1 -1
- package/dist/esm/tasks/document-question-answering/inference.d.ts +1 -3
- package/dist/esm/tasks/document-question-answering/inference.d.ts.map +1 -1
- package/dist/esm/tasks/feature-extraction/inference.d.ts +1 -1
- package/dist/esm/tasks/fill-mask/inference.d.ts +1 -3
- package/dist/esm/tasks/fill-mask/inference.d.ts.map +1 -1
- package/dist/esm/tasks/image-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/image-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/image-segmentation/inference.d.ts +1 -3
- package/dist/esm/tasks/image-segmentation/inference.d.ts.map +1 -1
- package/dist/esm/tasks/image-to-image/inference.d.ts +1 -3
- package/dist/esm/tasks/image-to-image/inference.d.ts.map +1 -1
- package/dist/esm/tasks/image-to-text/inference.d.ts +1 -5
- package/dist/esm/tasks/image-to-text/inference.d.ts.map +1 -1
- package/dist/esm/tasks/object-detection/inference.d.ts +1 -3
- package/dist/esm/tasks/object-detection/inference.d.ts.map +1 -1
- package/dist/esm/tasks/question-answering/inference.d.ts +1 -3
- package/dist/esm/tasks/question-answering/inference.d.ts.map +1 -1
- package/dist/esm/tasks/sentence-similarity/inference.d.ts +1 -1
- package/dist/esm/tasks/summarization/inference.d.ts +1 -3
- package/dist/esm/tasks/summarization/inference.d.ts.map +1 -1
- package/dist/esm/tasks/table-question-answering/inference.d.ts +1 -1
- package/dist/esm/tasks/text-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/text-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-audio/inference.d.ts +1 -5
- package/dist/esm/tasks/text-to-audio/inference.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-image/inference.d.ts +1 -3
- package/dist/esm/tasks/text-to-image/inference.d.ts.map +1 -1
- package/dist/esm/tasks/text-to-speech/inference.d.ts +1 -5
- package/dist/esm/tasks/text-to-speech/inference.d.ts.map +1 -1
- package/dist/esm/tasks/text2text-generation/inference.d.ts +1 -3
- package/dist/esm/tasks/text2text-generation/inference.d.ts.map +1 -1
- package/dist/esm/tasks/token-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/token-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/translation/inference.d.ts +1 -3
- package/dist/esm/tasks/translation/inference.d.ts.map +1 -1
- package/dist/esm/tasks/video-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/video-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/visual-question-answering/inference.d.ts +1 -3
- package/dist/esm/tasks/visual-question-answering/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/zero-shot-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts +1 -3
- package/dist/esm/tasks/zero-shot-image-classification/inference.d.ts.map +1 -1
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts +1 -3
- package/dist/esm/tasks/zero-shot-object-detection/inference.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/hardware.ts +15 -3
- package/src/snippets/curl.ts +4 -4
- package/src/snippets/js.ts +5 -5
- package/src/tasks/audio-classification/inference.ts +1 -3
- package/src/tasks/audio-classification/spec/input.json +1 -2
- package/src/tasks/automatic-speech-recognition/inference.ts +1 -5
- package/src/tasks/automatic-speech-recognition/spec/input.json +1 -2
- package/src/tasks/chat-completion/inference.ts +19 -6
- package/src/tasks/chat-completion/spec/input.json +14 -19
- package/src/tasks/common-definitions.json +0 -1
- package/src/tasks/depth-estimation/inference.ts +1 -1
- package/src/tasks/depth-estimation/spec/input.json +1 -2
- package/src/tasks/document-question-answering/inference.ts +1 -3
- package/src/tasks/document-question-answering/spec/input.json +1 -2
- package/src/tasks/feature-extraction/inference.ts +1 -1
- package/src/tasks/feature-extraction/spec/input.json +1 -1
- package/src/tasks/fill-mask/inference.ts +1 -3
- package/src/tasks/fill-mask/spec/input.json +1 -2
- package/src/tasks/image-classification/inference.ts +1 -3
- package/src/tasks/image-classification/spec/input.json +1 -2
- package/src/tasks/image-segmentation/inference.ts +1 -3
- package/src/tasks/image-segmentation/spec/input.json +1 -2
- package/src/tasks/image-to-image/inference.ts +1 -3
- package/src/tasks/image-to-image/spec/input.json +1 -2
- package/src/tasks/image-to-text/inference.ts +1 -5
- package/src/tasks/image-to-text/spec/input.json +1 -2
- package/src/tasks/object-detection/inference.ts +1 -3
- package/src/tasks/object-detection/spec/input.json +1 -2
- package/src/tasks/placeholder/spec/input.json +1 -2
- package/src/tasks/question-answering/inference.ts +1 -3
- package/src/tasks/question-answering/spec/input.json +1 -2
- package/src/tasks/sentence-similarity/inference.ts +1 -1
- package/src/tasks/sentence-similarity/spec/input.json +1 -2
- package/src/tasks/summarization/inference.ts +1 -3
- package/src/tasks/summarization/spec/input.json +1 -2
- package/src/tasks/table-question-answering/inference.ts +1 -1
- package/src/tasks/table-question-answering/spec/input.json +1 -2
- package/src/tasks/text-classification/inference.ts +1 -3
- package/src/tasks/text-classification/spec/input.json +1 -2
- package/src/tasks/text-to-audio/inference.ts +1 -5
- package/src/tasks/text-to-audio/spec/input.json +1 -2
- package/src/tasks/text-to-image/inference.ts +1 -3
- package/src/tasks/text-to-image/spec/input.json +1 -2
- package/src/tasks/text-to-speech/inference.ts +1 -5
- package/src/tasks/text-to-speech/spec/input.json +1 -2
- package/src/tasks/text2text-generation/inference.ts +1 -3
- package/src/tasks/text2text-generation/spec/input.json +1 -2
- package/src/tasks/token-classification/inference.ts +1 -3
- package/src/tasks/token-classification/spec/input.json +1 -2
- package/src/tasks/translation/inference.ts +1 -3
- package/src/tasks/translation/spec/input.json +1 -2
- package/src/tasks/video-classification/inference.ts +1 -3
- package/src/tasks/video-classification/spec/input.json +1 -2
- package/src/tasks/visual-question-answering/inference.ts +1 -3
- package/src/tasks/visual-question-answering/spec/input.json +1 -2
- package/src/tasks/zero-shot-classification/inference.ts +1 -3
- package/src/tasks/zero-shot-classification/spec/input.json +1 -2
- package/src/tasks/zero-shot-image-classification/inference.ts +1 -3
- package/src/tasks/zero-shot-image-classification/spec/input.json +1 -2
- package/src/tasks/zero-shot-object-detection/inference.ts +1 -3
- package/src/tasks/zero-shot-object-detection/spec/input.json +1 -2
- package/dist/commonjs/snippets/curl.spec.d.ts +0 -2
- package/dist/commonjs/snippets/curl.spec.d.ts.map +0 -1
- package/dist/commonjs/snippets/curl.spec.js +0 -89
- package/dist/commonjs/snippets/js.spec.d.ts +0 -2
- package/dist/commonjs/snippets/js.spec.d.ts.map +0 -1
- package/dist/commonjs/snippets/js.spec.js +0 -141
- package/dist/commonjs/snippets/python.spec.d.ts +0 -2
- package/dist/commonjs/snippets/python.spec.d.ts.map +0 -1
- package/dist/commonjs/snippets/python.spec.js +0 -135
- package/dist/esm/snippets/curl.spec.d.ts +0 -2
- package/dist/esm/snippets/curl.spec.d.ts.map +0 -1
- package/dist/esm/snippets/curl.spec.js +0 -87
- package/dist/esm/snippets/js.spec.d.ts +0 -2
- package/dist/esm/snippets/js.spec.d.ts.map +0 -1
- package/dist/esm/snippets/js.spec.js +0 -139
- package/dist/esm/snippets/python.spec.d.ts +0 -2
- package/dist/esm/snippets/python.spec.d.ts.map +0 -1
- package/dist/esm/snippets/python.spec.js +0 -133
- package/src/snippets/curl.spec.ts +0 -94
- package/src/snippets/js.spec.ts +0 -148
- package/src/snippets/python.spec.ts +0 -144
package/src/snippets/js.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const snippetBasic = (model: ModelDataMinimal, accessToken: string): Infe
|
|
|
10
10
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
11
11
|
{
|
|
12
12
|
headers: {
|
|
13
|
-
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
13
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}",
|
|
14
14
|
"Content-Type": "application/json",
|
|
15
15
|
},
|
|
16
16
|
method: "POST",
|
|
@@ -151,7 +151,7 @@ export const snippetZeroShotClassification = (model: ModelDataMinimal, accessTok
|
|
|
151
151
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
152
152
|
{
|
|
153
153
|
headers: {
|
|
154
|
-
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
154
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}",
|
|
155
155
|
"Content-Type": "application/json",
|
|
156
156
|
},
|
|
157
157
|
method: "POST",
|
|
@@ -175,7 +175,7 @@ export const snippetTextToImage = (model: ModelDataMinimal, accessToken: string)
|
|
|
175
175
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
176
176
|
{
|
|
177
177
|
headers: {
|
|
178
|
-
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
178
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}",
|
|
179
179
|
"Content-Type": "application/json",
|
|
180
180
|
},
|
|
181
181
|
method: "POST",
|
|
@@ -196,7 +196,7 @@ export const snippetTextToAudio = (model: ModelDataMinimal, accessToken: string)
|
|
|
196
196
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
197
197
|
{
|
|
198
198
|
headers: {
|
|
199
|
-
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
199
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}",
|
|
200
200
|
"Content-Type": "application/json",
|
|
201
201
|
},
|
|
202
202
|
method: "POST",
|
|
@@ -238,7 +238,7 @@ export const snippetFile = (model: ModelDataMinimal, accessToken: string): Infer
|
|
|
238
238
|
"https://api-inference.huggingface.co/models/${model.id}",
|
|
239
239
|
{
|
|
240
240
|
headers: {
|
|
241
|
-
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}"
|
|
241
|
+
Authorization: "Bearer ${accessToken || `{API_TOKEN}`}",
|
|
242
242
|
"Content-Type": "application/json",
|
|
243
243
|
},
|
|
244
244
|
method: "POST",
|
|
@@ -13,14 +13,12 @@ export interface AudioClassificationInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: string;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters
|
|
16
|
+
* Additional inference parameters for Audio Classification
|
|
17
17
|
*/
|
|
18
18
|
parameters?: AudioClassificationParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Additional inference parameters
|
|
23
|
-
*
|
|
24
22
|
* Additional inference parameters for Audio Classification
|
|
25
23
|
*/
|
|
26
24
|
export interface AudioClassificationParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Audio Classification",
|
|
14
14
|
"$ref": "#/$defs/AudioClassificationParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"AudioClassificationParameters": {
|
|
19
19
|
"title": "AudioClassificationParameters",
|
|
20
|
-
"description": "Additional inference parameters for Audio Classification",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"function_to_apply": {
|
|
@@ -14,15 +14,13 @@ export interface AutomaticSpeechRecognitionInput {
|
|
|
14
14
|
*/
|
|
15
15
|
inputs: string;
|
|
16
16
|
/**
|
|
17
|
-
* Additional inference parameters
|
|
17
|
+
* Additional inference parameters for Automatic Speech Recognition
|
|
18
18
|
*/
|
|
19
19
|
parameters?: AutomaticSpeechRecognitionParameters;
|
|
20
20
|
[property: string]: unknown;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Additional inference parameters
|
|
25
|
-
*
|
|
26
24
|
* Additional inference parameters for Automatic Speech Recognition
|
|
27
25
|
*/
|
|
28
26
|
export interface AutomaticSpeechRecognitionParameters {
|
|
@@ -39,8 +37,6 @@ export interface AutomaticSpeechRecognitionParameters {
|
|
|
39
37
|
|
|
40
38
|
/**
|
|
41
39
|
* Parametrization of the text generation process
|
|
42
|
-
*
|
|
43
|
-
* Ad-hoc parametrization of the text generation process
|
|
44
40
|
*/
|
|
45
41
|
export interface GenerationParameters {
|
|
46
42
|
/**
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Automatic Speech Recognition",
|
|
14
14
|
"$ref": "#/$defs/AutomaticSpeechRecognitionParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"AutomaticSpeechRecognitionParameters": {
|
|
19
19
|
"title": "AutomaticSpeechRecognitionParameters",
|
|
20
|
-
"description": "Additional inference parameters for Automatic Speech Recognition",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"return_timestamps": {
|
|
@@ -79,7 +79,7 @@ export interface ChatCompletionInput {
|
|
|
79
79
|
* We generally recommend altering this or `top_p` but not both.
|
|
80
80
|
*/
|
|
81
81
|
temperature?: number;
|
|
82
|
-
tool_choice?:
|
|
82
|
+
tool_choice?: ChatCompletionInputToolChoice;
|
|
83
83
|
/**
|
|
84
84
|
* A prompt to be appended before the tools
|
|
85
85
|
*/
|
|
@@ -89,7 +89,7 @@ export interface ChatCompletionInput {
|
|
|
89
89
|
* Use this to provide a list of
|
|
90
90
|
* functions the model may generate JSON inputs for.
|
|
91
91
|
*/
|
|
92
|
-
tools?:
|
|
92
|
+
tools?: ChatCompletionInputTool[];
|
|
93
93
|
/**
|
|
94
94
|
* An integer between 0 and 5 specifying the number of most likely tokens to return at each
|
|
95
95
|
* token position, each with
|
|
@@ -154,10 +154,23 @@ export interface ChatCompletionInputStreamOptions {
|
|
|
154
154
|
[property: string]: unknown;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* <https://platform.openai.com/docs/guides/function-calling/configuring-function-calling-behavior-using-the-tool_choice-parameter>
|
|
160
|
+
*/
|
|
161
|
+
export type ChatCompletionInputToolChoice = ChatCompletionInputToolChoiceEnum | ChatCompletionInputToolChoiceObject;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Means the model can pick between generating a message or calling one or more tools.
|
|
165
|
+
*
|
|
166
|
+
* Means the model will not call any tool and instead generates a message.
|
|
167
|
+
*
|
|
168
|
+
* Means the model must call one or more tools.
|
|
169
|
+
*/
|
|
170
|
+
export type ChatCompletionInputToolChoiceEnum = "auto" | "none" | "required";
|
|
158
171
|
|
|
159
|
-
export interface
|
|
160
|
-
function
|
|
172
|
+
export interface ChatCompletionInputToolChoiceObject {
|
|
173
|
+
function: ChatCompletionInputFunctionName;
|
|
161
174
|
[property: string]: unknown;
|
|
162
175
|
}
|
|
163
176
|
|
|
@@ -166,7 +179,7 @@ export interface ChatCompletionInputFunctionName {
|
|
|
166
179
|
[property: string]: unknown;
|
|
167
180
|
}
|
|
168
181
|
|
|
169
|
-
export interface
|
|
182
|
+
export interface ChatCompletionInputTool {
|
|
170
183
|
function: ChatCompletionInputFunctionDefinition;
|
|
171
184
|
type: string;
|
|
172
185
|
[property: string]: unknown;
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"$ref": "#/$defs/ChatCompletionInputToolChoice"
|
|
115
115
|
}
|
|
116
116
|
],
|
|
117
|
+
"default": "auto",
|
|
117
118
|
"nullable": true
|
|
118
119
|
},
|
|
119
120
|
"tool_prompt": {
|
|
@@ -272,23 +273,21 @@
|
|
|
272
273
|
"title": "ChatCompletionInputStreamOptions"
|
|
273
274
|
},
|
|
274
275
|
"ChatCompletionInputToolChoice": {
|
|
275
|
-
"allOf": [
|
|
276
|
-
{
|
|
277
|
-
"$ref": "#/$defs/ChatCompletionInputToolType"
|
|
278
|
-
}
|
|
279
|
-
],
|
|
280
|
-
"nullable": true,
|
|
281
|
-
"title": "ChatCompletionInputToolChoice"
|
|
282
|
-
},
|
|
283
|
-
"ChatCompletionInputToolType": {
|
|
284
276
|
"oneOf": [
|
|
285
277
|
{
|
|
286
|
-
"type": "
|
|
287
|
-
"
|
|
288
|
-
"
|
|
278
|
+
"type": "string",
|
|
279
|
+
"description": "Means the model can pick between generating a message or calling one or more tools.",
|
|
280
|
+
"enum": ["auto"]
|
|
289
281
|
},
|
|
290
282
|
{
|
|
291
|
-
"type": "string"
|
|
283
|
+
"type": "string",
|
|
284
|
+
"description": "Means the model will not call any tool and instead generates a message.",
|
|
285
|
+
"enum": ["none"]
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"type": "string",
|
|
289
|
+
"description": "Means the model must call one or more tools.",
|
|
290
|
+
"enum": ["required"]
|
|
292
291
|
},
|
|
293
292
|
{
|
|
294
293
|
"type": "object",
|
|
@@ -298,14 +297,10 @@
|
|
|
298
297
|
"$ref": "#/$defs/ChatCompletionInputFunctionName"
|
|
299
298
|
}
|
|
300
299
|
}
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
"type": "object",
|
|
304
|
-
"default": null,
|
|
305
|
-
"nullable": true
|
|
306
300
|
}
|
|
307
301
|
],
|
|
308
|
-
"
|
|
302
|
+
"description": "<https://platform.openai.com/docs/guides/function-calling/configuring-function-calling-behavior-using-the-tool_choice-parameter>",
|
|
303
|
+
"title": "ChatCompletionInputToolChoice"
|
|
309
304
|
},
|
|
310
305
|
"ChatCompletionInputFunctionName": {
|
|
311
306
|
"type": "object",
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
"description": "The input image data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
12
|
-
"description": "Additional inference parameters",
|
|
12
|
+
"description": "Additional inference parameters for Depth Estimation",
|
|
13
13
|
"$ref": "#/$defs/DepthEstimationParameters"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"$defs": {
|
|
17
17
|
"DepthEstimationParameters": {
|
|
18
18
|
"title": "DepthEstimationParameters",
|
|
19
|
-
"description": "Additional inference parameters for Depth Estimation",
|
|
20
19
|
"type": "object",
|
|
21
20
|
"properties": {}
|
|
22
21
|
}
|
|
@@ -12,7 +12,7 @@ export interface DocumentQuestionAnsweringInput {
|
|
|
12
12
|
*/
|
|
13
13
|
inputs: DocumentQuestionAnsweringInputData;
|
|
14
14
|
/**
|
|
15
|
-
* Additional inference parameters
|
|
15
|
+
* Additional inference parameters for Document Question Answering
|
|
16
16
|
*/
|
|
17
17
|
parameters?: DocumentQuestionAnsweringParameters;
|
|
18
18
|
[property: string]: unknown;
|
|
@@ -32,8 +32,6 @@ export interface DocumentQuestionAnsweringInputData {
|
|
|
32
32
|
[property: string]: unknown;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Additional inference parameters
|
|
36
|
-
*
|
|
37
35
|
* Additional inference parameters for Document Question Answering
|
|
38
36
|
*/
|
|
39
37
|
export interface DocumentQuestionAnsweringParameters {
|
|
@@ -21,14 +21,13 @@
|
|
|
21
21
|
"required": ["image", "question"]
|
|
22
22
|
},
|
|
23
23
|
"parameters": {
|
|
24
|
-
"description": "Additional inference parameters",
|
|
24
|
+
"description": "Additional inference parameters for Document Question Answering",
|
|
25
25
|
"$ref": "#/$defs/DocumentQuestionAnsweringParameters"
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"$defs": {
|
|
29
29
|
"DocumentQuestionAnsweringParameters": {
|
|
30
30
|
"title": "DocumentQuestionAnsweringParameters",
|
|
31
|
-
"description": "Additional inference parameters for Document Question Answering",
|
|
32
31
|
"type": "object",
|
|
33
32
|
"properties": {
|
|
34
33
|
"doc_stride": {
|
|
@@ -23,7 +23,7 @@ export interface FeatureExtractionInput {
|
|
|
23
23
|
* The name of the prompt that should be used by for encoding. If not set, no prompt
|
|
24
24
|
* will be applied.
|
|
25
25
|
*
|
|
26
|
-
* Must be a key in the `
|
|
26
|
+
* Must be a key in the `sentence-transformers` configuration `prompts` dictionary.
|
|
27
27
|
*
|
|
28
28
|
* For example if ``prompt_name`` is "query" and the ``prompts`` is {"query": "query: ",
|
|
29
29
|
* ...},
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"prompt_name": {
|
|
19
19
|
"type": "string",
|
|
20
|
-
"description": "The name of the prompt that should be used by for encoding. If not set, no prompt\nwill be applied.\n\nMust be a key in the `
|
|
20
|
+
"description": "The name of the prompt that should be used by for encoding. If not set, no prompt\nwill be applied.\n\nMust be a key in the `sentence-transformers` configuration `prompts` dictionary.\n\nFor example if ``prompt_name`` is \"query\" and the ``prompts`` is {\"query\": \"query: \", ...},\nthen the sentence \"What is the capital of France?\" will be encoded as\n\"query: What is the capital of France?\" because the prompt text will be prepended before\nany text to encode.",
|
|
21
21
|
"default": "null",
|
|
22
22
|
"example": "null",
|
|
23
23
|
"nullable": true
|
|
@@ -12,14 +12,12 @@ export interface FillMaskInput {
|
|
|
12
12
|
*/
|
|
13
13
|
inputs: string;
|
|
14
14
|
/**
|
|
15
|
-
* Additional inference parameters
|
|
15
|
+
* Additional inference parameters for Fill Mask
|
|
16
16
|
*/
|
|
17
17
|
parameters?: FillMaskParameters;
|
|
18
18
|
[property: string]: unknown;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
* Additional inference parameters
|
|
22
|
-
*
|
|
23
21
|
* Additional inference parameters for Fill Mask
|
|
24
22
|
*/
|
|
25
23
|
export interface FillMaskParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Fill Mask",
|
|
14
14
|
"$ref": "#/$defs/FillMaskParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"FillMaskParameters": {
|
|
19
19
|
"title": "FillMaskParameters",
|
|
20
|
-
"description": "Additional inference parameters for Fill Mask",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"top_k": {
|
|
@@ -13,14 +13,12 @@ export interface ImageClassificationInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: string;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters
|
|
16
|
+
* Additional inference parameters for Image Classification
|
|
17
17
|
*/
|
|
18
18
|
parameters?: ImageClassificationParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Additional inference parameters
|
|
23
|
-
*
|
|
24
22
|
* Additional inference parameters for Image Classification
|
|
25
23
|
*/
|
|
26
24
|
export interface ImageClassificationParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"description": "The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload."
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Image Classification",
|
|
14
14
|
"$ref": "#/$defs/ImageClassificationParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"ImageClassificationParameters": {
|
|
19
19
|
"title": "ImageClassificationParameters",
|
|
20
|
-
"description": "Additional inference parameters for Image Classification",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"function_to_apply": {
|
|
@@ -13,14 +13,12 @@ export interface ImageSegmentationInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: string;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters
|
|
16
|
+
* Additional inference parameters for Image Segmentation
|
|
17
17
|
*/
|
|
18
18
|
parameters?: ImageSegmentationParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Additional inference parameters
|
|
23
|
-
*
|
|
24
22
|
* Additional inference parameters for Image Segmentation
|
|
25
23
|
*/
|
|
26
24
|
export interface ImageSegmentationParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"description": "The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload."
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Image Segmentation",
|
|
14
14
|
"$ref": "#/$defs/ImageSegmentationParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"ImageSegmentationParameters": {
|
|
19
19
|
"title": "ImageSegmentationParameters",
|
|
20
|
-
"description": "Additional inference parameters for Image Segmentation",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"mask_threshold": {
|
|
@@ -14,15 +14,13 @@ export interface ImageToImageInput {
|
|
|
14
14
|
*/
|
|
15
15
|
inputs: string;
|
|
16
16
|
/**
|
|
17
|
-
* Additional inference parameters
|
|
17
|
+
* Additional inference parameters for Image To Image
|
|
18
18
|
*/
|
|
19
19
|
parameters?: ImageToImageParameters;
|
|
20
20
|
[property: string]: unknown;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Additional inference parameters
|
|
25
|
-
*
|
|
26
24
|
* Additional inference parameters for Image To Image
|
|
27
25
|
*/
|
|
28
26
|
export interface ImageToImageParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"description": "The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload."
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Image To Image",
|
|
14
14
|
"$ref": "#/$defs/ImageToImageParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"ImageToImageParameters": {
|
|
19
19
|
"title": "ImageToImageParameters",
|
|
20
|
-
"description": "Additional inference parameters for Image To Image",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"guidance_scale": {
|
|
@@ -13,15 +13,13 @@ export interface ImageToTextInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: unknown;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters
|
|
16
|
+
* Additional inference parameters for Image To Text
|
|
17
17
|
*/
|
|
18
18
|
parameters?: ImageToTextParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Additional inference parameters
|
|
24
|
-
*
|
|
25
23
|
* Additional inference parameters for Image To Text
|
|
26
24
|
*/
|
|
27
25
|
export interface ImageToTextParameters {
|
|
@@ -38,8 +36,6 @@ export interface ImageToTextParameters {
|
|
|
38
36
|
|
|
39
37
|
/**
|
|
40
38
|
* Parametrization of the text generation process
|
|
41
|
-
*
|
|
42
|
-
* Ad-hoc parametrization of the text generation process
|
|
43
39
|
*/
|
|
44
40
|
export interface GenerationParameters {
|
|
45
41
|
/**
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
"description": "The input image data"
|
|
10
10
|
},
|
|
11
11
|
"parameters": {
|
|
12
|
-
"description": "Additional inference parameters",
|
|
12
|
+
"description": "Additional inference parameters for Image To Text",
|
|
13
13
|
"$ref": "#/$defs/ImageToTextParameters"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"$defs": {
|
|
17
17
|
"ImageToTextParameters": {
|
|
18
18
|
"title": "ImageToTextParameters",
|
|
19
|
-
"description": "Additional inference parameters for Image To Text",
|
|
20
19
|
"type": "object",
|
|
21
20
|
"properties": {
|
|
22
21
|
"max_new_tokens": {
|
|
@@ -13,14 +13,12 @@ export interface ObjectDetectionInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: string;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters
|
|
16
|
+
* Additional inference parameters for Object Detection
|
|
17
17
|
*/
|
|
18
18
|
parameters?: ObjectDetectionParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* Additional inference parameters
|
|
23
|
-
*
|
|
24
22
|
* Additional inference parameters for Object Detection
|
|
25
23
|
*/
|
|
26
24
|
export interface ObjectDetectionParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"description": "The input image data as a base64-encoded string. If no `parameters` are provided, you can also provide the image data as a raw bytes payload."
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters",
|
|
13
|
+
"description": "Additional inference parameters for Object Detection",
|
|
14
14
|
"$ref": "#/$defs/ObjectDetectionParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"ObjectDetectionParameters": {
|
|
19
19
|
"title": "ObjectDetectionParameters",
|
|
20
|
-
"description": "Additional inference parameters for Object Detection",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"threshold": {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "
|
|
13
|
+
"description": "TODO: describe additional parameters here.",
|
|
14
14
|
"$ref": "#/$defs/<TASK_ID>Parameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"<TASK_ID>Parameters": {
|
|
19
19
|
"title": "<TASK_ID>Parameters",
|
|
20
|
-
"description": "TODO: describe additional parameters here.",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"dummy_parameter_name": {
|
|
@@ -12,7 +12,7 @@ export interface QuestionAnsweringInput {
|
|
|
12
12
|
*/
|
|
13
13
|
inputs: QuestionAnsweringInputData;
|
|
14
14
|
/**
|
|
15
|
-
* Additional inference parameters
|
|
15
|
+
* Additional inference parameters for Question Answering
|
|
16
16
|
*/
|
|
17
17
|
parameters?: QuestionAnsweringParameters;
|
|
18
18
|
[property: string]: unknown;
|
|
@@ -32,8 +32,6 @@ export interface QuestionAnsweringInputData {
|
|
|
32
32
|
[property: string]: unknown;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
* Additional inference parameters
|
|
36
|
-
*
|
|
37
35
|
* Additional inference parameters for Question Answering
|
|
38
36
|
*/
|
|
39
37
|
export interface QuestionAnsweringParameters {
|
|
@@ -22,14 +22,13 @@
|
|
|
22
22
|
"required": ["question", "context"]
|
|
23
23
|
},
|
|
24
24
|
"parameters": {
|
|
25
|
-
"description": "Additional inference parameters",
|
|
25
|
+
"description": "Additional inference parameters for Question Answering",
|
|
26
26
|
"$ref": "#/$defs/QuestionAnsweringParameters"
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
"$defs": {
|
|
30
30
|
"QuestionAnsweringParameters": {
|
|
31
31
|
"title": "QuestionAnsweringParameters",
|
|
32
|
-
"description": "Additional inference parameters for Question Answering",
|
|
33
32
|
"type": "object",
|
|
34
33
|
"properties": {
|
|
35
34
|
"top_k": {
|
|
@@ -12,7 +12,7 @@ export type SentenceSimilarityOutput = number[];
|
|
|
12
12
|
export interface SentenceSimilarityInput {
|
|
13
13
|
inputs: SentenceSimilarityInputData;
|
|
14
14
|
/**
|
|
15
|
-
* Additional inference parameters
|
|
15
|
+
* Additional inference parameters for Sentence Similarity
|
|
16
16
|
*/
|
|
17
17
|
parameters?: { [key: string]: unknown };
|
|
18
18
|
[property: string]: unknown;
|
|
@@ -24,14 +24,13 @@
|
|
|
24
24
|
"required": ["sourceSentence", "sentences"]
|
|
25
25
|
},
|
|
26
26
|
"parameters": {
|
|
27
|
-
"description": "Additional inference parameters",
|
|
27
|
+
"description": "Additional inference parameters for Sentence Similarity",
|
|
28
28
|
"$ref": "#/$defs/SentenceSimilarityParameters"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"$defs": {
|
|
32
32
|
"SentenceSimilarityParameters": {
|
|
33
33
|
"title": "SentenceSimilarityParameters",
|
|
34
|
-
"description": "Additional inference parameters for Sentence Similarity",
|
|
35
34
|
"type": "object",
|
|
36
35
|
"properties": {}
|
|
37
36
|
}
|
|
@@ -13,15 +13,13 @@ export interface SummarizationInput {
|
|
|
13
13
|
*/
|
|
14
14
|
inputs: string;
|
|
15
15
|
/**
|
|
16
|
-
* Additional inference parameters.
|
|
16
|
+
* Additional inference parameters for summarization.
|
|
17
17
|
*/
|
|
18
18
|
parameters?: SummarizationParameters;
|
|
19
19
|
[property: string]: unknown;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Additional inference parameters.
|
|
24
|
-
*
|
|
25
23
|
* Additional inference parameters for summarization.
|
|
26
24
|
*/
|
|
27
25
|
export interface SummarizationParameters {
|
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
"type": "string"
|
|
11
11
|
},
|
|
12
12
|
"parameters": {
|
|
13
|
-
"description": "Additional inference parameters.",
|
|
13
|
+
"description": "Additional inference parameters for summarization.",
|
|
14
14
|
"$ref": "#/$defs/SummarizationParameters"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"$defs": {
|
|
18
18
|
"SummarizationParameters": {
|
|
19
19
|
"title": "SummarizationParameters",
|
|
20
|
-
"description": "Additional inference parameters for summarization.",
|
|
21
20
|
"type": "object",
|
|
22
21
|
"properties": {
|
|
23
22
|
"clean_up_tokenization_spaces": {
|