feat: Ollama-like setting page for lm-studio#661
Conversation
✅ Deploy Preview for airi-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello @AdairLi2504, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the user experience for configuring LM Studio by adding a dedicated settings page. The change streamlines the setup process by removing an irrelevant API key input and focusing on the essential base URL configuration, making it more intuitive and less confusing for users interacting with local LM Studio servers. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
✅ Deploy Preview for airi-vtuber ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Code Review
This pull request introduces a dedicated settings page for LM Studio, which simplifies the user experience by removing the unnecessary API key field. The implementation is solid, but I've identified a couple of areas for improvement. My feedback focuses on reducing code duplication by leveraging an existing composable and avoiding hardcoded values by using provider metadata, which will enhance maintainability.
| // Define computed properties for credentials | ||
|
|
||
| const baseUrl = computed({ | ||
| get: () => providers.value[providerId]?.baseUrl || '', | ||
| set: (value) => { | ||
| if (!providers.value[providerId]) | ||
| providers.value[providerId] = {} | ||
| providers.value[providerId].baseUrl = value | ||
| }, | ||
| }) | ||
|
|
||
| // Use the composable to get validation logic and state | ||
| const { | ||
| t, | ||
| router, | ||
| providerMetadata, | ||
| isValidating, | ||
| isValid, | ||
| validationMessage, | ||
| handleResetSettings, | ||
| } = useProviderValidation(providerId) |
There was a problem hiding this comment.
The useProviderValidation composable already provides a baseUrl computed property. Re-implementing it here introduces unnecessary code duplication. To improve maintainability and adhere to the DRY principle, you should use the baseUrl provided by the composable.
// Use the composable to get validation logic and state
const {
t,
router,
providerMetadata,
baseUrl,
isValidating,
isValid,
validationMessage,
handleResetSettings,
} = useProviderValidation(providerId)
| > | ||
| <ProviderBaseUrlInput | ||
| v-model="baseUrl" | ||
| placeholder="http://localhost:1234/v1/" |
There was a problem hiding this comment.
The placeholder URL is hardcoded. It's better to dynamically bind this value from the provider's metadata. This avoids hardcoding and centralizes the default configuration, making future updates easier. The generic provider settings page already follows this pattern.
:placeholder="providerMetadata?.defaultOptions?.().baseUrl as string || 'http://localhost:1234/v1/'"
Description
There is a new setting page for lm-studio, so users will not face a confusing and actually useless apiKey input.
Additional Context
There is no evidence that lm-studio server can handle any headers, so advanced setting is not needed