GenkitG
Genkitโ€ข14mo ago
ltd-scarlet

definePrompt config not respected in DevUI

Hello, I am facing issue to define the model name in definePrompt here is my code ...

const chorsPrompt = fireGenkit.definePrompt(
  {
    name: 'Chors Prompt',
    description: 'Prompt for Chors',
    model: gemini15Pro,
    output: {
      format: 'json',
      schema: z.object({
        message: z.string().describe('Message to the user'),
        name: z.string().describe('Name of the person')
      })
    },
    input: {
      schema: z.object({
        name: z.string().describe('Name of the person')
      })
    }
  },
  async (input) => {
    console.log(gemini15Pro.name);
    return {
      messages: [{ role: 'user', content: [{ text: `Say hello to ${input.name}` }] }]
    };
  }
);


when i use this code and use Genkit dev ui still default model is selected and it makes request to that model not pre-selected.

also structured output is not working here, if i use same prompt and call it inside defineFlow it is working as i need. with structured output and selected model.
Was this page helpful?