-
-
Notifications
You must be signed in to change notification settings - Fork 13.1k
💄 style: Allow Gemini as custom provider #8190
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
base: main
Are you sure you want to change the base?
Conversation
@sxjeru is attempting to deploy a commit to the LobeHub Community Team on Vercel. A member of the Team first needs to authorize it. |
Reviewer's GuideImplement name fallback to ID for new AI providers and add Gemini as an SDK type option. Sequence Diagram for AI Provider Creation with Name Fallback LogicsequenceDiagram
actor User
participant CreateNewProviderForm as Form UI
participant CreateNewProviderComponent as Component Logic
participant createNewAiProviderFunc as createNewAiProvider()
User->>CreateNewProviderForm: Fills provider details (ID, optional Name, SDK Type, etc.)
User->>CreateNewProviderForm: Submits form
CreateNewProviderForm->>CreateNewProviderComponent: onSubmit(values)
CreateNewProviderComponent->>CreateNewProviderComponent: finalName = values.name ? values.name : values.id
CreateNewProviderComponent->>createNewAiProviderFunc: Call with {..., name: finalName, ...}
createNewAiProviderFunc-->>CreateNewProviderComponent: Promise (e.g., success)
alt Creation Successful
CreateNewProviderComponent->>User: Display success message
CreateNewProviderComponent->>User: Redirect to provider page
else Creation Failed
CreateNewProviderComponent->>User: Display error message
end
Class Diagram: Updated Form Configuration and SDKTypeclassDiagram
class NameFormFieldConfig {
+label: string
+minWidth: number
+name: string
%% Former attribute 'rules: [{ required: true }]' was removed, making the field optional in UI validation %%
}
class SdkTypeEnum {
<<enumeration>>
OPENAI
ANTHROPIC
OLLAMA
GOOGLE %% New value 'google' added for Gemini %%
}
class ProviderCreationPayload {
+id: string
+name: string %% Value is 'values.name' or 'values.id' if 'values.name' is empty %%
+sdkType: SdkTypeEnum
%% Other provider-specific fields %%
}
ProviderCreationPayload *-- SdkTypeEnum : uses
File-Level Changes
Assessment against linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
👍 @sxjeru Thank you for raising your pull request and contributing to our Community |
TestGru AssignmentSummary
Tip You can |
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8190 +/- ##
==========================================
- Coverage 95.67% 87.86% -7.81%
==========================================
Files 14 836 +822
Lines 2522 62355 +59833
Branches 445 3937 +3492
==========================================
+ Hits 2413 54791 +52378
- Misses 109 7564 +7455
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
不知道能不能这样改,目前无法在启用客户端请求的情况下正常使用。
根据测试,anthropic 类型的自定义提供商也不支持客户端请求,可能是 lobechat 没有做支持,可以暂时考虑隐藏掉客户端请求开关。
另服务商名称不再必需,为空时自动采用服务商 id 。
📝 补充信息 | Additional Information
Summary by Sourcery
Enable using ID as a fallback name for new AI providers, remove mandatory name validation, and introduce Gemini to the SDK type dropdown.
New Features:
Enhancements: