feat: add configurable client tools and photo input

This commit is contained in:
Xin Wang
2026-07-30 19:06:03 +08:00
parent 510a277b5a
commit 913435785e
24 changed files with 1802 additions and 139 deletions

View File

@@ -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;