Skip to content

Commit

Permalink
Update tasks specs (automated commit)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wauplin authored and github-actions[bot] committed Mar 1, 2025
1 parent 822ab9e commit 04ebb1c
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 36 deletions.
23 changes: 16 additions & 7 deletions packages/tasks/src/tasks/chat-completion/inference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,10 @@ export interface ChatCompletionInput {
[property: string]: unknown;
}
export interface ChatCompletionInputMessage {
content: ChatCompletionInputMessageContent;
content?: ChatCompletionInputMessageContent;
name?: string;
role: string;
tool_calls?: ChatCompletionInputToolCall[];
[property: string]: unknown;
}
export type ChatCompletionInputMessageContent = ChatCompletionInputMessageChunk[] | string;
Expand All @@ -122,6 +123,18 @@ export interface ChatCompletionInputURL {
[property: string]: unknown;
}
export type ChatCompletionInputMessageChunkType = "text" | "image_url";
export interface ChatCompletionInputToolCall {
function: ChatCompletionInputFunctionDefinition;
id: string;
type: string;
[property: string]: unknown;
}
export interface ChatCompletionInputFunctionDefinition {
arguments: unknown;
description?: string;
name: string;
[property: string]: unknown;
}
export interface ChatCompletionInputGrammarType {
type: ChatCompletionInputGrammarTypeType;
/**
Expand Down Expand Up @@ -170,12 +183,6 @@ export interface ChatCompletionInputTool {
type: string;
[property: string]: unknown;
}
export interface ChatCompletionInputFunctionDefinition {
arguments: unknown;
description?: string;
name: string;
[property: string]: unknown;
}
/**
* Chat Completion Output.
*
Expand Down Expand Up @@ -217,6 +224,7 @@ export interface ChatCompletionOutputTopLogprob {
export interface ChatCompletionOutputMessage {
content?: string;
role: string;
tool_call_id?: string;
tool_calls?: ChatCompletionOutputToolCall[];
[property: string]: unknown;
}
Expand Down Expand Up @@ -264,6 +272,7 @@ export interface ChatCompletionStreamOutputChoice {
export interface ChatCompletionStreamOutputDelta {
content?: string;
role: string;
tool_call_id?: string;
tool_calls?: ChatCompletionStreamOutputDeltaToolCall;
[property: string]: unknown;
}
Expand Down
104 changes: 75 additions & 29 deletions packages/tasks/src/tasks/chat-completion/spec/input.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,54 @@
},
"$defs": {
"ChatCompletionInputMessage": {
"type": "object",
"required": ["role", "content"],
"properties": {
"content": {
"$ref": "#/$defs/ChatCompletionInputMessageContent"
},
"name": {
"type": "string",
"example": "\"David\"",
"nullable": true
"allOf": [
{
"$ref": "#/$defs/ChatCompletionInputMessageBody"
},
"role": {
"type": "string",
"example": "user"
{
"type": "object",
"required": ["role"],
"properties": {
"name": {
"type": "string",
"example": "\"David\"",
"nullable": true
},
"role": {
"type": "string",
"example": "user"
}
}
}
},
],
"title": "ChatCompletionInputMessage"
},
"ChatCompletionInputMessageBody": {
"oneOf": [
{
"type": "object",
"required": ["content"],
"properties": {
"content": {
"$ref": "#/$defs/ChatCompletionInputMessageContent"
}
}
},
{
"type": "object",
"required": ["tool_calls"],
"properties": {
"tool_calls": {
"type": "array",
"items": {
"$ref": "#/$defs/ChatCompletionInputToolCall"
}
}
}
}
],
"title": "ChatCompletionInputMessageBody"
},
"ChatCompletionInputMessageContent": {
"oneOf": [
{
Expand Down Expand Up @@ -227,6 +257,37 @@
},
"title": "ChatCompletionInputUrl"
},
"ChatCompletionInputToolCall": {
"type": "object",
"required": ["id", "type", "function"],
"properties": {
"function": {
"$ref": "#/$defs/ChatCompletionInputFunctionDefinition"
},
"id": {
"type": "string"
},
"type": {
"type": "string"
}
},
"title": "ChatCompletionInputToolCall"
},
"ChatCompletionInputFunctionDefinition": {
"type": "object",
"required": ["name", "arguments"],
"properties": {
"arguments": {},
"description": {
"type": "string",
"nullable": true
},
"name": {
"type": "string"
}
},
"title": "ChatCompletionInputFunctionDefinition"
},
"ChatCompletionInputGrammarType": {
"oneOf": [
{
Expand Down Expand Up @@ -326,21 +387,6 @@
}
},
"title": "ChatCompletionInputTool"
},
"ChatCompletionInputFunctionDefinition": {
"type": "object",
"required": ["name", "arguments"],
"properties": {
"arguments": {},
"description": {
"type": "string",
"nullable": true
},
"name": {
"type": "string"
}
},
"title": "ChatCompletionInputFunctionDefinition"
}
}
}
4 changes: 4 additions & 0 deletions packages/tasks/src/tasks/chat-completion/spec/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@
"role": {
"type": "string",
"example": "user"
},
"tool_call_id": {
"type": "string",
"nullable": true
}
},
"title": "ChatCompletionOutputTextMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
"role": {
"type": "string",
"example": "user"
},
"tool_call_id": {
"type": "string",
"nullable": true
}
},
"title": "ChatCompletionStreamOutputTextMessage"
Expand Down

0 comments on commit 04ebb1c

Please sign in to comment.