henomis / lingoose

🪿 LinGoose is a Go framework for building awesome AI/LLM applications.
https://lingoose.io
MIT License
661 stars 56 forks source link

Allow developers to decide whether to use env vars for API keys or not #216

Open Tochemey opened 2 months ago

Tochemey commented 2 months ago

Is your feature request related to a problem? Please describe. Current I have observed that one need to set API kEY (either for claude, etc...) as env vars before calling those APIs. This is ok, however it is not scalable because it forces developers to set an environment variable. Some companies do not use env variables due to security concerns.

Describe the solution you'd like I will suggest passing those keys as parameters and let the developer decide how he/she would like to set them or use them. For instance openai.New(apiKey string) should suffice.

henomis commented 4 weeks ago

You can use the method WithClient(client *openai.Client) *OpenAI to solve your issue