feat: add configurable client tools and photo input
This commit is contained in:
@@ -315,6 +315,7 @@ export const conversationsApi = {
|
||||
|
||||
// ---------- 工具 ----------
|
||||
export type ToolStatus = "active" | "archived" | "draft";
|
||||
export type ToolExecutionMode = "immediate" | "async";
|
||||
export type ToolParameter = {
|
||||
name: string;
|
||||
type: "string" | "number" | "integer" | "boolean" | "object" | "array";
|
||||
@@ -337,6 +338,8 @@ export type HttpToolDefinition = {
|
||||
schemaVersion: number;
|
||||
type: "http";
|
||||
config: {
|
||||
allowInterruptions: boolean;
|
||||
executionMode: ToolExecutionMode;
|
||||
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
||||
url: string;
|
||||
timeoutSeconds: number;
|
||||
@@ -347,10 +350,25 @@ export type HttpToolDefinition = {
|
||||
};
|
||||
};
|
||||
|
||||
export type ClientToolDefinition = {
|
||||
schemaVersion: number;
|
||||
type: "client";
|
||||
config: {
|
||||
allowInterruptions: boolean;
|
||||
executionMode: ToolExecutionMode;
|
||||
waitForResponse: boolean;
|
||||
parameters: ToolParameter[];
|
||||
timeoutSeconds: number;
|
||||
dynamicVariableAssignments: Record<string, string>;
|
||||
};
|
||||
};
|
||||
|
||||
export type McpToolDefinition = {
|
||||
schemaVersion: number;
|
||||
type: "mcp";
|
||||
config: {
|
||||
allowInterruptions: boolean;
|
||||
executionMode: ToolExecutionMode;
|
||||
remoteToolName: string;
|
||||
inputSchema: Record<string, unknown>;
|
||||
schemaHash: string;
|
||||
@@ -362,9 +380,13 @@ export type Tool = {
|
||||
id: string;
|
||||
name: string;
|
||||
functionName: string;
|
||||
type: "end_call" | "http" | "mcp";
|
||||
type: "end_call" | "http" | "mcp" | "client";
|
||||
description: string;
|
||||
definition: EndCallToolDefinition | HttpToolDefinition | McpToolDefinition;
|
||||
definition:
|
||||
| EndCallToolDefinition
|
||||
| HttpToolDefinition
|
||||
| ClientToolDefinition
|
||||
| McpToolDefinition;
|
||||
secrets: Record<string, unknown>;
|
||||
status: ToolStatus;
|
||||
mcpServerId?: string | null;
|
||||
|
||||
Reference in New Issue
Block a user