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: set API key from settings modal #1319
Conversation
🤔 this didn't seem to work for me--I plugged in a bad API key, and it just used the key I had set on the backend |
Hmm thank you for testing. Will debug. |
I think fixed. Not sure if I caught all edge cases. |
@@ -25,6 +25,9 @@ function SettingsModal({ isOpen, onOpenChange }: SettingsProps) { | |||
const [agents, setAgents] = React.useState<string[]>([]); | |||
const [settings, setSettings] = | |||
React.useState<Partial<Settings>>(currentSettings); | |||
const [apiKey, setApiKey] = React.useState<string>( |
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.
You've extended getCurrentSettings
to also include the API key. Maybe you can utilize the settings
state that now already stores this data directly rather than use a separate state to handle the API key.
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.
Yep, good point.
Also, it seems that this branch does not contain the most recent updates made to the |
There is some strange behavior regarding the way settings are stored. First off, some issues I am facing with the API key:
After some exploring, I also found a few issues:
|
@Sparkier I can't actually get this to work 🤔 It seems to always send an empty LLM_API_KEY to the websocket. As @amanape points out, it also doesn't save the new settings if you only change API key. @amanape I recently did a huge simplification of how settings are saved--definitely possible we can simplify further |
I think my changes conflicted with the settings simplification. I just merged things and tested and I can change the API key from the UI now. |
Seems to work nicely! |
depends on #1291
fix #1146