add: human-in-the-loop tool-calling

This commit is contained in:
Avraham Sakal
2025-05-04 14:04:50 -04:00
parent e292cebb1d
commit 8b8c92f1d6
5 changed files with 116 additions and 41 deletions
@@ -5,6 +5,7 @@ import { singleSpace } from "../util.js";
export const personalAssistantAgent: Agent = {
id: "personal-assistant",
name: "Personal Assistant",
// modelName: "qwen/qwen3-32b:free",
// modelName: "mistral/ministral-8b",
modelName: "google/gemini-2.5-flash-preview",
systemMessage:
@@ -78,21 +79,21 @@ export const personalAssistantAgent: Agent = {
// },
}),
say: tool({
description: "Say something.",
parameters: jsonSchema<{ message: string }>({
type: "object",
properties: {
message: {
type: "string",
description: "The message to say.",
},
},
}),
execute: async ({ message }: { message: string }) => {
console.log(message);
},
}),
// say: tool({
// description: "Say something.",
// parameters: jsonSchema<{ message: string }>({
// type: "object",
// properties: {
// message: {
// type: "string",
// description: "The message to say.",
// },
// },
// }),
// execute: async ({ message }: { message: string }) => {
// return message;
// },
// }),
exit: tool({
description: "Exits the conversation.",
parameters: jsonSchema<{ exitCode: number }>({