Skip to content

Commit 3f9a70d

Browse files
Wauplingithub-actions[bot]
authored andcommitted
Update tasks specs (automated commit)
1 parent 21158d7 commit 3f9a70d

File tree

4 files changed

+46
-27
lines changed

4 files changed

+46
-27
lines changed

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

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ export interface ChatCompletionInput {
1818
* decreasing the model's likelihood to repeat the same line verbatim.
1919
*/
2020
frequency_penalty?: number;
21+
/**
22+
* A guideline to be used in the chat_template
23+
*/
24+
guideline?: string;
2125
/**
2226
* UNUSED
2327
* Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON
@@ -79,7 +83,7 @@ export interface ChatCompletionInput {
7983
* We generally recommend altering this or `top_p` but not both.
8084
*/
8185
temperature?: number;
82-
tool_choice?: ChatCompletionInputTool;
86+
tool_choice?: ChatCompletionInputToolChoice;
8387
/**
8488
* A prompt to be appended before the tools
8589
*/
@@ -89,7 +93,7 @@ export interface ChatCompletionInput {
8993
* Use this to provide a list of
9094
* functions the model may generate JSON inputs for.
9195
*/
92-
tools?: ToolElement[];
96+
tools?: ChatCompletionInputTool[];
9397
/**
9498
* An integer between 0 and 5 specifying the number of most likely tokens to return at each
9599
* token position, each with
@@ -154,10 +158,23 @@ export interface ChatCompletionInputStreamOptions {
154158
[property: string]: unknown;
155159
}
156160

157-
export type ChatCompletionInputTool = ChatCompletionInputToolType | string;
161+
/**
162+
*
163+
* <https://platform.openai.com/docs/guides/function-calling/configuring-function-calling-behavior-using-the-tool_choice-parameter>
164+
*/
165+
export type ChatCompletionInputToolChoice = ChatCompletionInputToolChoiceEnum | ChatCompletionInputToolChoiceObject;
166+
167+
/**
168+
* Means the model can pick between generating a message or calling one or more tools.
169+
*
170+
* Means the model will not call any tool and instead generates a message.
171+
*
172+
* Means the model must call one or more tools.
173+
*/
174+
export type ChatCompletionInputToolChoiceEnum = "auto" | "none" | "required";
158175

159-
export interface ChatCompletionInputToolType {
160-
function?: ChatCompletionInputFunctionName;
176+
export interface ChatCompletionInputToolChoiceObject {
177+
function: ChatCompletionInputFunctionName;
161178
[property: string]: unknown;
162179
}
163180

@@ -166,7 +183,7 @@ export interface ChatCompletionInputFunctionName {
166183
[property: string]: unknown;
167184
}
168185

169-
export interface ToolElement {
186+
export interface ChatCompletionInputTool {
170187
function: ChatCompletionInputFunctionDefinition;
171188
type: string;
172189
[property: string]: unknown;

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"example": "1.0",
1414
"nullable": true
1515
},
16+
"guideline": {
17+
"type": "string",
18+
"description": "A guideline to be used in the chat_template",
19+
"default": "null",
20+
"example": "null",
21+
"nullable": true
22+
},
1623
"logit_bias": {
1724
"type": "array",
1825
"items": {
@@ -114,6 +121,7 @@
114121
"$ref": "#/$defs/ChatCompletionInputToolChoice"
115122
}
116123
],
124+
"default": "auto",
117125
"nullable": true
118126
},
119127
"tool_prompt": {
@@ -272,23 +280,21 @@
272280
"title": "ChatCompletionInputStreamOptions"
273281
},
274282
"ChatCompletionInputToolChoice": {
275-
"allOf": [
276-
{
277-
"$ref": "#/$defs/ChatCompletionInputToolType"
278-
}
279-
],
280-
"nullable": true,
281-
"title": "ChatCompletionInputToolChoice"
282-
},
283-
"ChatCompletionInputToolType": {
284283
"oneOf": [
285284
{
286-
"type": "object",
287-
"default": null,
288-
"nullable": true
285+
"type": "string",
286+
"description": "Means the model can pick between generating a message or calling one or more tools.",
287+
"enum": ["auto"]
289288
},
290289
{
291-
"type": "string"
290+
"type": "string",
291+
"description": "Means the model will not call any tool and instead generates a message.",
292+
"enum": ["none"]
293+
},
294+
{
295+
"type": "string",
296+
"description": "Means the model must call one or more tools.",
297+
"enum": ["required"]
292298
},
293299
{
294300
"type": "object",
@@ -298,14 +304,10 @@
298304
"$ref": "#/$defs/ChatCompletionInputFunctionName"
299305
}
300306
}
301-
},
302-
{
303-
"type": "object",
304-
"default": null,
305-
"nullable": true
306307
}
307308
],
308-
"title": "ChatCompletionInputToolType"
309+
"description": "<https://platform.openai.com/docs/guides/function-calling/configuring-function-calling-behavior-using-the-tool_choice-parameter>",
310+
"title": "ChatCompletionInputToolChoice"
309311
},
310312
"ChatCompletionInputFunctionName": {
311313
"type": "object",

packages/tasks/src/tasks/feature-extraction/inference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export interface FeatureExtractionInput {
2323
* The name of the prompt that should be used by for encoding. If not set, no prompt
2424
* will be applied.
2525
*
26-
* Must be a key in the `Sentence Transformers` configuration `prompts` dictionary.
26+
* Must be a key in the `sentence-transformers` configuration `prompts` dictionary.
2727
*
2828
* For example if ``prompt_name`` is "query" and the ``prompts`` is {"query": "query: ",
2929
* ...},

packages/tasks/src/tasks/feature-extraction/spec/input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"prompt_name": {
1919
"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 `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.",
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.",
2121
"default": "null",
2222
"example": "null",
2323
"nullable": true

0 commit comments

Comments
 (0)