new settings for rag

This commit is contained in:
n4ze3m 2024-06-03 00:30:10 +05:30
parent ca30198d35
commit 692c0887cc
28 changed files with 565 additions and 495 deletions

View File

@ -217,41 +217,6 @@
"label": "Ollama URL", "label": "Ollama URL",
"placeholder": "Enter Ollama URL" "placeholder": "Enter Ollama URL"
}, },
"ragSettings": {
"label": "RAG Settings",
"model": {
"label": "Embedding Model",
"required": "Please select a model",
"help": "Highly recommended to use embedding models like `nomic-embed-text`.",
"placeholder": "Select a model"
},
"chunkSize": {
"label": "Chunk Size",
"placeholder": "Enter Chunk Size",
"required": "Please enter a chunk size"
},
"chunkOverlap": {
"label": "Chunk Overlap",
"placeholder": "Enter Chunk Overlap",
"required": "Please enter a chunk overlap"
}
},
"prompt": {
"label": "Configure RAG Prompt",
"option1": "Normal",
"option2": "Web",
"alert": "Configuring the system prompt here is deprecated. Please use the Manage Prompts section to add or edit prompts. This section will be removed in a future release",
"systemPrompt": "System Prompt",
"systemPromptPlaceholder": "Enter System Prompt",
"webSearchPrompt": "Web Search Prompt",
"webSearchPromptHelp": "Do not remove `{search_results}` from the prompt.",
"webSearchPromptError": "Please enter a web search prompt",
"webSearchPromptPlaceholder": "Enter Web Search Prompt",
"webSearchFollowUpPrompt": "Web Search Follow Up Prompt",
"webSearchFollowUpPromptHelp": "Do not remove `{chat_history}` and `{question}` from the prompt.",
"webSearchFollowUpPromptError": "Please input your Web Search Follow Up Prompt!",
"webSearchFollowUpPromptPlaceholder": "Your Web Search Follow Up Prompt"
},
"advanced": { "advanced": {
"label": "Advance Ollama URL Configuration", "label": "Advance Ollama URL Configuration",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -282,5 +247,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "Manage Knowledge", "title": "Manage Knowledge",
"heading": "Configure Knowledge Base" "heading": "Configure Knowledge Base"
},
"rag": {
"title": "RAG Settings",
"ragSettings": {
"label": "RAG Settings",
"model": {
"label": "Embedding Model",
"required": "Please select a model",
"help": "Highly recommended to use embedding models like `nomic-embed-text`.",
"placeholder": "Select a model"
},
"chunkSize": {
"label": "Chunk Size",
"placeholder": "Enter Chunk Size",
"required": "Please enter a chunk size"
},
"chunkOverlap": {
"label": "Chunk Overlap",
"placeholder": "Enter Chunk Overlap",
"required": "Please enter a chunk overlap"
}
},
"prompt": {
"label": "Configure RAG Prompt",
"option1": "Normal",
"option2": "Web",
"alert": "Configuring the system prompt here is deprecated. Please use the Manage Prompts section to add or edit prompts. This section will be removed in a future release",
"systemPrompt": "System Prompt",
"systemPromptPlaceholder": "Enter System Prompt",
"webSearchPrompt": "Web Search Prompt",
"webSearchPromptHelp": "Do not remove `{search_results}` from the prompt.",
"webSearchPromptError": "Please enter a web search prompt",
"webSearchPromptPlaceholder": "Enter Web Search Prompt",
"webSearchFollowUpPrompt": "Web Search Follow Up Prompt",
"webSearchFollowUpPromptHelp": "Do not remove `{chat_history}` and `{question}` from the prompt.",
"webSearchFollowUpPromptError": "Please input your Web Search Follow Up Prompt!",
"webSearchFollowUpPromptPlaceholder": "Your Web Search Follow Up Prompt"
}
} }
} }

View File

@ -217,41 +217,6 @@
"label": "Url de Ollama", "label": "Url de Ollama",
"placeholder": "Entrer l'url de Ollama" "placeholder": "Entrer l'url de Ollama"
}, },
"ragSettings": {
"label": "Paramètres de RAG",
"model": {
"label": "Modèle d'embedding",
"required": "Veuillez sélectionner un modèle",
"help": "Fortement recommandé d'utiliser des modèles d'embedding comme «momic-embed-text».",
"placeholder": "Sélectionnez un modèle"
},
"chunkSize": {
"label": "Taille",
"placeholder": "Entrez la taille du morceau",
"required": "Veuillez saisir une taille"
},
"chunkOverlap": {
"label": "Chevauchement",
"placeholder": "Entrez le chevauchement des morceaux",
"required": "Veuillez saisir un chevauchement"
}
},
"prompt": {
"label": "Configure RAG Prompt",
"option1": "Normal",
"option2": "Web",
"alert": "La configuration du prompt système ici est déconseillée. Veuillez utiliser la section Gérer les prompts pour ajouter...",
"systemPrompt": "Prompt système",
"systemPromptPlaceholder": "Entrez le prompt système",
"webSearchPrompt": "Prompt de recherche Web",
"webSearchPromptHelp": "Ne supprimez pas `{search_results}` du prompt.",
"webSearchPromptError": "Veuillez saisir un prompt de recherche Web",
"webSearchPromptPlaceholder": "Entrez le prompt de recherche Web",
"webSearchFollowUpPrompt": "Prompt de suivi de recherche Web",
"webSearchFollowUpPromptHelp": "Ne supprimez pas `{chat_history}` et `{question}` du prompt.",
"webSearchFollowUpPromptError": "Veuillez saisir votre prompt de suivi de recherche Web!",
"webSearchFollowUpPromptPlaceholder": "Votre prompt de suivi de recherche Web"
},
"advanced": { "advanced": {
"label": "Configuration avancée de l'URL de Ollama", "label": "Configuration avancée de l'URL de Ollama",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -282,5 +247,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "Gérer les connaissances", "title": "Gérer les connaissances",
"heading": "Configurer la base de connaissances" "heading": "Configurer la base de connaissances"
},
"rag": {
"title": "Paramètres de RAG",
"ragSettings": {
"label": "Paramètres de RAG",
"model": {
"label": "Modèle d'embedding",
"required": "Veuillez sélectionner un modèle",
"help": "Fortement recommandé d'utiliser des modèles d'embedding comme «momic-embed-text».",
"placeholder": "Sélectionnez un modèle"
},
"chunkSize": {
"label": "Taille",
"placeholder": "Entrez la taille du morceau",
"required": "Veuillez saisir une taille"
},
"chunkOverlap": {
"label": "Chevauchement",
"placeholder": "Entrez le chevauchement des morceaux",
"required": "Veuillez saisir un chevauchement"
}
},
"prompt": {
"label": "Configure RAG Prompt",
"option1": "Normal",
"option2": "Web",
"alert": "La configuration du prompt système ici est déconseillée. Veuillez utiliser la section Gérer les prompts pour ajouter...",
"systemPrompt": "Prompt système",
"systemPromptPlaceholder": "Entrez le prompt système",
"webSearchPrompt": "Prompt de recherche Web",
"webSearchPromptHelp": "Ne supprimez pas `{search_results}` du prompt.",
"webSearchPromptError": "Veuillez saisir un prompt de recherche Web",
"webSearchPromptPlaceholder": "Entrez le prompt de recherche Web",
"webSearchFollowUpPrompt": "Prompt de suivi de recherche Web",
"webSearchFollowUpPromptHelp": "Ne supprimez pas `{chat_history}` et `{question}` du prompt.",
"webSearchFollowUpPromptError": "Veuillez saisir votre prompt de suivi de recherche Web!",
"webSearchFollowUpPromptPlaceholder": "Votre prompt de suivi de recherche Web"
}
} }
} }

View File

@ -217,41 +217,6 @@
"label": "Ollama URL", "label": "Ollama URL",
"placeholder": "Inserici l'URL di Ollama" "placeholder": "Inserici l'URL di Ollama"
}, },
"ragSettings": {
"label": "Impostazioni RAG",
"model": {
"label": "Modello di Embedding",
"required": "Scegliere il modello",
"help": "E' raccomandato l'uso di modelli come `nomic-embed-text`.",
"placeholder": "Seleziona un modello"
},
"chunkSize": {
"label": "Dimensione del Blocco (Chunk Size)",
"placeholder": "Inserisci la Dimensione del Blocco (Chunk Size)",
"required": "Inserisci la Dimensione del Blocco (chunk size)"
},
"chunkOverlap": {
"label": "Sovrapposizione del Blocco (Chunk Overlap)",
"placeholder": "Inserisci la Sovrapposizione del Blocco (Chunk Overlap)",
"required": "Inserisci la Sovrapposizione del Blocco"
}
},
"prompt": {
"label": "Configura il Prompt RAG",
"option1": "Normale",
"option2": "Web",
"alert": "La configurazione del prompt di sistema qui è deprecato. Usa la sezione Gestione Prompt per aggiungere o modificare i prompts.Questa sezione sarà eliminata nelle prossime release",
"systemPrompt": "Prompt di Sistema",
"systemPromptPlaceholder": "Inserisci il Prompt di Sistema",
"webSearchPrompt": "Prompt per la Ricerca Web",
"webSearchPromptHelp": "Non rimuovere `{search_results}` dal prompt.",
"webSearchPromptError": "Inserisci il prompt per la ricerca web",
"webSearchPromptPlaceholder": "Imserosco il Prompt per la Ricerca Web",
"webSearchFollowUpPrompt": "Prompt di Follow Up sulla Ricerca Web",
"webSearchFollowUpPromptHelp": "Non rimuovere `{chat_history}` e `{question}` dal prompt.",
"webSearchFollowUpPromptError": "Inserisci il Prompt di Follow Up della Ricerca Web!",
"webSearchFollowUpPromptPlaceholder": "I tuoi Prompt di Follow Up delle Ricerche Web"
},
"advanced": { "advanced": {
"label": "Configurazione Avanzata Ollama URL", "label": "Configurazione Avanzata Ollama URL",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -282,5 +247,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "Gestisci Conoscenza", "title": "Gestisci Conoscenza",
"heading": "Configura Base di Conoscenza" "heading": "Configura Base di Conoscenza"
},
"rag": {
"title": "Impostazioni RAG",
"ragSettings": {
"label": "Impostazioni RAG",
"model": {
"label": "Modello di Embedding",
"required": "Scegliere il modello",
"help": "E' raccomandato l'uso di modelli come `nomic-embed-text`.",
"placeholder": "Seleziona un modello"
},
"chunkSize": {
"label": "Dimensione del Blocco (Chunk Size)",
"placeholder": "Inserisci la Dimensione del Blocco (Chunk Size)",
"required": "Inserisci la Dimensione del Blocco (chunk size)"
},
"chunkOverlap": {
"label": "Sovrapposizione del Blocco (Chunk Overlap)",
"placeholder": "Inserisci la Sovrapposizione del Blocco (Chunk Overlap)",
"required": "Inserisci la Sovrapposizione del Blocco"
}
},
"prompt": {
"label": "Configura il Prompt RAG",
"option1": "Normale",
"option2": "Web",
"alert": "La configurazione del prompt di sistema qui è deprecato. Usa la sezione Gestione Prompt per aggiungere o modificare i prompts.Questa sezione sarà eliminata nelle prossime release",
"systemPrompt": "Prompt di Sistema",
"systemPromptPlaceholder": "Inserisci il Prompt di Sistema",
"webSearchPrompt": "Prompt per la Ricerca Web",
"webSearchPromptHelp": "Non rimuovere `{search_results}` dal prompt.",
"webSearchPromptError": "Inserisci il prompt per la ricerca web",
"webSearchPromptPlaceholder": "Imserosco il Prompt per la Ricerca Web",
"webSearchFollowUpPrompt": "Prompt di Follow Up sulla Ricerca Web",
"webSearchFollowUpPromptHelp": "Non rimuovere `{chat_history}` e `{question}` dal prompt.",
"webSearchFollowUpPromptError": "Inserisci il Prompt di Follow Up della Ricerca Web!",
"webSearchFollowUpPromptPlaceholder": "I tuoi Prompt di Follow Up delle Ricerche Web"
}
} }
} }

View File

@ -220,41 +220,6 @@
"label": "OllamaのURL", "label": "OllamaのURL",
"placeholder": "OllamaのURLを入力" "placeholder": "OllamaのURLを入力"
}, },
"ragSettings": {
"label": "RAGの設定",
"model": {
"label": "エンベディングモデル",
"required": "モデルを選択してください",
"help": "`nomic-embed-text`などのエンベディングモデルの使用を強くおすすめします。",
"placeholder": "モデルを選択"
},
"chunkSize": {
"label": "チャンクサイズ",
"placeholder": "チャンクサイズを入力",
"required": "チャンクサイズを入力してください"
},
"chunkOverlap": {
"label": "チャンクオーバーラップ",
"placeholder": "チャンクオーバーラップを入力",
"required": "チャンクオーバーラップを入力してください"
}
},
"prompt": {
"label": "RAGプロンプトを設定",
"option1": "通常",
"option2": "Web",
"alert": "ここでシステムプロンプトを設定することは非推奨となりました。プロンプトの追加や編集には「プロンプトを管理」セクションをご利用ください。このセクションは今後のリリースで削除される予定です。",
"systemPrompt": "システムプロンプト",
"systemPromptPlaceholder": "システムプロンプトを入力",
"webSearchPrompt": "Web検索プロンプト",
"webSearchPromptHelp": "プロンプトから`{search_results}`を削除しないでください。",
"webSearchPromptError": "Web検索プロンプトを入力してください",
"webSearchPromptPlaceholder": "Web検索プロンプトを入力",
"webSearchFollowUpPrompt": "Web検索フォローアッププロンプト",
"webSearchFollowUpPromptHelp": "プロンプトから`{chat_history}`と`{question}`を削除しないでください。",
"webSearchFollowUpPromptError": "Web検索フォローアッププロンプトを入力してください",
"webSearchFollowUpPromptPlaceholder": "Web検索フォローアッププロンプト"
},
"advanced": { "advanced": {
"label": "Ollama URL の高度な設定", "label": "Ollama URL の高度な設定",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -285,5 +250,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "知識を管理する", "title": "知識を管理する",
"heading": "知識ベースを構成する" "heading": "知識ベースを構成する"
},
"rag": {
"title": "RAGの設定",
"ragSettings": {
"label": "RAGの設定",
"model": {
"label": "エンベディングモデル",
"required": "モデルを選択してください",
"help": "`nomic-embed-text`などのエンベディングモデルの使用を強くおすすめします。",
"placeholder": "モデルを選択"
},
"chunkSize": {
"label": "チャンクサイズ",
"placeholder": "チャンクサイズを入力",
"required": "チャンクサイズを入力してください"
},
"chunkOverlap": {
"label": "チャンクオーバーラップ",
"placeholder": "チャンクオーバーラップを入力",
"required": "チャンクオーバーラップを入力してください"
}
},
"prompt": {
"label": "RAGプロンプトを設定",
"option1": "通常",
"option2": "Web",
"alert": "ここでシステムプロンプトを設定することは非推奨となりました。プロンプトの追加や編集には「プロンプトを管理」セクションをご利用ください。このセクションは今後のリリースで削除される予定です。",
"systemPrompt": "システムプロンプト",
"systemPromptPlaceholder": "システムプロンプトを入力",
"webSearchPrompt": "Web検索プロンプト",
"webSearchPromptHelp": "プロンプトから`{search_results}`を削除しないでください。",
"webSearchPromptError": "Web検索プロンプトを入力してください",
"webSearchPromptPlaceholder": "Web検索プロンプトを入力",
"webSearchFollowUpPrompt": "Web検索フォローアッププロンプト",
"webSearchFollowUpPromptHelp": "プロンプトから`{chat_history}`と`{question}`を削除しないでください。",
"webSearchFollowUpPromptError": "Web検索フォローアッププロンプトを入力してください",
"webSearchFollowUpPromptPlaceholder": "Web検索フォローアッププロンプト"
}
} }
} }

View File

@ -220,41 +220,6 @@
"label": "Ollama URL", "label": "Ollama URL",
"placeholder": "Ollama URL നല്കുക" "placeholder": "Ollama URL നല്കുക"
}, },
"ragSettings": {
"label": "RAG സെറ്റിംഗുകൾ",
"model": {
"label": "എംബെഡിംഗ് മോഡല്‍",
"required": "ദയവായി ഒരു മോഡല്‍ തിരഞ്ഞെടുക്കുക",
"help": "`nomic-embed-text` പോലുള്ള എംബെഡിംഗ് മോഡലുകള്‍ ഉപയോഗിക്കുന്നത് വളരെ നന്നായിരിക്കും.",
"placeholder": "ഒരു മോഡല്‍ തിരഞ്ഞെടുക്കുക"
},
"chunkSize": {
"label": "ചങ്ക് വലുപ്പം",
"placeholder": "ചങ്ക് വലുപ്പം നല്കുക",
"required": "ദയവായി ചങ്ക് വലുപ്പം നല്കുക"
},
"chunkOverlap": {
"label": "ചങ്ക് ഓവര്‍ലാപ്പ്",
"placeholder": "ചങ്ക് ഓവര്‍ലാപ്പ് നല്കുക",
"required": "ദയവായി ചങ്ക് ഓവര്‍ലാപ്പ് നല്കുക"
}
},
"prompt": {
"label": "RAG പ്രോംപ്റ്റ് കോൺഫിഗർ ചെയ്യുക",
"option1": "സാധാരണ",
"option2": "വെബ്",
"alert": "സിസ്റ്റം പ്രോംപ്റ്റ് ഇവിടെ കോൺഫിഗർ ചെയ്യുന്നത് പഴയൗഖികമായി. ദയവായി പ്രോംപ്റ്റുകള്‍ ചേര്‍ക്കാനോ എഡിറ്റുചെയ്യാനോ മാനേജ് പ്രോംപ്റ്റ്‌സ് സെക്ഷന്‍ ഉപയോഗിക്കുക. ഈ സെക്ഷന്‍ ഭാവിയില്‍ നീക്കം ചെയ്യപ്പെടും.",
"systemPrompt": "സിസ്റ്റം പ്രോംപ്റ്റ്",
"systemPromptPlaceholder": "സിസ്റ്റം പ്രോംപ്റ്റ് നല്കുക",
"webSearchPrompt": "വെബ് തിരയല്‍ പ്രോംപ്റ്റ്",
"webSearchPromptHelp": "പ്രോംപ്റ്റില്‍ നിന്ന് `{search_results}` നീക്കം ചെയ്യരുത്.",
"webSearchPromptError": "ദയവായി ഒരു വെബ് തിരയല്‍ പ്രോംപ്റ്റ് നല്കുക",
"webSearchPromptPlaceholder": "വെബ് തിരയല്‍ പ്രോംപ്റ്റ് നല്കുക",
"webSearchFollowUpPrompt": "വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ്",
"webSearchFollowUpPromptHelp": "പ്രോംപ്റ്റില്‍ നിന്ന് `{chat_history}` യും `{question}` യും നീക്കം ചെയ്യരുത്.",
"webSearchFollowUpPromptError": "ദയവായി നിങ്ങളുടെ വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ് നല്കുക!",
"webSearchFollowUpPromptPlaceholder": "നിങ്ങളുടെ വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ്"
},
"advanced": { "advanced": {
"label": "Advance Ollama URL Configuration", "label": "Advance Ollama URL Configuration",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -285,5 +250,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "വിജ്ഞാനം നിര്‍വ്വഹിക്കുക", "title": "വിജ്ഞാനം നിര്‍വ്വഹിക്കുക",
"heading": "വിജ്ഞാനാധാരം കോണ്‍ഫിഗര്‍ ചെയ്യുക" "heading": "വിജ്ഞാനാധാരം കോണ്‍ഫിഗര്‍ ചെയ്യുക"
},
"rag": {
"title": "RAG സെറ്റിംഗുകൾ",
"ragSettings": {
"label": "RAG സെറ്റിംഗുകൾ",
"model": {
"label": "എംബെഡിംഗ് മോഡല്‍",
"required": "ദയവായി ഒരു മോഡല്‍ തിരഞ്ഞെടുക്കുക",
"help": "`nomic-embed-text` പോലുള്ള എംബെഡിംഗ് മോഡലുകള്‍ ഉപയോഗിക്കുന്നത് വളരെ നന്നായിരിക്കും.",
"placeholder": "ഒരു മോഡല്‍ തിരഞ്ഞെടുക്കുക"
},
"chunkSize": {
"label": "ചങ്ക് വലുപ്പം",
"placeholder": "ചങ്ക് വലുപ്പം നല്കുക",
"required": "ദയവായി ചങ്ക് വലുപ്പം നല്കുക"
},
"chunkOverlap": {
"label": "ചങ്ക് ഓവര്‍ലാപ്പ്",
"placeholder": "ചങ്ക് ഓവര്‍ലാപ്പ് നല്കുക",
"required": "ദയവായി ചങ്ക് ഓവര്‍ലാപ്പ് നല്കുക"
}
},
"prompt": {
"label": "RAG പ്രോംപ്റ്റ് കോൺഫിഗർ ചെയ്യുക",
"option1": "സാധാരണ",
"option2": "വെബ്",
"alert": "സിസ്റ്റം പ്രോംപ്റ്റ് ഇവിടെ കോൺഫിഗർ ചെയ്യുന്നത് പഴയൗഖികമായി. ദയവായി പ്രോംപ്റ്റുകള്‍ ചേര്‍ക്കാനോ എഡിറ്റുചെയ്യാനോ മാനേജ് പ്രോംപ്റ്റ്‌സ് സെക്ഷന്‍ ഉപയോഗിക്കുക. ഈ സെക്ഷന്‍ ഭാവിയില്‍ നീക്കം ചെയ്യപ്പെടും.",
"systemPrompt": "സിസ്റ്റം പ്രോംപ്റ്റ്",
"systemPromptPlaceholder": "സിസ്റ്റം പ്രോംപ്റ്റ് നല്കുക",
"webSearchPrompt": "വെബ് തിരയല്‍ പ്രോംപ്റ്റ്",
"webSearchPromptHelp": "പ്രോംപ്റ്റില്‍ നിന്ന് `{search_results}` നീക്കം ചെയ്യരുത്.",
"webSearchPromptError": "ദയവായി ഒരു വെബ് തിരയല്‍ പ്രോംപ്റ്റ് നല്കുക",
"webSearchPromptPlaceholder": "വെബ് തിരയല്‍ പ്രോംപ്റ്റ് നല്കുക",
"webSearchFollowUpPrompt": "വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ്",
"webSearchFollowUpPromptHelp": "പ്രോംപ്റ്റില്‍ നിന്ന് `{chat_history}` യും `{question}` യും നീക്കം ചെയ്യരുത്.",
"webSearchFollowUpPromptError": "ദയവായി നിങ്ങളുടെ വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ് നല്കുക!",
"webSearchFollowUpPromptPlaceholder": "നിങ്ങളുടെ വെബ് തിരയല്‍ തുടര്‍പ്രോംപ്റ്റ്"
}
} }
} }

View File

@ -217,41 +217,6 @@
"label": "URL do Ollama", "label": "URL do Ollama",
"placeholder": "Insira a URL do Ollama" "placeholder": "Insira a URL do Ollama"
}, },
"ragSettings": {
"label": "Configurações do RAG",
"model": {
"label": "Modelo de Incorporação",
"required": "Por favor, selecione um modelo",
"help": "É altamente recomendável usar modelos de incorporação como `nomic-embed-text`.",
"placeholder": "Selecione um modelo"
},
"chunkSize": {
"label": "Tamanho do Chunk",
"placeholder": "Insira o tamanho do chunk",
"required": "Por favor, insira o tamanho do chunk"
},
"chunkOverlap": {
"label": "Sobreposição do Chunk",
"placeholder": "Insira a sobreposição do chunk",
"required": "Por favor, insira a sobreposição do chunk"
}
},
"prompt": {
"label": "Configurar Prompt do RAG",
"option1": "Normal",
"option2": "Web",
"alert": "Configurar o prompt do sistema aqui está depreciado. Por favor, use a seção Gerenciar Prompts para adicionar ou editar prompts. Esta seção será removida em uma versão futura",
"systemPrompt": "Prompt do Sistema",
"systemPromptPlaceholder": "Insira o prompt do sistema",
"webSearchPrompt": "Prompt de Pesquisa na Web",
"webSearchPromptHelp": "Não remova `{search_results}` do prompt.",
"webSearchPromptError": "Por favor, insira um prompt de pesquisa na web",
"webSearchPromptPlaceholder": "Insira o prompt de pesquisa na web",
"webSearchFollowUpPrompt": "Prompt de Seguimento de Pesquisa na Web",
"webSearchFollowUpPromptHelp": "Não remova `{chat_history}` e `{question}` do prompt.",
"webSearchFollowUpPromptError": "Por favor, insira o prompt de seguimento de pesquisa na web",
"webSearchFollowUpPromptPlaceholder": "Seu prompt de seguimento de pesquisa na web"
},
"advanced": { "advanced": {
"label": "Configuração Avançada da URL do Ollama", "label": "Configuração Avançada da URL do Ollama",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -282,5 +247,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "Gerenciar Conhecimento", "title": "Gerenciar Conhecimento",
"heading": "Configurar Base de Conhecimento" "heading": "Configurar Base de Conhecimento"
},
"rag": {
"title": "Configurações do RAG",
"ragSettings": {
"label": "Configurações do RAG",
"model": {
"label": "Modelo de Incorporação",
"required": "Por favor, selecione um modelo",
"help": "É altamente recomendável usar modelos de incorporação como `nomic-embed-text`.",
"placeholder": "Selecione um modelo"
},
"chunkSize": {
"label": "Tamanho do Chunk",
"placeholder": "Insira o tamanho do chunk",
"required": "Por favor, insira o tamanho do chunk"
},
"chunkOverlap": {
"label": "Sobreposição do Chunk",
"placeholder": "Insira a sobreposição do chunk",
"required": "Por favor, insira a sobreposição do chunk"
}
},
"prompt": {
"label": "Configurar Prompt do RAG",
"option1": "Normal",
"option2": "Web",
"alert": "Configurar o prompt do sistema aqui está depreciado. Por favor, use a seção Gerenciar Prompts para adicionar ou editar prompts. Esta seção será removida em uma versão futura",
"systemPrompt": "Prompt do Sistema",
"systemPromptPlaceholder": "Insira o prompt do sistema",
"webSearchPrompt": "Prompt de Pesquisa na Web",
"webSearchPromptHelp": "Não remova `{search_results}` do prompt.",
"webSearchPromptError": "Por favor, insira um prompt de pesquisa na web",
"webSearchPromptPlaceholder": "Insira o prompt de pesquisa na web",
"webSearchFollowUpPrompt": "Prompt de Seguimento de Pesquisa na Web",
"webSearchFollowUpPromptHelp": "Não remova `{chat_history}` e `{question}` do prompt.",
"webSearchFollowUpPromptError": "Por favor, insira o prompt de seguimento de pesquisa na web",
"webSearchFollowUpPromptPlaceholder": "Seu prompt de seguimento de pesquisa na web"
}
} }
} }

View File

@ -217,41 +217,7 @@
"label": "URL Ollama", "label": "URL Ollama",
"placeholder": "Введите URL Ollama" "placeholder": "Введите URL Ollama"
}, },
"ragSettings": {
"label": "Настройки RAG",
"model": {
"label": "Модель вложения",
"required": "Пожалуйста, выберите модель",
"help": "Настоятельно рекомендуется использовать модели вложения, например, `nomic-embed-text`.",
"placeholder": "Выберите модель"
},
"chunkSize": {
"label": "Размер фрагмента",
"placeholder": "Введите размер фрагмента",
"required": "Пожалуйста, введите размер фрагмента"
},
"chunkOverlap": {
"label": "Перекрытие фрагментов",
"placeholder": "Введите перекрытие фрагментов",
"required": "Пожалуйста, введите перекрытие фрагментов"
}
},
"prompt": {
"label": "Настройка системной подсказки RAG",
"option1": "Обычная",
"option2": "Веб",
"alert": "Настройка системной подсказки здесь устарела. Используйте раздел Управление подсказками для добавления или редактирования подсказок. Этот раздел будет удален в будущем выпуске",
"systemPrompt": "Системная подсказка",
"systemPromptPlaceholder": "Введите системную подсказку",
"webSearchPrompt": "Подсказка для веб-поиска",
"webSearchPromptHelp": "Не удаляйте `{search_results}` из подсказки.",
"webSearchPromptError": "Пожалуйста, введите подсказку для веб-поиска",
"webSearchPromptPlaceholder": "Введите подсказку для веб-поиска",
"webSearchFollowUpPrompt": "Последующая подсказка для веб-поиска",
"webSearchFollowUpPromptHelp": "Не удаляйте `{chat_history}` и `{question}` из подсказки.",
"webSearchFollowUpPromptError": "Введите подсказку для последующего веб-поиска!",
"webSearchFollowUpPromptPlaceholder": "Ваша подсказка для последующего веб-поиска"
},
"advanced": { "advanced": {
"label": "Расширенная конфигурация URL Ollama", "label": "Расширенная конфигурация URL Ollama",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -282,5 +248,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "Управление знаниями", "title": "Управление знаниями",
"heading": "Настройка базы знаний" "heading": "Настройка базы знаний"
},
"rag": {
"title": "Настройки RAG",
"ragSettings": {
"label": "Настройки RAG",
"model": {
"label": "Модель вложения",
"required": "Пожалуйста, выберите модель",
"help": "Настоятельно рекомендуется использовать модели вложения, например, `nomic-embed-text`.",
"placeholder": "Выберите модель"
},
"chunkSize": {
"label": "Размер фрагмента",
"placeholder": "Введите размер фрагмента",
"required": "Пожалуйста, введите размер фрагмента"
},
"chunkOverlap": {
"label": "Перекрытие фрагментов",
"placeholder": "Введите перекрытие фрагментов",
"required": "Пожалуйста, введите перекрытие фрагментов"
}
},
"prompt": {
"label": "Настройка системной подсказки RAG",
"option1": "Обычная",
"option2": "Веб",
"alert": "Настройка системной подсказки здесь устарела. Используйте раздел Управление подсказками для добавления или редактирования подсказок. Этот раздел будет удален в будущем выпуске",
"systemPrompt": "Системная подсказка",
"systemPromptPlaceholder": "Введите системную подсказку",
"webSearchPrompt": "Подсказка для веб-поиска",
"webSearchPromptHelp": "Не удаляйте `{search_results}` из подсказки.",
"webSearchPromptError": "Пожалуйста, введите подсказку для веб-поиска",
"webSearchPromptPlaceholder": "Введите подсказку для веб-поиска",
"webSearchFollowUpPrompt": "Последующая подсказка для веб-поиска",
"webSearchFollowUpPromptHelp": "Не удаляйте `{chat_history}` и `{question}` из подсказки.",
"webSearchFollowUpPromptError": "Введите подсказку для последующего веб-поиска!",
"webSearchFollowUpPromptPlaceholder": "Ваша подсказка для последующего веб-поиска"
}
} }
} }

View File

@ -221,41 +221,7 @@
"label": "Ollama URL", "label": "Ollama URL",
"placeholder": "输入 Ollama URL" "placeholder": "输入 Ollama URL"
}, },
"ragSettings": {
"label": "RAG 设置",
"model": {
"label": "文本嵌入模型",
"required": "请选择一个模型",
"help": "建议使用文本嵌入模型,如 `nomic-embed-text`。",
"placeholder": "选择一个模型"
},
"chunkSize": {
"label": "嵌入大小",
"placeholder": "1024-∞",
"required": "请输入块大小"
},
"chunkOverlap": {
"label": "嵌入重叠",
"placeholder": "256-∞",
"required": "请输入嵌入重叠"
}
},
"prompt": {
"label": "配置 RAG 提示词",
"option1": "普通",
"option2": "搜索",
"alert": "在此配置系统提示词已过时。请使用管理提示词部分添加或编辑提示词。此部分将在未来版本中删除",
"systemPrompt": "系统提示词",
"systemPromptPlaceholder": "输入系统提示词",
"webSearchPrompt": "网页搜索提示词",
"webSearchPromptHelp": "请勿从提示词中删除 `{search_results}`。",
"webSearchPromptError": "请输入一个网页搜索提示词",
"webSearchPromptPlaceholder": "输入网页搜索提示词",
"webSearchFollowUpPrompt": "网页搜索追问提示词",
"webSearchFollowUpPromptHelp": "请勿从提示词中删除 `{chat_history}` 和 `{question}`。",
"webSearchFollowUpPromptError": "请输入您的网页搜索追问提示词!",
"webSearchFollowUpPromptPlaceholder": "您的网页搜索追问提示词"
},
"advanced": { "advanced": {
"label": "Ollama URL 高级配置", "label": "Ollama URL 高级配置",
"urlRewriteEnabled": { "urlRewriteEnabled": {
@ -286,5 +252,43 @@
"manageKnowledge": { "manageKnowledge": {
"title": "管理知识", "title": "管理知识",
"heading": "配置知识库" "heading": "配置知识库"
},
"rag": {
"title": "RAG 设置",
"ragSettings": {
"label": "RAG 设置",
"model": {
"label": "文本嵌入模型",
"required": "请选择一个模型",
"help": "建议使用文本嵌入模型,如 `nomic-embed-text`。",
"placeholder": "选择一个模型"
},
"chunkSize": {
"label": "嵌入大小",
"placeholder": "1024-∞",
"required": "请输入块大小"
},
"chunkOverlap": {
"label": "嵌入重叠",
"placeholder": "256-∞",
"required": "请输入嵌入重叠"
}
},
"prompt": {
"label": "配置 RAG 提示词",
"option1": "普通",
"option2": "搜索",
"alert": "在此配置系统提示词已过时。请使用管理提示词部分添加或编辑提示词。此部分将在未来版本中删除",
"systemPrompt": "系统提示词",
"systemPromptPlaceholder": "输入系统提示词",
"webSearchPrompt": "网页搜索提示词",
"webSearchPromptHelp": "请勿从提示词中删除 `{search_results}`。",
"webSearchPromptError": "请输入一个网页搜索提示词",
"webSearchPromptPlaceholder": "输入网页搜索提示词",
"webSearchFollowUpPrompt": "网页搜索追问提示词",
"webSearchFollowUpPromptHelp": "请勿从提示词中删除 `{chat_history}` 和 `{question}`。",
"webSearchFollowUpPromptError": "请输入您的网页搜索追问提示词!",
"webSearchFollowUpPromptPlaceholder": "您的网页搜索追问提示词"
}
} }
} }

View File

@ -17,7 +17,7 @@ export const AdvanceOllamaSettings = () => {
return ( return (
<div className="space-y-4"> <div className="space-y-4">
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("ollamaSettings.settings.advanced.urlRewriteEnabled.label")} {t("ollamaSettings.settings.advanced.urlRewriteEnabled.label")}
</span> </span>
<div> <div>
@ -29,7 +29,7 @@ export const AdvanceOllamaSettings = () => {
</div> </div>
</div> </div>
<div className="flex flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 mb-3"> <span className="text-gray-700 dark:text-neutral-50 mb-3">
{t("ollamaSettings.settings.advanced.rewriteUrl.label")} {t("ollamaSettings.settings.advanced.rewriteUrl.label")}
</span> </span>
<div> <div>

View File

@ -90,7 +90,7 @@ export const Header: React.FC<Props> = ({
<NavLink <NavLink
to="/" to="/"
className="text-gray-500 items-center dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors"> className="text-gray-500 items-center dark:text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors">
<ChevronLeft className="w-4 h-4" /> <ChevronLeft className="w-8 h-8" />
</NavLink> </NavLink>
</div> </div>
)} )}

View File

@ -1,10 +1,11 @@
import { import {
Book, BookIcon,
BrainCircuit, BrainCircuitIcon,
Orbit, OrbitIcon,
Share, ShareIcon,
BlocksIcon, BlocksIcon,
InfoIcon InfoIcon,
CombineIcon,
} from "lucide-react" } from "lucide-react"
import { useTranslation } from "react-i18next" import { useTranslation } from "react-i18next"
import { Link, useLocation } from "react-router-dom" import { Link, useLocation } from "react-router-dom"
@ -35,7 +36,7 @@ const LinkComponent = (item: {
className={classNames( className={classNames(
item.current === item.href item.current === item.href
? "text-gray-600 dark:text-white" ? "text-gray-600 dark:text-white"
: "text-gray-400 group-hover:text-gray-600 dark:text-gray-200 dark:group-hover:text-white", : "text-gray-500 group-hover:text-gray-600 dark:text-gray-200 dark:group-hover:text-white",
"h-6 w-6 shrink-0" "h-6 w-6 shrink-0"
)} )}
aria-hidden="true" aria-hidden="true"
@ -61,7 +62,13 @@ export const SettingsLayout = ({ children }: { children: React.ReactNode }) => {
<LinkComponent <LinkComponent
href="/settings" href="/settings"
name={t("generalSettings.title")} name={t("generalSettings.title")}
icon={Orbit} icon={OrbitIcon}
current={location.pathname}
/>
<LinkComponent
href="/settings/rag"
name={t("rag.title")}
icon={CombineIcon}
current={location.pathname} current={location.pathname}
/> />
<LinkComponent <LinkComponent
@ -74,7 +81,7 @@ export const SettingsLayout = ({ children }: { children: React.ReactNode }) => {
href="/settings/model" href="/settings/model"
name={t("manageModels.title")} name={t("manageModels.title")}
current={location.pathname} current={location.pathname}
icon={BrainCircuit} icon={BrainCircuitIcon}
/> />
<LinkComponent <LinkComponent
href="/settings/knowledge" href="/settings/knowledge"
@ -89,13 +96,13 @@ export const SettingsLayout = ({ children }: { children: React.ReactNode }) => {
<LinkComponent <LinkComponent
href="/settings/prompt" href="/settings/prompt"
name={t("managePrompts.title")} name={t("managePrompts.title")}
icon={Book} icon={BookIcon}
current={location.pathname} current={location.pathname}
/> />
<LinkComponent <LinkComponent
href="/settings/share" href="/settings/share"
name={t("manageShare.title")} name={t("manageShare.title")}
icon={Share} icon={ShareIcon}
current={location.pathname} current={location.pathname}
/> />
<LinkComponent <LinkComponent

View File

@ -155,7 +155,7 @@ export const ModelsBody = () => {
pullOllamaModel(record.model) pullOllamaModel(record.model)
} }
}} }}
className="text-gray-500 dark:text-gray-400"> className="text-gray-700 dark:text-gray-400">
<RotateCcw className="w-5 h-5" /> <RotateCcw className="w-5 h-5" />
</button> </button>
</Tooltip> </Tooltip>

View File

@ -1,7 +1,7 @@
import { Tabs } from "antd" import { Tabs } from "antd"
import { SettingsOllama } from "./Settings/ollama" import { SettingsOllama } from "./Settings/ollama"
import { SettingPrompt } from "./Settings/prompt" import { SettingPrompt } from "./Settings/prompt"
import { SettingOther } from "./Settings/other" import { SettingOther } from "./Settings/general-settings"
type Props = { type Props = {
setClose: (close: boolean) => void setClose: (close: boolean) => void

View File

@ -60,7 +60,7 @@ export const AboutApp = () => {
]} ]}
/> />
<div> <div>
<p className="text-sm text-gray-500 dark:text-gray-400 mb-4"> <p className="text-sm text-gray-700 dark:text-gray-400 mb-4">
{t("about.support")} {t("about.support")}
</p> </p>

View File

@ -16,7 +16,7 @@ import {
import { BetaTag } from "@/components/Common/Beta" import { BetaTag } from "@/components/Common/Beta"
import { useStorage } from "@plasmohq/storage/hook" import { useStorage } from "@plasmohq/storage/hook"
export const SettingOther = () => { export const GeneralSettings = () => {
const { clearChat, speechToTextLanguage, setSpeechToTextLanguage } = const { clearChat, speechToTextLanguage, setSpeechToTextLanguage } =
useMessageOption() useMessageOption()
@ -43,7 +43,7 @@ export const SettingOther = () => {
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3"></div> <div className="border border-b border-gray-200 dark:border-gray-600 mt-3"></div>
</div> </div>
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<span className="text-gray-500 dark:text-neutral-50"> <span className="text-gray-700 dark:text-neutral-50">
{t("generalSettings.settings.speechRecognitionLang.label")} {t("generalSettings.settings.speechRecognitionLang.label")}
</span> </span>
@ -65,7 +65,7 @@ export const SettingOther = () => {
/> />
</div> </div>
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<span className="text-gray-500 dark:text-neutral-50"> <span className="text-gray-700 dark:text-neutral-50">
{t("generalSettings.settings.language.label")} {t("generalSettings.settings.language.label")}
</span> </span>
@ -88,7 +88,7 @@ export const SettingOther = () => {
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<div className="inline-flex items-center gap-2"> <div className="inline-flex items-center gap-2">
<BetaTag /> <BetaTag />
<span className="text-gray-500 dark:text-neutral-50"> <span className="text-gray-700 dark:text-neutral-50">
{t("generalSettings.settings.copilotResumeLastChat.label")} {t("generalSettings.settings.copilotResumeLastChat.label")}
</span> </span>
</div> </div>
@ -100,7 +100,7 @@ export const SettingOther = () => {
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<div className="inline-flex items-center gap-2"> <div className="inline-flex items-center gap-2">
<BetaTag /> <BetaTag />
<span className="text-gray-500 dark:text-neutral-50"> <span className="text-gray-700 dark:text-neutral-50">
{t("generalSettings.settings.hideCurrentChatModelSettings.label")} {t("generalSettings.settings.hideCurrentChatModelSettings.label")}
</span> </span>
</div> </div>
@ -111,7 +111,7 @@ export const SettingOther = () => {
/> />
</div> </div>
<div className="flex flex-row justify-between"> <div className="flex flex-row justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.settings.darkMode.label")} {t("generalSettings.settings.darkMode.label")}
</span> </span>
@ -138,7 +138,7 @@ export const SettingOther = () => {
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3"></div> <div className="border border-b border-gray-200 dark:border-gray-600 mt-3"></div>
</div> </div>
<div className="flex flex-row mb-3 justify-between"> <div className="flex flex-row mb-3 justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.system.deleteChatHistory.label")} {t("generalSettings.system.deleteChatHistory.label")}
</span> </span>
@ -162,7 +162,7 @@ export const SettingOther = () => {
</button> </button>
</div> </div>
<div className="flex flex-row mb-3 justify-between"> <div className="flex flex-row mb-3 justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.system.export.label")} {t("generalSettings.system.export.label")}
</span> </span>
<button <button
@ -172,7 +172,7 @@ export const SettingOther = () => {
</button> </button>
</div> </div>
<div className="flex flex-row mb-3 justify-between"> <div className="flex flex-row mb-3 justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.system.import.label")} {t("generalSettings.system.import.label")}
</span> </span>
<label <label

View File

@ -29,7 +29,7 @@ export const ModelSettings = () => {
{t("modelSettings.label")} {t("modelSettings.label")}
</h2> </h2>
</div> </div>
<p className="text-sm text-gray-500 dark:text-neutral-400 mt-1"> <p className="text-sm text-gray-700 dark:text-neutral-400 mt-1">
{t("modelSettings.description")} {t("modelSettings.description")}
</p> </p>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div> <div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div>

View File

@ -1,19 +1,9 @@
import { useMutation, useQuery } from "@tanstack/react-query" import { useQuery } from "@tanstack/react-query"
import { Collapse, Form, InputNumber, Select, Skeleton } from "antd" import { Collapse, Skeleton } from "antd"
import { useState } from "react" import { useState } from "react"
import { SaveButton } from "~/components/Common/SaveButton" import { SaveButton } from "~/components/Common/SaveButton"
import { import { getOllamaURL, setOllamaURL as saveOllamaURL } from "~/services/ollama"
defaultEmbeddingChunkOverlap,
defaultEmbeddingChunkSize,
defaultEmbeddingModelForRag,
getAllModels,
getOllamaURL,
saveForRag,
setOllamaURL as saveOllamaURL
} from "~/services/ollama"
import { SettingPrompt } from "./prompt"
import { Trans, useTranslation } from "react-i18next" import { Trans, useTranslation } from "react-i18next"
import { useStorage } from "@plasmohq/storage/hook"
import { AdvanceOllamaSettings } from "@/components/Common/Settings/AdvanceOllamaSettings" import { AdvanceOllamaSettings } from "@/components/Common/Settings/AdvanceOllamaSettings"
import { ModelSettings } from "./model-settings" import { ModelSettings } from "./model-settings"
@ -22,34 +12,12 @@ export const SettingsOllama = () => {
const { t } = useTranslation("settings") const { t } = useTranslation("settings")
const { data: ollamaInfo, status } = useQuery({ const { status } = useQuery({
queryKey: ["fetchOllamURL"], queryKey: ["fetchOllamURL"],
queryFn: async () => { queryFn: async () => {
const [ollamaURL, allModels, chunkOverlap, chunkSize, defaultEM] = const [ollamaURL] = await Promise.all([getOllamaURL()])
await Promise.all([
getOllamaURL(),
getAllModels({ returnEmpty: true }),
defaultEmbeddingChunkOverlap(),
defaultEmbeddingChunkSize(),
defaultEmbeddingModelForRag()
])
setOllamaURL(ollamaURL) setOllamaURL(ollamaURL)
return { return {}
models: allModels,
chunkOverlap,
chunkSize,
defaultEM
}
}
})
const { mutate: saveRAG, isPending: isSaveRAGPending } = useMutation({
mutationFn: async (data: {
model: string
chunkSize: number
overlap: number
}) => {
await saveForRag(data.model, data.chunkSize, data.overlap)
} }
}) })
@ -92,7 +60,7 @@ export const SettingsOllama = () => {
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white"> <h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("ollamaSettings.settings.advanced.label")} {t("ollamaSettings.settings.advanced.label")}
</h2> </h2>
<p className="text-xs text-gray-500 dark:text-gray-400 mb-4"> <p className="text-xs text-gray-700 dark:text-gray-400 mb-4">
<Trans <Trans
i18nKey="settings:ollamaSettings.settings.advanced.help" i18nKey="settings:ollamaSettings.settings.advanced.help"
components={{ components={{
@ -122,117 +90,7 @@ export const SettingsOllama = () => {
</div> </div>
</div> </div>
<div>
<div>
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("ollamaSettings.settings.ragSettings.label")}
</h2>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div>
</div>
<Form
layout="vertical"
onFinish={(data) => {
saveRAG({
model: data.defaultEM,
chunkSize: data.chunkSize,
overlap: data.chunkOverlap
})
}}
initialValues={{
chunkSize: ollamaInfo?.chunkSize,
chunkOverlap: ollamaInfo?.chunkOverlap,
defaultEM: ollamaInfo?.defaultEM
}}>
<Form.Item
name="defaultEM"
label={t("ollamaSettings.settings.ragSettings.model.label")}
help={t("ollamaSettings.settings.ragSettings.model.help")}
rules={[
{
required: true,
message: t(
"ollamaSettings.settings.ragSettings.model.required"
)
}
]}>
<Select
size="large"
filterOption={(input, option) =>
option!.label.toLowerCase().indexOf(input.toLowerCase()) >=
0 ||
option!.value.toLowerCase().indexOf(input.toLowerCase()) >=
0
}
showSearch
placeholder={t(
"ollamaSettings.settings.ragSettings.model.placeholder"
)}
style={{ width: "100%" }}
className="mt-4"
options={ollamaInfo.models?.map((model) => ({
label: model.name,
value: model.model
}))}
/>
</Form.Item>
<Form.Item
name="chunkSize"
label={t("ollamaSettings.settings.ragSettings.chunkSize.label")}
rules={[
{
required: true,
message: t(
"ollamaSettings.settings.ragSettings.chunkSize.required"
)
}
]}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"ollamaSettings.settings.ragSettings.chunkSize.placeholder"
)}
/>
</Form.Item>
<Form.Item
name="chunkOverlap"
label={t(
"ollamaSettings.settings.ragSettings.chunkOverlap.label"
)}
rules={[
{
required: true,
message: t(
"ollamaSettings.settings.ragSettings.chunkOverlap.required"
)
}
]}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"ollamaSettings.settings.ragSettings.chunkOverlap.placeholder"
)}
/>
</Form.Item>
<div className="flex justify-end">
<SaveButton disabled={isSaveRAGPending} btnType="submit" />
</div>
</Form>
</div>
<ModelSettings /> <ModelSettings />
<div>
<div>
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("ollamaSettings.settings.prompt.label")}
</h2>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div>
</div>
<SettingPrompt />
</div>
</div> </div>
)} )}
</div> </div>

View File

@ -19,7 +19,7 @@ export const SettingPrompt = () => {
const queryClient = useQueryClient() const queryClient = useQueryClient()
const { status, data } = useQuery({ const { status, data } = useQuery({
queryKey: ["fetchOllaPrompt"], queryKey: ["fetchRagPrompt"],
queryFn: async () => { queryFn: async () => {
const [prompt, webSearchPrompt, webSearchFollowUpPrompt] = const [prompt, webSearchPrompt, webSearchFollowUpPrompt] =
await Promise.all([ await Promise.all([
@ -47,9 +47,7 @@ export const SettingPrompt = () => {
defaultValue={selectedValue} defaultValue={selectedValue}
onChange={(e) => setSelectedValue(e.target.value)}> onChange={(e) => setSelectedValue(e.target.value)}>
<Radio.Button value="rag">RAG</Radio.Button> <Radio.Button value="rag">RAG</Radio.Button>
<Radio.Button value="web"> <Radio.Button value="web">{t("rag.prompt.option2")}</Radio.Button>
{t("ollamaSettings.settings.prompt.option2")}
</Radio.Button>
</Radio.Group> </Radio.Group>
</div> </div>
@ -63,7 +61,7 @@ export const SettingPrompt = () => {
values?.questionPrompt || "" values?.questionPrompt || ""
) )
queryClient.invalidateQueries({ queryClient.invalidateQueries({
queryKey: ["fetchOllaPrompt"] queryKey: ["fetchRagPrompt"]
}) })
}} }}
initialValues={{ initialValues={{
@ -98,7 +96,7 @@ export const SettingPrompt = () => {
value={data.webSearchFollowUpPrompt} value={data.webSearchFollowUpPrompt}
rows={5} rows={5}
placeholder={t( placeholder={t(
"ollamaSettings.settings.prompt.webSearchFollowUpPromptPlaceholder" "rag.prompt.webSearchFollowUpPromptPlaceholder"
)} )}
/> />
</Form.Item> </Form.Item>
@ -119,7 +117,7 @@ export const SettingPrompt = () => {
values?.webSearchFollowUpPrompt || "" values?.webSearchFollowUpPrompt || ""
) )
queryClient.invalidateQueries({ queryClient.invalidateQueries({
queryKey: ["fetchOllaPrompt"] queryKey: ["fetchRagPrompt"]
}) })
}} }}
initialValues={{ initialValues={{
@ -127,46 +125,36 @@ export const SettingPrompt = () => {
webSearchFollowUpPrompt: data.webSearchFollowUpPrompt webSearchFollowUpPrompt: data.webSearchFollowUpPrompt
}}> }}>
<Form.Item <Form.Item
label={t("ollamaSettings.settings.prompt.webSearchPrompt")} label={t("rag.prompt.webSearchPrompt")}
name="webSearchPrompt" name="webSearchPrompt"
help={t("ollamaSettings.settings.prompt.webSearchPromptHelp")} help={t("rag.prompt.webSearchPromptHelp")}
rules={[ rules={[
{ {
required: true, required: true,
message: t( message: t("rag.prompt.webSearchPromptError")
"ollamaSettings.settings.prompt.webSearchPromptError"
)
} }
]}> ]}>
<Input.TextArea <Input.TextArea
value={data.webSearchPrompt} value={data.webSearchPrompt}
rows={5} rows={5}
placeholder={t( placeholder={t("rag.prompt.webSearchPromptPlaceholder")}
"ollamaSettings.settings.prompt.webSearchPromptPlaceholder"
)}
/> />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label={t( label={t("rag.prompt.webSearchFollowUpPrompt")}
"ollamaSettings.settings.prompt.webSearchFollowUpPrompt"
)}
name="webSearchFollowUpPrompt" name="webSearchFollowUpPrompt"
help={t( help={t("rag.prompt.webSearchFollowUpPromptHelp")}
"ollamaSettings.settings.prompt.webSearchFollowUpPromptHelp"
)}
rules={[ rules={[
{ {
required: true, required: true,
message: t( message: t("rag.prompt.webSearchFollowUpPromptError")
"ollamaSettings.settings.prompt.webSearchFollowUpPromptError"
)
} }
]}> ]}>
<Input.TextArea <Input.TextArea
value={data.webSearchFollowUpPrompt} value={data.webSearchFollowUpPrompt}
rows={5} rows={5}
placeholder={t( placeholder={t(
"ollamaSettings.settings.prompt.webSearchFollowUpPromptPlaceholder" "rag.prompt.webSearchFollowUpPromptPlaceholder"
)} )}
/> />
</Form.Item> </Form.Item>

View File

@ -0,0 +1,172 @@
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"
import { Form, InputNumber, Select, Skeleton } from "antd"
import { SaveButton } from "~/components/Common/SaveButton"
import {
defaultEmbeddingChunkOverlap,
defaultEmbeddingChunkSize,
defaultEmbeddingModelForRag,
getAllModels,
saveForRag
} from "~/services/ollama"
import { SettingPrompt } from "./prompt"
import { useTranslation } from "react-i18next"
export const RagSettings = () => {
const { t } = useTranslation("settings")
const queryClient = useQueryClient()
const { data: ollamaInfo, status } = useQuery({
queryKey: ["fetchRAGSettings"],
queryFn: async () => {
const [allModels, chunkOverlap, chunkSize, defaultEM] = await Promise.all(
[
getAllModels({ returnEmpty: true }),
defaultEmbeddingChunkOverlap(),
defaultEmbeddingChunkSize(),
defaultEmbeddingModelForRag()
]
)
return {
models: allModels,
chunkOverlap,
chunkSize,
defaultEM
}
}
})
const { mutate: saveRAG, isPending: isSaveRAGPending } = useMutation({
mutationFn: async (data: {
model: string
chunkSize: number
overlap: number
}) => {
await saveForRag(data.model, data.chunkSize, data.overlap)
return true
},
onSuccess: () => {
queryClient.invalidateQueries({
queryKey: ["fetchRAGSettings"]
})
}
})
return (
<div className="flex flex-col space-y-3">
{status === "pending" && <Skeleton paragraph={{ rows: 4 }} active />}
{status === "success" && (
<div className="flex flex-col space-y-6">
<div>
<div>
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("rag.ragSettings.label")}
</h2>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div>
</div>
<Form
layout="vertical"
onFinish={(data) => {
saveRAG({
model: data.defaultEM,
chunkSize: data.chunkSize,
overlap: data.chunkOverlap
})
}}
initialValues={{
chunkSize: ollamaInfo?.chunkSize,
chunkOverlap: ollamaInfo?.chunkOverlap,
defaultEM: ollamaInfo?.defaultEM
}}>
<Form.Item
name="defaultEM"
label={t("rag.ragSettings.model.label")}
help={t("rag.ragSettings.model.help")}
rules={[
{
required: true,
message: t(
"rag.ragSettings.model.required"
)
}
]}>
<Select
size="large"
filterOption={(input, option) =>
option!.label.toLowerCase().indexOf(input.toLowerCase()) >=
0 ||
option!.value.toLowerCase().indexOf(input.toLowerCase()) >=
0
}
showSearch
placeholder={t(
"rag.ragSettings.model.placeholder"
)}
style={{ width: "100%" }}
className="mt-4"
options={ollamaInfo.models?.map((model) => ({
label: model.name,
value: model.model
}))}
/>
</Form.Item>
<Form.Item
name="chunkSize"
label={t("rag.ragSettings.chunkSize.label")}
rules={[
{
required: true,
message: t(
"rag.ragSettings.chunkSize.required"
)
}
]}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"rag.ragSettings.chunkSize.placeholder"
)}
/>
</Form.Item>
<Form.Item
name="chunkOverlap"
label={t(
"rag.ragSettings.chunkOverlap.label"
)}
rules={[
{
required: true,
message: t(
"rag.ragSettings.chunkOverlap.required"
)
}
]}>
<InputNumber
style={{ width: "100%" }}
placeholder={t(
"rag.ragSettings.chunkOverlap.placeholder"
)}
/>
</Form.Item>
<div className="flex justify-end">
<SaveButton disabled={isSaveRAGPending} btnType="submit" />
</div>
</Form>
</div>
<div>
<div>
<h2 className="text-base font-semibold leading-7 text-gray-900 dark:text-white">
{t("rag.prompt.label")}
</h2>
<div className="border border-b border-gray-200 dark:border-gray-600 mt-3 mb-6"></div>
</div>
<SettingPrompt />
</div>
</div>
)}
</div>
)
}

View File

@ -44,7 +44,7 @@ export const SearchModeSettings = () => {
})} })}
className="space-y-4"> className="space-y-4">
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.webSearch.provider.label")} {t("generalSettings.webSearch.provider.label")}
</span> </span>
<div> <div>
@ -62,7 +62,7 @@ export const SearchModeSettings = () => {
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.webSearch.searchMode.label")} {t("generalSettings.webSearch.searchMode.label")}
</span> </span>
<div> <div>
@ -75,7 +75,7 @@ export const SearchModeSettings = () => {
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.webSearch.totalSearchResults.label")} {t("generalSettings.webSearch.totalSearchResults.label")}
</span> </span>
<div> <div>

View File

@ -49,7 +49,7 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
})} })}
className="space-y-4"> className="space-y-4">
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.ttsEnabled.label")} {t("generalSettings.tts.ttsEnabled.label")}
</span> </span>
<div> <div>
@ -62,7 +62,7 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.ttsProvider.label")} {t("generalSettings.tts.ttsProvider.label")}
</span> </span>
<div> <div>
@ -75,7 +75,7 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.ttsVoice.label")} {t("generalSettings.tts.ttsVoice.label")}
</span> </span>
<div> <div>
@ -94,7 +94,7 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
</div> </div>
</div> </div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between"> <div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-500 dark:text-neutral-50 "> <span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.ssmlEnabled.label")} {t("generalSettings.tts.ssmlEnabled.label")}
</span> </span>
<div> <div>

View File

@ -146,7 +146,7 @@ export const OptionShareBody = () => {
<label className="text-sm font-semibold leading-5 text-gray-900 dark:text-white"> <label className="text-sm font-semibold leading-5 text-gray-900 dark:text-white">
{t("manageShare.webshare.label")} {t("manageShare.webshare.label")}
</label> </label>
<p className="text-sm font-normal leading-5 text-gray-500 dark:text-gray-400"> <p className="text-sm font-normal leading-5 text-gray-700 dark:text-gray-400">
{t("manageShare.webshare.description")} {t("manageShare.webshare.description")}
</p> </p>
</div> </div>

View File

@ -94,7 +94,7 @@ export const EmptySidePanel = () => {
</button> </button>
{ollamaURL && {ollamaURL &&
cleanUrl(ollamaURL) !== "http://127.0.0.1:11434" && ( cleanUrl(ollamaURL) !== "http://127.0.0.1:11434" && (
<p className="text-xs text-gray-500 dark:text-gray-400 mb-4 text-center"> <p className="text-xs text-gray-700 dark:text-gray-400 mb-4 text-center">
<Trans <Trans
i18nKey="playground:ollamaState.connectionError" i18nKey="playground:ollamaState.connectionError"
components={{ components={{

View File

@ -17,7 +17,7 @@ export const supportLanguage = [
value: "ru" value: "ru"
}, },
{ {
label: "Português", label: "Português (Brasil)",
value: "pt-BR" value: "pt-BR"
}, },
{ {

View File

@ -9,6 +9,7 @@ import OptionKnowledgeBase from "./option-settings-knowledge"
import OptionAbout from "./option-settings-about" import OptionAbout from "./option-settings-about"
import SidepanelChat from "./sidepanel-chat" import SidepanelChat from "./sidepanel-chat"
import SidepanelSettings from "./sidepanel-settings" import SidepanelSettings from "./sidepanel-settings"
import OptionRagSettings from "./option-rag"
export const OptionRoutingChrome = () => { export const OptionRoutingChrome = () => {
return ( return (
@ -20,6 +21,7 @@ export const OptionRoutingChrome = () => {
<Route path="/settings/ollama" element={<OptionOllamaSettings />} /> <Route path="/settings/ollama" element={<OptionOllamaSettings />} />
<Route path="/settings/share" element={<OptionShare />} /> <Route path="/settings/share" element={<OptionShare />} />
<Route path="/settings/knowledge" element={<OptionKnowledgeBase />} /> <Route path="/settings/knowledge" element={<OptionKnowledgeBase />} />
<Route path="/settings/rag" element={<OptionRagSettings />} />
<Route path="/settings/about" element={<OptionAbout />} /> <Route path="/settings/about" element={<OptionAbout />} />
</Routes> </Routes>
) )

View File

@ -1,7 +1,7 @@
// this is a temp fix for firefox // this is a temp fix for firefox
// because chunks getting 4mb+ and it's not working on firefox addon store // because chunks getting 4mb+ and it's not working on firefox addon store
import { lazy } from "react" import { lazy } from "react"
import { Route , Routes} from "react-router-dom" import { Route, Routes } from "react-router-dom"
const SidepanelChat = lazy(() => import("./sidepanel-chat")) const SidepanelChat = lazy(() => import("./sidepanel-chat"))
const SidepanelSettings = lazy(() => import("./sidepanel-settings")) const SidepanelSettings = lazy(() => import("./sidepanel-settings"))
@ -13,6 +13,7 @@ const OptionSettings = lazy(() => import("./option-settings"))
const OptionShare = lazy(() => import("./option-settings-share")) const OptionShare = lazy(() => import("./option-settings-share"))
const OptionKnowledgeBase = lazy(() => import("./option-settings-knowledge")) const OptionKnowledgeBase = lazy(() => import("./option-settings-knowledge"))
const OptionAbout = lazy(() => import("./option-settings-about")) const OptionAbout = lazy(() => import("./option-settings-about"))
const OptionRagSettings = lazy(() => import("./option-rag"))
export const OptionRoutingFirefox = () => { export const OptionRoutingFirefox = () => {
return ( return (
@ -25,6 +26,7 @@ export const OptionRoutingFirefox = () => {
<Route path="/settings/share" element={<OptionShare />} /> <Route path="/settings/share" element={<OptionShare />} />
<Route path="/settings/knowledge" element={<OptionKnowledgeBase />} /> <Route path="/settings/knowledge" element={<OptionKnowledgeBase />} />
<Route path="/settings/about" element={<OptionAbout />} /> <Route path="/settings/about" element={<OptionAbout />} />
<Route path="/settings/rag" element={<OptionRagSettings />} />
</Routes> </Routes>
) )
} }

15
src/routes/option-rag.tsx Normal file
View File

@ -0,0 +1,15 @@
import { SettingsLayout } from "~/components/Layouts/SettingsOptionLayout"
import OptionLayout from "~/components/Layouts/Layout"
import { RagSettings } from "@/components/Option/Settings/rag"
const OptionRagSettings = () => {
return (
<OptionLayout>
<SettingsLayout>
<RagSettings />
</SettingsLayout>
</OptionLayout>
)
}
export default OptionRagSettings

View File

@ -1,12 +1,12 @@
import { SettingsLayout } from "~/components/Layouts/SettingsOptionLayout" import { SettingsLayout } from "~/components/Layouts/SettingsOptionLayout"
import OptionLayout from "~/components/Layouts/Layout" import OptionLayout from "~/components/Layouts/Layout"
import { SettingOther } from "~/components/Option/Settings/other" import { GeneralSettings } from "~/components/Option/Settings/general-settings"
const OptionSettings = () => { const OptionSettings = () => {
return ( return (
<OptionLayout> <OptionLayout>
<SettingsLayout> <SettingsLayout>
<SettingOther /> <GeneralSettings />
</SettingsLayout> </SettingsLayout>
</OptionLayout> </OptionLayout>
) )