Skip to content

Commit

Permalink
style: apply Prettier formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Matias Molinas <matias.molinas@gmail.com>
  • Loading branch information
matiasmolinas committed Dec 7, 2024
1 parent df5438a commit 2f81a3e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 20 deletions.
5 changes: 1 addition & 4 deletions examples/agents/experimental/humantool_agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
31 changes: 15 additions & 16 deletions src/tools/human.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,21 @@ export class HumanTool extends Tool<StringToolOutput> {
message: z.string().min(1, "Message cannot be empty"),
});

async _run(
input: z.infer<ReturnType<typeof this.inputSchema>>,
_options: BaseToolRunOptions,
): Promise<StringToolOutput> {
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<ReturnType<typeof this.inputSchema>>,
_options: BaseToolRunOptions,
): Promise<StringToolOutput> {
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
}
}

0 comments on commit 2f81a3e

Please sign in to comment.