Closed pablosalazar7 closed 3 months ago
SOLUTION
in fn0.ts add "withLocalAuthContext: context.auth" (or whatever you need to pass) at runFlow options
initializeApp()
configureGenkit({
plugins: [
firebase(),
vertexAI({ projectId: "", location: '' }),
],
});
export default async (
data: any,
context: https.CallableContext
) => {
const genAiFlow = await runFlow(flow0, data,{
withLocalAuthContext: context.auth //<------
})
return genAiFlow
}
Describe the bug When cloud function try to runFlow(), im getting this error -> Unhandled error Error: Auth is required at Flow
To Reproduce
Files in project :
index.ts
fn0.ts
flow0.ts
frontEnd
Additional context Works well when use Genkit Developer UI (local), im setting various vertex roles (admin, agent service, agent reasoning, user) in IAM to admin SA, but doesnt work.