GenkitG
Genkitโ€ข2mo ago
military-pink

So, i recently tried to modify my flow

So, i recently tried to modify my flow for additional input parameter chatHistory:

export const enrichFlow = agenticAi.defineFlow( { name: 'fireFlow', inputSchema: z.object({msg: z.string(), chatHistory: z.array(z.string())}), }, async ({msg, chatHistory},{ context }) => { const response = await agenticAi.generate({ system: "my system prompt....." prompt: msg, messages: chatHistory, model: googleAI.model('gemini-2.5-flash'), tools: [getUserProfile], });
But this now redlines my agenticAi.generate call with below error in visual code (shows when i hover over the redline on call). What am i missing? if i remove newly added chatHistory from input schema and async part below it then it is all good.

No overload matches this call. Overload 1 of 3, '(strPrompt: string): Promise<GenerateResponse<any>>', gave the following error. Argument of type '{ system: string; prompt: string; messages: string[]; model: ModelReference<z.ZodObject<{ version: z.ZodOptional<z.ZodString>; maxOutputTokens: z.ZodOptional<z.ZodNumber>; topK: z.ZodOptional<z.ZodNumber>; stopSequences: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; } & { ...; }, "passthrough", z.ZodTypeAny, z.obj...' is not assignable to parameter of type 'string'. Overload 2 of 3, '(parts: ({ text: string; metadata?: Record<string, unknown> | undefined; custom?: Record<string, unknown> | undefined; media?: undefined; toolRequest?: undefined; toolResponse?: undefined; data?: unknown; reasoning?: undefined; resource?: undefined; } | ... 6 more ... | { ...; })[]): Promise<...>', gave the following error. Object literal may only specify known properties, and 'system' does not exist in type '({ text: string; metadata?: Record<string, unknown> | undefined; custom?: Record<string, unknown> | undefined; media?: undefined; toolRequest?: undefined; toolResponse?: undefined; data?: unknown; reasoning?:
Was this page helpful?