Skip to content

fix: When adding a large language model in Application-Settings-Add AI node, the Base Model is not listed #2804

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

Merged
merged 1 commit into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ui/src/views/template/component/CreateModelDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,9 @@ const open = (provider: Provider, model_type?: string) => {
dialogVisible.value = true
base_form_data.value.model_type = model_type || ''
activeName.value = 'base-info'
if (model_type) {
list_base_model(model_type)
}
}

const list_base_model = (model_type: any, change?: boolean) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code looks correct and well-organized. However, there's an extra blank line added at the end of the function definition, which could be removed for better readability:

@@ -377,6 +377,8 @@
   dialogVisible.value = true
   base_form_data.value.model_type = model_type || ''
   activeName.value = 'base-info'
+  if (model_type) {
+    list_base_model(model_type);
+  }
 }

Additionally, you might consider adding type annotations to improve code clarity:

const open = (provider: Provider, model_type?: string): void => {
  dialogVisible.value = true;
  base_form_data.value.model_type = model_type || '';
  activeName.value = 'base-info';
  if (model_type !== undefined) { // Ensure it's not null or undefined before checking
    list_base_model(model_type);
  }
}

These changes will make the code more maintainable and robust, especially when dealing with nullable values.

Expand Down