From 2f81a3ef91926f3e2f6db8af2e017ee97f97104e Mon Sep 17 00:00:00 2001 From: Matias Molinas Date: Sat, 7 Dec 2024 05:28:05 -0300 Subject: [PATCH] style: apply Prettier formatting Signed-off-by: Matias Molinas --- .../agents/experimental/humantool_agent.ts | 5 +-- src/tools/human.ts | 31 +++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/examples/agents/experimental/humantool_agent.ts b/examples/agents/experimental/humantool_agent.ts index 257da223..ae2a7b5f 100644 --- a/examples/agents/experimental/humantool_agent.ts +++ b/examples/agents/experimental/humantool_agent.ts @@ -32,10 +32,7 @@ const llm = new OllamaChatLLM({ const agent = new BeeAgent({ llm, memory: new TokenMemory({ llm }), - tools: [ - new OpenMeteoTool(), - new HumanTool(), - ], + tools: [new OpenMeteoTool(), new HumanTool()], templates: { system: BeeSystemPrompt, assistant: BeeAssistantPrompt, diff --git a/src/tools/human.ts b/src/tools/human.ts index c520854d..a7ec17cd 100644 --- a/src/tools/human.ts +++ b/src/tools/human.ts @@ -52,22 +52,21 @@ export class HumanTool extends Tool { message: z.string().min(1, "Message cannot be empty"), }); - async _run( - input: z.infer>, - _options: BaseToolRunOptions, - ): Promise { - const reader = sharedConsoleReader(); // Shared console reader instance - - reader.write("HumanTool", input.message); - - const userInput = await reader.prompt(); // Prompt the user for input - - // Ensure proper formatting of the output - const formattedOutput = `{ + async _run( + input: z.infer>, + _options: BaseToolRunOptions, + ): Promise { + const reader = sharedConsoleReader(); // Shared console reader instance + + reader.write("HumanTool", input.message); + + const userInput = await reader.prompt(); // Prompt the user for input + + // Ensure proper formatting of the output + const formattedOutput = `{ "clarification": "${userInput.trim()}" }`; - - return new StringToolOutput(formattedOutput); // Return the user's clarification in the required format - } - + + return new StringToolOutput(formattedOutput); // Return the user's clarification in the required format + } }