Skip to content

[Docs] explain how to pass context to runFlow and streamFlow #2673

Open
@markgoho

Description

@markgoho

Is your report related to a problem? Please describe.
How do we pass context to runFlow?

Is your report related to a suggestion/improvement? Please describe.
The /genkit/context page shows how to add context when calling a flow directly, e.g.

const summarizeHistory = ai.defineFlow(/* ... */);

const summary = await summarizeHistory(friend.uid, {context: {auth: currentUser}});

but when calling this from the front end, e.g.

// Angular component class
menuResource = resource({
  request: () => this.theme(),
  // where does the context go?
  loader: ({ request }) => runFlow<string>({ url: 'menu', input: request }),
});

Additional context
FYI, the word context in the template here makes it very difficult for issues pertaining to context

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions