Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow change of API key in generate function #1598

Open
handihow opened this issue Jan 13, 2025 · 0 comments
Open

Allow change of API key in generate function #1598

handihow opened this issue Jan 13, 2025 · 0 comments

Comments

@handihow
Copy link

Is your feature request related to a problem? Please describe.
I would like to be able to change the API key for providers during the generate function. As a possible parameter. The problem is that AI instances must be created beforehand. That way, it is not possible to access secrets (for OpenAI) or to change the API key based on a project or client making the call from the front end.

Describe the solution you'd like
We can now allow several plugins when creating the Genkit instance and change the model during the onFlow. But it would be nice to be able to also set the API key for a provider as parameter for the generate function. Or to modify the Genkit instance before the generate function. If I try to do that now, there is an error.

Describe alternatives you've considered
I now have to create flows for each project or client in my app and have the front end call separate flows based on the client. This is cumbersome and we will have many flows like this because all will be duplicate for each client. There is no way for me to retrieve the API keys for the client during the flow and change them before calling the generate function.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant