mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
feat(llm): add warning to the top of LLM Chat Notes and LLM settings that the feature is experimental
This commit is contained in:
parent
055b34fb46
commit
01966d2f00
@ -1260,6 +1260,7 @@
|
|||||||
},
|
},
|
||||||
"create_new_ai_chat": "Create new AI Chat",
|
"create_new_ai_chat": "Create new AI Chat",
|
||||||
"configuration_warnings": "There are some issues with your AI configuration. Please check your settings.",
|
"configuration_warnings": "There are some issues with your AI configuration. Please check your settings.",
|
||||||
|
"experimental_warning": "The LLM feature is currently experimental - you have been warned.",
|
||||||
"selected_provider": "Selected Provider",
|
"selected_provider": "Selected Provider",
|
||||||
"selected_provider_description": "Choose the AI provider for chat and completion features",
|
"selected_provider_description": "Choose the AI provider for chat and completion features",
|
||||||
"select_model": "Select model...",
|
"select_model": "Select model...",
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
* Validation functions for LLM Chat
|
* Validation functions for LLM Chat
|
||||||
*/
|
*/
|
||||||
import options from "../../services/options.js";
|
import options from "../../services/options.js";
|
||||||
|
import { t } from "../../services/i18n.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate providers configuration
|
* Validate providers configuration
|
||||||
@ -37,6 +38,9 @@ export async function validateProviders(validationWarning: HTMLElement): Promise
|
|||||||
// Check for configuration issues with providers in the precedence list
|
// Check for configuration issues with providers in the precedence list
|
||||||
const configIssues: string[] = [];
|
const configIssues: string[] = [];
|
||||||
|
|
||||||
|
// Always add experimental warning as the first item
|
||||||
|
configIssues.push(t("ai_llm.experimental_warning"));
|
||||||
|
|
||||||
// Check each provider in the precedence list for proper configuration
|
// Check each provider in the precedence list for proper configuration
|
||||||
for (const provider of precedenceList) {
|
for (const provider of precedenceList) {
|
||||||
if (provider === 'openai') {
|
if (provider === 'openai') {
|
||||||
|
@ -203,6 +203,11 @@ export default class AiSettingsWidget extends OptionsWidget {
|
|||||||
// Get selected provider
|
// Get selected provider
|
||||||
const selectedProvider = this.$widget.find('.ai-selected-provider').val() as string;
|
const selectedProvider = this.$widget.find('.ai-selected-provider').val() as string;
|
||||||
|
|
||||||
|
// Start with experimental warning
|
||||||
|
const allWarnings = [
|
||||||
|
t("ai_llm.experimental_warning")
|
||||||
|
];
|
||||||
|
|
||||||
// Check for selected provider configuration
|
// Check for selected provider configuration
|
||||||
const providerWarnings: string[] = [];
|
const providerWarnings: string[] = [];
|
||||||
if (selectedProvider === 'openai') {
|
if (selectedProvider === 'openai') {
|
||||||
@ -222,10 +227,8 @@ export default class AiSettingsWidget extends OptionsWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combine all warnings
|
// Add provider warnings to all warnings
|
||||||
const allWarnings = [
|
allWarnings.push(...providerWarnings);
|
||||||
...providerWarnings
|
|
||||||
];
|
|
||||||
|
|
||||||
// Show or hide warnings
|
// Show or hide warnings
|
||||||
if (allWarnings.length > 0) {
|
if (allWarnings.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user