-
Notifications
You must be signed in to change notification settings - Fork 108
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
Setting up model credentials programmatically? #859
Comments
Currently not aside from dynamically setting the environment variables when launching the CLI. The .env file is only used to populate the process.env object. One could think of registering a function that reads secrets? readSecret(id: string) => promise We kind of have a similar support for the Azure providers where we fetch a token on demand. |
And what variable would that function need to update to override the value from |
I've added a documentation section about skipping the '.env' file all together (https://microsoft.github.io/genaiscript/getting-started/configuration/#no-env-file). I wonder if this would be enough to unblock as you "just" need to have a wrapper that sets up the environment variables and launch genaiscript. (genaiscript optionally loads the .env file) |
I ended up writing a A more elegant option (for me) would be to be able to override these variables in the script section, e.g. using
|
If you simply need to use process.env variable, you already get this for free since this is where GenAIScript loads the secrets (after optionally applying the .env file). So in your case, remove any .env file and set the process environment variables when lauching genaiscript. This is what I tried to document in the new docs. (Looking for a better option for a javascript-based config) |
At my firm, we are proxying all requests to LLM service providers; users are assigned keys we rotate keys frequently; these are then translated into OpenAI/Anthropic/etc. keys on the backend.
Having keys hardcoded in the
.env
file is not practical.Is there a way of programmatically setting up keys for the various models inside the script itself?
The text was updated successfully, but these errors were encountered: