-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: fetch LLM API keys from user env variables #102
Conversation
Greetings Professor @jooyoungseo, While this PR addresses the issue of LLM keys being lost due to changes in the port number each time a Maidr instance is run, I believe we should consider a more scalable solution, especially in light of potential future changes. I discussed this matter with @SaaiVenkat, and he shares the concern that these fixes do not address the core problem but rather serve as a workaround for a dependency issue with the library. This issue could have been more easily resolved if In my opinion, a more sustainable solution would be to implement a custom server to serve our HTML files, rather than relying on py-htmltools for this functionality. However, this is just my suggestion, and I would appreciate your thoughts on the matter. Best Regards, |
I had a Slack communication with @dakshpokar and we agreed that we need to use a custom local server and pin down a port number for an interactive console sessions (e.g., vanilla Python repl; ipython repl) while keeping the current behavior of |
Professor @jooyoungseo , since this is stopgap solution, I would suggest to create a backlog ticket right away to address this issue and link it with this issue. cc: @dakshpokar |
Update: @dakshpokar and I decided to make a separate PR addressing the custom local server implementation. However, I vote for the current approach where users save their API keys in their env variables (e.g., |
@dakshpokar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested all the possible edge cases with various env variable combinations. It is working very reliably. LGTM! I am merging it now.
Description
This pull request fixes the handling of API keys for LLMs in the code. It adds a JavaScript script to handle the API keys for LLMs and initializes the LLM secrets in the MAIDR instance. The script injects the LLM API keys into the MAIDR instance and sets the appropriate settings based on the presence of the Gemini and OpenAI API keys. This ensures that the LLM functionality works correctly with the updated API key handling.
closes #76
Type of Change
Checklist
Pull Request
Description
initialize_llm_secrets()
in environment.py which fetches the keys from the environment variable.Checklist
ManualTestingProcess.md
, and all tests related to this pull request pass.Additional Notes