Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bot] Update tasks specs #1030

Draft
wants to merge 1 commit into
base: add-workflow-update-specs
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 17 additions & 3 deletions packages/tasks/src/tasks/chat-completion/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export interface ChatCompletionInput {
* decreasing the model's likelihood to repeat the same line verbatim.
*/
frequency_penalty?: number;
/**
* A guideline to be used in the chat_template
*/
guideline?: string;
/**
* UNUSED
* Modify the likelihood of specified tokens appearing in the completion. Accepts a JSON
Expand Down Expand Up @@ -154,10 +158,20 @@ export interface ChatCompletionInputStreamOptions {
[property: string]: unknown;
}

export type ChatCompletionInputTool = ChatCompletionInputToolType | string;
/**
* Controls which (if any) tool is called by the model.
*/
export type ChatCompletionInputTool = ChatCompletionInputToolChoiceEnum | ChatCompletionInputToolChoiceObject;

/**
* Means the model can pick between generating a message or calling one or more tools.
*
* Means the model will not call any tool and instead generates a message.
*/
export type ChatCompletionInputToolChoiceEnum = "auto" | "none";

export interface ChatCompletionInputToolType {
function?: ChatCompletionInputFunctionName;
export interface ChatCompletionInputToolChoiceObject {
function: ChatCompletionInputFunctionName;
[property: string]: unknown;
}

Expand Down
24 changes: 15 additions & 9 deletions packages/tasks/src/tasks/chat-completion/spec/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
"example": "1.0",
"nullable": true
},
"guideline": {
"type": "string",
"description": "A guideline to be used in the chat_template",
"default": "null",
"example": "null",
"nullable": true
},
"logit_bias": {
"type": "array",
"items": {
Expand Down Expand Up @@ -283,12 +290,14 @@
"ChatCompletionInputToolType": {
"oneOf": [
{
"type": "object",
"default": null,
"nullable": true
"type": "string",
"description": "Means the model can pick between generating a message or calling one or more tools.",
"enum": ["auto"]
},
{
"type": "string"
"type": "string",
"description": "Means the model will not call any tool and instead generates a message.",
"enum": ["none"]
},
{
"type": "object",
Expand All @@ -298,13 +307,10 @@
"$ref": "#/$defs/ChatCompletionInputFunctionName"
}
}
},
{
"type": "object",
"default": null,
"nullable": true
}
],
"description": "Controls which (if any) tool is called by the model.",
"example": "auto",
"title": "ChatCompletionInputToolType"
},
"ChatCompletionInputFunctionName": {
Expand Down
2 changes: 1 addition & 1 deletion packages/tasks/src/tasks/feature-extraction/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export interface FeatureExtractionInput {
* The name of the prompt that should be used by for encoding. If not set, no prompt
* will be applied.
*
* Must be a key in the `Sentence Transformers` configuration `prompts` dictionary.
* Must be a key in the `sentence-transformers` configuration `prompts` dictionary.
*
* For example if ``prompt_name`` is "query" and the ``prompts`` is {"query": "query: ",
* ...},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"prompt_name": {
"type": "string",
"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.",
"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.",
"default": "null",
"example": "null",
"nullable": true
Expand Down
Loading