Inside a flow, I'm defining a tool (
Inside a flow, I'm defining a tool (because I have to pass info to a function the LLM doesn't have), and I'm getting the following warning:
WARNING: /tool/getContext already has an entry in the registry. Overwriting.WARNING: /tool/getContext already has an entry in the registry. Overwriting.:const getContextTool = ai.defineTool({
name: "getContext",
description: "Get the context from the knowledge base",
inputSchema: z.object({
query: z.string().describe(
"an optimized query to search the knowledge base",
),
}),
outputSchema: z.string(),
}, async (input) => {
return await getContext(
agentSettings.active_kb_id as UUID,
input.query.trim(),
);
});
const { text: responseText, finishReason } = await ai.generate({
system,
prompt,
tools: [getContextTool],
model: googleAI.model(agentSettings.ai_model),
config: {
temperature: agentSettings.temperature,
},
});const getContextTool = ai.defineTool({
name: "getContext",
description: "Get the context from the knowledge base",
inputSchema: z.object({
query: z.string().describe(
"an optimized query to search the knowledge base",
),
}),
outputSchema: z.string(),
}, async (input) => {
return await getContext(
agentSettings.active_kb_id as UUID,
input.query.trim(),
);
});
const { text: responseText, finishReason } = await ai.generate({
system,
prompt,
tools: [getContextTool],
model: googleAI.model(agentSettings.ai_model),
config: {
temperature: agentSettings.temperature,
},
});