diff --git a/src/agents/bee/prompts.ts b/src/agents/bee/prompts.ts index 465e9a2d..31848531 100644 --- a/src/agents/bee/prompts.ts +++ b/src/agents/bee/prompts.ts @@ -33,6 +33,8 @@ export const BeeSystemPrompt = new PromptTemplate({ }), template: `# Available functions {{#tools.length}} +When specifying function parameters in Function Input, you must always use all required parameters. + {{#tools}} Function Name: {{name}} Description: {{description}} @@ -57,7 +59,7 @@ Thought: A single-line plan of how to answer the user's message. It must be imme {{#tools.length}} Thought: A single-line step-by-step plan of how to answer the user's message. Use functions that best answer the preceding Message based on their Description. When the problem seems too hard for the function, you should try to split it into smaller ones. This line must be immediately followed by Final Answer if available information and capabilities are sufficient to provide the answer, or by Function Name when one of the available functions needs to be called. Do not provide the answer here. Function Name: Name of the function that can best answer the preceding Thought. It must be one of the available functions defined above. -Function Input: Parameters for the function to best answer the preceding Thought. You must always strictly follow the Parameters schema. Use this instruction even if the parameters is an empty object. +Function Input: Function parameters. Use this instruction even if the parameters is an empty object. Function Caption: A single-line description of the function calling for the user. Function Output: Output of the function in JSON format. Thought: Continue your thinking process. @@ -77,7 +79,6 @@ You must always follow the communication structure and instructions defined abov {{#tools.length}} You must always follow the communication structure and instructions defined above. Do not forget that Thought must be immediately followed by either Function Name or Final Answer. Functions must be used to retrieve factual or historical information to answer the message. -When the problem seems too hard for the function, you should try to split it into smaller ones. {{/tools.length}} If the user suggests using a function that is not available, answer that the function is not available. You can suggest alternatives if appropriate. When the message is unclear or you need more information from the user, ask in Final Answer. @@ -93,7 +94,7 @@ Prefer to use these capabilities over functions. - When answering the user, use friendly formats for time and date. - Use markdown syntax for formatting code snippets, links, JSON, tables, images, files. - Sometimes, things don't go as planned. Functions may not provide useful information on the first few tries. You should always try a few different approaches before declaring the problem unsolvable. -- When the function doesn't give you what you were asking for, you must either use another funtion or a different function input. +- When the function doesn't give you what you were asking for, you must either use another function or a different function input. - When using search engines, you try different formulations of the query, possibly even in a different language. # Role diff --git a/src/tools/weather/openMeteo.ts b/src/tools/weather/openMeteo.ts index 046cd5a2..c8b9d0d7 100644 --- a/src/tools/weather/openMeteo.ts +++ b/src/tools/weather/openMeteo.ts @@ -64,7 +64,7 @@ export class OpenMeteoTool extends Tool< ToolRunOptions > { name = "OpenMeteo"; - description = `Retrieves current, past, or future weather forecasts for a specified location.`; + description = `Retrieve current, past, or future weather forecasts for a location.`; inputSchema() { return z @@ -85,13 +85,14 @@ export class OpenMeteoTool extends Tool< .strip(), ]), start_date: z - .union([z.string().date(), z.string().datetime()]) + .string() + .date() .describe("Start date for the weather forecast in the format YYYY-MM-DD (UTC)"), end_date: z - .union([z.string().date(), z.string().datetime()]) + .string() + .date() .describe("End date for the weather forecast in the format YYYY-MM-DD (UTC)") .optional(), - elevation: z.coerce.number().nullish(), temperature_unit: z.enum(["celsius", "fahrenheit"]).default("celsius"), }) .strip();