Save different API configurations to quickly switch between providers and settings#297
Save different API configurations to quickly switch between providers and settings#297
Conversation
…rovider from MrUbens
Added useEffect hooks to GlamaModelPicker, OpenAiModelPicker, and OpenRouterModelPicker components to ensure the search term stays synchronized with the selected model ID from apiConfiguration. This prevents the search term from getting out of sync when the model is changed.
🦋 Changeset detectedLatest commit: 9d16006 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| }) | ||
|
|
||
|
|
||
| this.configManager.ListConfig().then(async (listApiConfig) => { |
There was a problem hiding this comment.
Using async/await makes asynchronous code more readable and easier to maintain than chaining .then() calls. Please refactor this to use async/await. This is from our Development Standards: Development Standards.
| setAlwaysAllowMcp(e.target.checked) | ||
| vscode.postMessage({ type: "alwaysAllowMcp", bool: e.target.checked }) | ||
| }}> | ||
| onChange={(e: any) => setAlwaysAllowMcp(e.target.checked)}> |
There was a problem hiding this comment.
Avoid using the any type for event handlers. Instead, use a more specific type like React.ChangeEvent<HTMLInputElement> for better type safety. This is applicable in other places as well, such as lines 254, 278, 317, 364, 400, 412, 448, and 459. This is from our Development Standards: https://www.notion.so/Development-Standards-59febcf8ead647fd9c2ec3f60c22f3df?pvs=4#11869ad2d5818051ae9cefd92c3aac2b
Slight cleanup of #240 to make it easy to switch between different API configurations. This enables people to switch between multiple keys on the same provider, to easily maintain two different OpenAI compatible providers, and to simulate different chat modes (for instance o1 for planning and sonnet for coding - more on that soon 🙏 ).
Important
Adds functionality to manage multiple API configurations, including UI components and tests, enabling easy switching between providers and settings.
ConfigManagerinConfigManager.tsto manage multiple API configurations with methods for saving, loading, deleting, and listing configurations.ClineProvider.tsto integrateConfigManagerfor handling API configurations.ApiConfigManager.tsxandSettingsView.tsxfor managing configurations, including adding, renaming, and deleting configurations.ConfigManager.test.tsforConfigManagermethods to ensure correct behavior.SettingsView.test.tsxto test new configuration management UI.README.mdto mention the new feature of saving different API configurations.checkExistKey()incheckExistApiConfig.tsto verify if a configuration key exists.ChatTextArea.tsxandChatView.tsxto support new configuration management.This description was created by
for fd07550. It will automatically update as commits are pushed.