GenkitG
Genkitโ€ข14mo ago
sacred-rose

Hello! I have a question, and maybe I'm

Hello! I have a question, and maybe I'm using it wrong. I have a multi agent approach where I have a triage agent to handle incoming messages. And when a user asks for something to do it will use the tripAgent (which uses a weather api) to give the user something to do. This is done by definding the multiple prompts like so:

const tripAgent = ai.definePrompt(
  {
    name: "tripAgent",
    tools: [getWeather],
...
const triageAgent = ai.definePrompt(
  {
    name: "triageAgent",
    tools: [tripAgent],


but now I moved toward a flow structure and the triageAgent has become a triageFlow and I add the trip agent as a tool again
const response = await ai.generate({
      prompt: `
            ... prompt...

            If the user asks for something to do in the nearby surroundings please use the tripAgent tool.

            Question: ${input}`,
      tools: [tripAgent],
    });

but now it never seems to use the tripAgent anymore. Am I using it wrong or is the context of "tools" different in ai.generate or ai.definePrompt?
Was this page helpful?