32 lines
951 B
TypeScript
32 lines
951 B
TypeScript
import type { ModelTool } from "../ports/model-port";
|
|
|
|
export const interactionTool: ModelTool = {
|
|
name: "request_user_interaction",
|
|
description: "需要用户选择、确认或补充意见时调用。调用后等待用户回答。",
|
|
parameters: {
|
|
type: "object",
|
|
required: ["kind", "question"],
|
|
properties: {
|
|
kind: {
|
|
type: "string",
|
|
enum: ["single_choice", "multiple_choice", "confirmation", "free_text"],
|
|
},
|
|
question: { type: "string" },
|
|
description: { type: "string" },
|
|
required: { type: "boolean" },
|
|
options: {
|
|
type: "array",
|
|
minItems: 2,
|
|
maxItems: 10,
|
|
items: {
|
|
type: "object",
|
|
required: ["id", "label"],
|
|
properties: { id: { type: "string" }, label: { type: "string" } },
|
|
},
|
|
},
|
|
minSelections: { type: "integer", minimum: 0 },
|
|
maxSelections: { type: "integer", minimum: 1 },
|
|
},
|
|
},
|
|
};
|