setting view multi lang
This commit is contained in:
parent
65d4ca33d2
commit
b943009ade
@ -177,5 +177,177 @@ export default {
|
||||
},
|
||||
previewView: {
|
||||
close: 'Close',
|
||||
},
|
||||
settings: {
|
||||
// Models Section
|
||||
ApiProvider: {
|
||||
label: 'Api provider:',
|
||||
useCustomBaseUrl: 'Use custom base url',
|
||||
enterApiKey: 'Enter your api key',
|
||||
enterCustomUrl: 'Enter your custom api endpoint url',
|
||||
},
|
||||
Models: {
|
||||
chatModel: 'Chat model:',
|
||||
autocompleteModel: 'Autocomplete model:',
|
||||
embeddingModel: 'Embedding model:',
|
||||
},
|
||||
|
||||
// Model Parameters Section
|
||||
ModelParameters: {
|
||||
title: 'Model parameters',
|
||||
temperature: 'Temperature',
|
||||
temperatureDescription: 'This parameter affects randomness in the sampling. Lower values result in more repetitive and deterministic responses. Higher temperatures will result in more unexpected or creative responses. Default: 0.0, please don\'t change this if you don\'t know what you are doing.',
|
||||
topP: 'TopP',
|
||||
topPDescription: 'Like the temperature parameter, the Top P parameter affects the randomness in sampling. Lowering the value will limit the model\'s token selection to likelier tokens while increasing the value expands the model\'s token selection with lower likelihood tokens. Default: 1, please don\'t change this if you don\'t know what you are doing.',
|
||||
frequencyPenalty: 'Frequency penalty',
|
||||
frequencyPenaltyDescription: 'This parameter reduces the chance of repeating a token proportionally based on how often it has appeared in the text so far. This decreases the likelihood of repeating the exact same text in a response. Default: 0.25',
|
||||
presencePenalty: 'Presence penalty',
|
||||
presencePenaltyDescription: 'This parameter reduces the chance of repeating any token that has appeared in the text so far. This increases the likelihood of introducing new topics in a response. Default: 2',
|
||||
maxTokens: 'Max tokens',
|
||||
maxTokensDescription: 'This parameter changes the maximum number of tokens the model is allowed to generate. Default: 4096',
|
||||
},
|
||||
|
||||
// Files Search Section
|
||||
FilesSearch: {
|
||||
title: 'File search',
|
||||
method: 'Files search method',
|
||||
methodDescription: 'Choose the method to search for files.',
|
||||
auto: 'Auto',
|
||||
semantic: 'Semantic',
|
||||
regex: 'Regex',
|
||||
ripgrepPath: 'ripgrep path',
|
||||
ripgrepPathDescription: 'Path to the ripgrep binary. When using regex search, this is required.',
|
||||
},
|
||||
|
||||
// Chat Behavior Section
|
||||
ChatBehavior: {
|
||||
title: 'Chat behavior',
|
||||
defaultMention: 'Default mention for new chat',
|
||||
defaultMentionDescription: 'Choose the default file mention behavior when starting a new chat.',
|
||||
none: 'None',
|
||||
currentFile: 'Current File',
|
||||
vault: 'Vault',
|
||||
},
|
||||
|
||||
// Deep Research Section
|
||||
WebSearch: {
|
||||
title: 'Web search',
|
||||
serperApiKey: 'Serper API key',
|
||||
serperApiKeyDescription: 'API key for web search functionality. Serper allows the plugin to search the internet for information, similar to a search engine. Get your key from',
|
||||
searchEngine: 'Serper search engine',
|
||||
searchEngineDescription: 'Choose the search engine to use for web search.',
|
||||
google: 'Google',
|
||||
duckDuckGo: 'DuckDuckGo',
|
||||
bing: 'Bing',
|
||||
jinaApiKey: 'Jina API key (Optional)',
|
||||
jinaApiKeyDescription: 'API key for parsing web pages into markdown format. If not provided, local parsing will be used. Get your key from',
|
||||
},
|
||||
|
||||
// RAG Section
|
||||
RAG: {
|
||||
title: 'RAG',
|
||||
includePatterns: 'Include patterns',
|
||||
includePatternsDescription: 'If any patterns are specified, ONLY files matching at least one pattern will be included in indexing. One pattern per line. Uses glob patterns (e.g., "notes/*", "*.md"). Leave empty to include all files not excluded by exclude patterns. After changing this, use the command "Rebuild entire vault index" to apply changes.',
|
||||
testPatterns: 'Test patterns',
|
||||
excludePatterns: 'Exclude patterns',
|
||||
excludePatternsDescription: 'Files matching ANY of these patterns will be excluded from indexing. One pattern per line. Uses glob patterns (e.g., "private/*", "*.tmp"). Leave empty to exclude nothing. After changing this, use the command "Rebuild entire vault index" to apply changes.',
|
||||
chunkSize: 'Chunk size',
|
||||
chunkSizeDescription: 'Set the chunk size for text splitting. After changing this, please re-index the vault using the "Rebuild entire vault index" command.',
|
||||
thresholdTokens: 'Threshold tokens',
|
||||
thresholdTokensDescription: 'Maximum number of tokens before switching to RAG. If the total tokens from mentioned files exceed this, RAG will be used instead of including all file contents.',
|
||||
minSimilarity: 'Minimum similarity',
|
||||
minSimilarityDescription: 'Minimum similarity score for RAG results. Higher values return more relevant but potentially fewer results.',
|
||||
limit: 'Limit',
|
||||
limitDescription: 'Maximum number of RAG results to include in the prompt. Higher values provide more context but increase token usage.',
|
||||
includedFiles: 'Included Files',
|
||||
noInclusionPatterns: 'No inclusion patterns specified - all files will be included (except those matching exclusion patterns)',
|
||||
noMatchingFiles: 'No files match the inclusion patterns',
|
||||
excludedFiles: 'Excluded Files',
|
||||
noExcludedFiles: 'No files match the exclusion patterns',
|
||||
},
|
||||
|
||||
// AutoComplete Section
|
||||
AutoComplete: {
|
||||
// Basic AutoComplete Settings
|
||||
title: 'AutoComplete',
|
||||
enable: 'Enable',
|
||||
enableDescription: 'If disabled, nothing will trigger the extension or can result in an API call.',
|
||||
cacheCompletions: 'Cache completions',
|
||||
cacheCompletionsDescription: 'If disabled, the plugin will not cache the completions. After accepting or rejecting a completion, the plugin will not remember it. This might result in more API calls.',
|
||||
debugMode: 'Debug mode',
|
||||
debugModeDescription: 'If enabled, various debug messages will be logged to the console, such as the complete response from the API, including the chain of thought tokens.',
|
||||
|
||||
// Preprocessing Settings
|
||||
preprocessing: {
|
||||
title: 'Preprocessing',
|
||||
excludeDataview: 'Don\'t include Dataview',
|
||||
excludeDataviewDescription: 'Dataview(js) blocks can be quite long while not providing much value to the AI. If this setting is enabled, data view blocks will be removed promptly to reduce the number of tokens. This could save you some money in the long run.',
|
||||
maxPrefixLength: 'Maximum prefix length',
|
||||
maxPrefixLengthDescription: 'The maximum number of characters that will be included in the prefix. A larger value will increase the context for the completion, but it can also increase the cost or push you over the token limit.',
|
||||
maxSuffixLength: 'Maximum suffix length',
|
||||
maxSuffixLengthDescription: 'The maximum number of characters that will be included in the suffix. A larger value will increase the context for the completion, but it can also increase the cost or push you over the token limit.',
|
||||
chars: 'chars',
|
||||
},
|
||||
|
||||
// Postprocessing Settings
|
||||
postprocessing: {
|
||||
title: 'Postprocessing',
|
||||
removeMathBlockIndicators: 'Auto remove duplicate mat block indicators',
|
||||
removeMathBlockIndicatorsDescription: 'The AI model might eagerly add a math block indicator ($), even though the cursor is already inside a math block. If this setting is enabled, the plugin will automatically remove these duplicate indicators from the completion.',
|
||||
removeCodeBlockIndicators: 'Auto remove duplicate code block indicators',
|
||||
removeCodeBlockIndicatorsDescription: 'The AI model might eagerly add a code block indicator (`), even though the cursor is already inside a code block. If this setting is enabled, the plugin will automatically remove these duplicate indicators from the completion.',
|
||||
},
|
||||
|
||||
// Trigger Settings
|
||||
trigger: {
|
||||
title: 'Trigger',
|
||||
delay: 'Delay',
|
||||
delayDescription: 'Delay in ms between the last character typed and the completion request.',
|
||||
ms: 'ms',
|
||||
words: 'Trigger words',
|
||||
wordsDescription: 'Completions will be triggered if the text before the matches any of these words or characters. This can either be a direct string match or a regex match. When using a regex, make sure to include the end of line character ($).',
|
||||
},
|
||||
|
||||
// Privacy Settings
|
||||
privacy: {
|
||||
title: 'Privacy',
|
||||
ignoredFiles: 'Ignored files',
|
||||
ignoredFilesDescription: 'This field enables you to specify files and directories that the plugin should ignore. When you open any of these files, the plugin will automatically disable itself and display a \'disabled\' status in the bottom menu. Enter one pattern per line. These patterns function similar to glob patterns. Here are some frequently used patterns:',
|
||||
ignoredFilesPattern1: 'path/to/folder/**: This pattern ignores all files and sub folders within this folder.',
|
||||
ignoredFilesPattern2: '**/secret/**: This pattern ignores any file located inside a \'secret\' directory, regardless of its location in the path.',
|
||||
ignoredFilesPattern3: '!path/to/folder/example.md: This pattern explicitly undoes an ignore, making this file noticeable to the plugin.',
|
||||
ignoredFilesPattern4: '**/*Python*.md: This pattern ignores any file with \'Python\' in its name, irrespective of its location.',
|
||||
ignoredFilesPlaceholder: 'Your file patterns, e.g., **/secret/**',
|
||||
ignoredTags: 'Ignored tags',
|
||||
ignoredTagsDescription: 'Files containing any of these tags will be ignored. When you open a file containing a tag listed here, the plugin will automatically disable itself and display a \'disabled\' status in the bottom menu. Enter one tag per line.',
|
||||
ignoredTagsPlaceholder: 'Your file tags, e.g., secret',
|
||||
},
|
||||
|
||||
// Danger Zone Settings
|
||||
dangerZone: {
|
||||
title: 'Danger zone',
|
||||
factoryReset: 'Factory reset',
|
||||
factoryResetDescription: 'Messed-up the settings? No worries, press this button! After that, the plugin will go back to the default settings. The URL and API key will remain unchanged.',
|
||||
reset: 'Reset',
|
||||
advancedMode: 'Advanced mode',
|
||||
advancedModeDescription: 'If you are familiar with prompt engineering, you can enable this setting to view the prompt generation and a few shot example settings. Turn off this button. It will not reset your changes; use the factory reset button for that.',
|
||||
resetComplete: 'Factory reset complete.',
|
||||
},
|
||||
|
||||
// Advanced Settings
|
||||
advanced: {
|
||||
title: 'Advanced',
|
||||
chainOfThoughtRemovalRegex: 'Chain of thought removal regex',
|
||||
chainOfThoughtRemovalRegexDescription: 'This regex is used to remove the chain of thought tokens from the generated answer. If it is not implemented correctly, the chain of thought tokens will be included in the suggested completion.',
|
||||
regexPlaceholder: 'your regex...',
|
||||
systemMessage: 'System message',
|
||||
systemMessageDescription: 'This system message gives the models all the context and instructions they need to complete the answer generation tasks. You can edit this message to your liking. If you edit the chain of thought formatting, make sure to update the extract regex and examples accordingly.',
|
||||
systemMessagePlaceholder: 'Your system message...',
|
||||
userMessageTemplate: 'User message template',
|
||||
userMessageTemplateDescription: 'This template defines how the prefix and suffix are formatted to create the user message. You have access to two variables: {{prefix}} and {{suffix}}. If you edit this, make sure to update the examples accordingly.',
|
||||
fewShotExamples: 'Few shot examples',
|
||||
fewShotExamplesDescription: 'The model uses these examples to learn the expected answer format. Not all examples are sent at the same time. We only send the relevant examples, given the current cursor location. For example, the CodeBlock examples are only sent if the cursor is in a code block. If no special context is detected, we send the Text examples. Each context has a default of 2 examples, but you can add or remove examples if there is at least one per context. You can add more examples, but this will increase the inference costs.',
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,5 +180,177 @@ export default {
|
||||
},
|
||||
previewView: {
|
||||
close: '关闭预览',
|
||||
},
|
||||
settings: {
|
||||
// 模型设置部分
|
||||
ApiProvider: {
|
||||
label: 'LLM 提供商:',
|
||||
useCustomBaseUrl: '使用自定义基础 URL',
|
||||
enterApiKey: '输入您的 API 密钥',
|
||||
enterCustomUrl: '输入您的自定义 API 端点 URL',
|
||||
},
|
||||
Models: {
|
||||
chatModel: '聊天模型:',
|
||||
autocompleteModel: '自动完成模型:',
|
||||
embeddingModel: '嵌入模型:',
|
||||
},
|
||||
|
||||
// 模型参数部分
|
||||
ModelParameters: {
|
||||
title: '模型参数',
|
||||
temperature: 'Temperature',
|
||||
temperatureDescription: '此参数影响采样中的随机性。较低的值会导致更重复和确定性的响应。较高的温度将导致更意外或创造性的响应。默认值:0.0,如果您不确定自己在做什么,请不要更改此值。',
|
||||
topP: 'TopP',
|
||||
topPDescription: '与 temperature 参数类似,Top P 参数影响采样中的随机性。降低该值将限制模型的标记选择为更可能的标记,而增加该值则会扩展模型对较低可能性标记的选择。默认值:1,如果您不确定自己在做什么,请不要更改此值。',
|
||||
frequencyPenalty: '频率惩罚',
|
||||
frequencyPenaltyDescription: '此参数根据标记在文本中出现的频率成比例地降低重复该标记的几率。这降低了在响应中重复完全相同文本的可能性。默认值:0.25',
|
||||
presencePenalty: '存在惩罚',
|
||||
presencePenaltyDescription: '此参数降低重复文本中任何已出现标记的几率。这增加了在响应中引入新主题的可能性。默认值:2',
|
||||
maxTokens: '最大 Tokens',
|
||||
maxTokensDescription: '此参数更改模型允许生成的最大 Tokens 数。默认值:4096',
|
||||
},
|
||||
|
||||
// 文件搜索部分
|
||||
FilesSearch: {
|
||||
title: '文件搜索',
|
||||
method: '文件搜索方法',
|
||||
methodDescription: '选择搜索文件的方法。',
|
||||
auto: '自动',
|
||||
semantic: '语义',
|
||||
regex: '正则',
|
||||
ripgrepPath: 'ripgrep 路径',
|
||||
ripgrepPathDescription: 'ripgrep 二进制文件的路径。使用正则搜索时需要此项。',
|
||||
},
|
||||
|
||||
// 聊天行为部分
|
||||
ChatBehavior: {
|
||||
title: '聊天行为',
|
||||
defaultMention: '新聊天的默认提及',
|
||||
defaultMentionDescription: '选择开始新聊天时的默认文件提及行为。',
|
||||
none: '无',
|
||||
currentFile: '当前文件',
|
||||
vault: '整个 Vault',
|
||||
},
|
||||
|
||||
// 网页搜索部分
|
||||
WebSearch: {
|
||||
title: '网页搜索',
|
||||
serperApiKey: 'Serper API 密钥',
|
||||
serperApiKeyDescription: '用于网页搜索功能的 API 密钥。Serper 允许插件在互联网上搜索信息,类似于搜索引擎。请从此处获取您的密钥',
|
||||
searchEngine: 'Serper 搜索引擎',
|
||||
searchEngineDescription: '选择用于网页搜索的搜索引擎。',
|
||||
google: 'Google',
|
||||
duckDuckGo: 'DuckDuckGo',
|
||||
bing: 'Bing',
|
||||
jinaApiKey: 'Jina API 密钥(可选)',
|
||||
jinaApiKeyDescription: '用于将网页解析为 Markdown 格式的 API 密钥。如果未提供,将使用本地解析。请从此处获取您的密钥',
|
||||
},
|
||||
|
||||
// RAG 部分
|
||||
RAG: {
|
||||
title: 'RAG',
|
||||
includePatterns: '包含模式',
|
||||
includePatternsDescription: '如果指定了任何模式,则只有匹配至少一个模式的文件才会被包含在索引中。每行一个模式。使用 glob 模式(例如,"notes/*", "*.md")。留空以包含所有未被排除模式排除的文件。更改后,请使用命令 "重建整个 Vault 索引" 来应用更改。',
|
||||
testPatterns: '测试模式',
|
||||
excludePatterns: '排除模式',
|
||||
excludePatternsDescription: '匹配任何这些模式的文件将从索引中排除。每行一个模式。使用 glob 模式(例如,"private/*", "*.tmp")。留空以不排除任何内容。更改后,请使用命令 "重建整个 Vault 索引" 来应用更改。',
|
||||
chunkSize: '分块大小',
|
||||
chunkSizeDescription: '设置文本分割的分块大小。更改后,请使用 "重建整个 Vault 索引" 命令重新索引 Vault。',
|
||||
thresholdTokens: '阈值 Tokens',
|
||||
thresholdTokensDescription: '切换到 RAG 之前的最大 Tokens 数。如果提及文件的总 Tokens 超过此值,将使用 RAG 而不是包含所有文件内容。',
|
||||
minSimilarity: '最小相似度',
|
||||
minSimilarityDescription: 'RAG 结果的最小相似度得分。较高的值返回更相关但可能更少的结果。',
|
||||
limit: '限制',
|
||||
limitDescription: '包含在提示中的最大 RAG 结果数。较高的值提供更多上下文,但会增加 Tokens 使用量。',
|
||||
includedFiles: '包含的文件',
|
||||
noInclusionPatterns: '未指定包含模式 - 将包含所有文件(匹配排除模式的文件除外)',
|
||||
noMatchingFiles: '没有文件匹配包含模式',
|
||||
excludedFiles: '排除的文件',
|
||||
noExcludedFiles: '没有文件匹配排除模式',
|
||||
},
|
||||
|
||||
// 自动完成部分
|
||||
AutoComplete: {
|
||||
// 基本自动完成设置
|
||||
title: '自动完成',
|
||||
enable: '启用',
|
||||
enableDescription: '如果禁用,任何操作都不会触发扩展或导致 API 调用。',
|
||||
cacheCompletions: '缓存补全',
|
||||
cacheCompletionsDescription: '如果禁用,插件将不会缓存补全。接受或拒绝补全后,插件将不会记住它。这可能会导致更多的 API 调用。',
|
||||
debugMode: '调试模式',
|
||||
debugModeDescription: '如果启用,各种调试消息将被记录到控制台,例如来自 API 的完整响应,包括思维链 Tokens。',
|
||||
|
||||
// 预处理设置
|
||||
preprocessing: {
|
||||
title: '预处理',
|
||||
excludeDataview: '不包含 Dataview',
|
||||
excludeDataviewDescription: 'Dataview(js) 块可能很长,但对 AI 的价值不大。如果启用此设置,数据视图块将被及时删除以减少 Tokens 数量。从长远来看,这可以为您节省一些费用。',
|
||||
maxPrefixLength: '最大前缀长度',
|
||||
maxPrefixLengthDescription: '将包含在前缀中的最大字符数。较大的值将增加补全的上下文,但也可能增加成本或超出 Tokens 限制。',
|
||||
maxSuffixLength: '最大后缀长度',
|
||||
maxSuffixLengthDescription: '将包含在后缀中的最大字符数。较大的值将增加补全的上下文,但也可能增加成本或超出 Tokens 限制。',
|
||||
chars: '字符',
|
||||
},
|
||||
|
||||
// 后处理设置
|
||||
postprocessing: {
|
||||
title: '后处理',
|
||||
removeMathBlockIndicators: '自动删除重复的数学块指示符',
|
||||
removeMathBlockIndicatorsDescription: 'AI 模型可能会急切地添加数学块指示符 ($),即使光标已在数学块内。如果启用此设置,插件将自动从补全中删除这些重复的指示符。',
|
||||
removeCodeBlockIndicators: '自动删除重复的代码块指示符',
|
||||
removeCodeBlockIndicatorsDescription: 'AI 模型可能会急切地添加代码块指示符 (`),即使光标已在代码块内。如果启用此设置,插件将自动从补全中删除这些重复的指示符。',
|
||||
},
|
||||
|
||||
// 触发设置
|
||||
trigger: {
|
||||
title: '触发',
|
||||
delay: '延迟',
|
||||
delayDescription: '最后键入的字符与补全请求之间的延迟(毫秒)。',
|
||||
ms: '毫秒',
|
||||
words: '触发词',
|
||||
wordsDescription: '如果之前的文本匹配任何这些单词或字符,将触发补全。这可以是直接字符串匹配或正则表达式匹配。使用正则表达式时,请确保包含行尾字符 ($)。',
|
||||
},
|
||||
|
||||
// 隐私设置
|
||||
privacy: {
|
||||
title: '隐私',
|
||||
ignoredFiles: '忽略的文件',
|
||||
ignoredFilesDescription: '此字段使您能够指定插件应忽略的文件和目录。当您打开任何这些文件时,插件将自动禁用自身并在底部菜单中显示"已禁用"状态。每行输入一个模式。这些模式的功能类似于 glob 模式。以下是一些常用的模式:',
|
||||
ignoredFilesPattern1: 'path/to/folder/**:此模式忽略此文件夹内的所有文件和子文件夹。',
|
||||
ignoredFilesPattern2: '**/secret/**:此模式忽略位于"secret"目录内的任何文件,无论其在路径中的位置如何。',
|
||||
ignoredFilesPattern3: '!path/to/folder/example.md:此模式明确取消忽略,使此文件对插件可见。',
|
||||
ignoredFilesPattern4: '**/*Python*.md:此模式忽略名称中包含"Python"的任何文件,无论其位置如何。',
|
||||
ignoredFilesPlaceholder: '您的文件模式,例如 **/secret/**',
|
||||
ignoredTags: '忽略的标签',
|
||||
ignoredTagsDescription: '包含任何这些标签的文件将被忽略。当您打开包含此处列出的标签的文件时,插件将自动禁用自身并在底部菜单中显示"已禁用"状态。每行输入一个标签。',
|
||||
ignoredTagsPlaceholder: '您的文件标签,例如 secret',
|
||||
},
|
||||
|
||||
// 危险区域设置
|
||||
dangerZone: {
|
||||
title: '危险区域',
|
||||
factoryReset: '恢复出厂设置',
|
||||
factoryResetDescription: '搞砸了设置?别担心,按这个按钮!之后,插件将恢复到默认设置。URL 和 API 密钥将保持不变。',
|
||||
reset: '重置',
|
||||
advancedMode: '高级模式',
|
||||
advancedModeDescription: '如果您熟悉提示工程,可以启用此设置以查看提示生成和 few shot 示例设置。关闭此按钮。它不会重置您的更改;请使用恢复出厂设置按钮。',
|
||||
resetComplete: '恢复出厂设置完成。',
|
||||
},
|
||||
|
||||
// 高级设置
|
||||
advanced: {
|
||||
title: '高级',
|
||||
chainOfThoughtRemovalRegex: '思维链移除正则表达式',
|
||||
chainOfThoughtRemovalRegexDescription: '此正则表达式用于从生成的答案中移除思维链 Tokens。如果未正确实现,思维链 Tokens 将包含在建议的补全中。',
|
||||
regexPlaceholder: '您的正则表达式...',
|
||||
systemMessage: '系统消息',
|
||||
systemMessageDescription: '此系统消息为模型提供了完成答案生成任务所需的所有上下文和指令。您可以根据自己的喜好编辑此消息。如果编辑思维链格式,请确保相应地更新提取正则表达式和示例。',
|
||||
systemMessagePlaceholder: '您的系统消息...',
|
||||
userMessageTemplate: '用户消息模板',
|
||||
userMessageTemplateDescription: '此模板定义了如何格式化前缀和后缀以创建用户消息。您可以使用两个变量:{{prefix}} 和 {{suffix}}。如果编辑此项,请确保相应地更新示例。',
|
||||
fewShotExamples: 'Few shot 示例',
|
||||
fewShotExamplesDescription: '模型使用这些示例来学习预期的答案格式。并非所有示例都同时发送。我们仅根据当前光标位置发送相关示例。例如,仅当光标位于代码块中时才发送 CodeBlock 示例。如果未检测到特殊上下文,则发送 Text 示例。每个上下文默认有 2 个示例,但如果每个上下文至少有一个示例,则可以添加或删除示例。您可以添加更多示例,但这会增加推理成本。',
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@ -9,6 +9,7 @@ import {
|
||||
import * as React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
|
||||
import { t } from '../lang/helpers';
|
||||
import InfioPlugin from '../main';
|
||||
import { InfioSettings } from '../types/settings';
|
||||
import { findFilesMatchingPatterns } from '../utils/glob-utils';
|
||||
@ -61,10 +62,10 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
}
|
||||
|
||||
private renderModelParametersSection(containerEl: HTMLElement): void {
|
||||
new Setting(containerEl).setHeading().setName('Model parameters');
|
||||
new Setting(containerEl).setHeading().setName(t('settings.ModelParameters.title'));
|
||||
new Setting(containerEl)
|
||||
.setName('Temperature')
|
||||
.setDesc('This parameter affects randomness in the sampling. Lower values result in more repetitive and deterministic responses. Higher temperatures will result in more unexpected or creative responses. Default: 0.0, please don\'t change this if you don\'t know what you are doing.')
|
||||
.setName(t('settings.ModelParameters.temperature'))
|
||||
.setDesc(t('settings.ModelParameters.temperatureDescription'))
|
||||
.addText((text) => {
|
||||
text
|
||||
.setValue(String(this.plugin.settings.modelOptions.temperature))
|
||||
@ -79,8 +80,8 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
})
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('TopP')
|
||||
.setDesc("Like the temperature parameter, the Top P parameter affects the randomness in sampling. Lowering the value will limit the model's token selection to likelier tokens while increasing the value expands the model's token selection with lower likelihood tokens. Default: 1, please don't change this if you don't know what you are doing.")
|
||||
.setName(t('settings.ModelParameters.topP'))
|
||||
.setDesc(t('settings.ModelParameters.topPDescription'))
|
||||
.addText((text) => {
|
||||
text
|
||||
.setValue(String(this.plugin.settings.modelOptions.top_p))
|
||||
@ -95,8 +96,8 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
})
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('Frequency penalty')
|
||||
.setDesc('This parameter reduces the chance of repeating a token proportionally based on how often it has appeared in the text so far. This decreases the likelihood of repeating the exact same text in a response. Default: 0.25')
|
||||
.setName(t('settings.ModelParameters.frequencyPenalty'))
|
||||
.setDesc(t('settings.ModelParameters.frequencyPenaltyDescription'))
|
||||
.addText((text) => {
|
||||
text
|
||||
.setValue(String(this.plugin.settings.modelOptions.frequency_penalty))
|
||||
@ -111,8 +112,8 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
})
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('Presence penalty')
|
||||
.setDesc("This parameter reduces the chance of repeating any token that has appeared in the text so far. This increases the likelihood of introducing new topics in a response. Default: 2")
|
||||
.setName(t('settings.ModelParameters.presencePenalty'))
|
||||
.setDesc(t('settings.ModelParameters.presencePenaltyDescription'))
|
||||
.addText((text) => {
|
||||
text
|
||||
.setValue(String(this.plugin.settings.modelOptions.presence_penalty))
|
||||
@ -127,8 +128,8 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
})
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName('Max tokens')
|
||||
.setDesc("This parameter changes the maximum number of tokens the model is allowed to generate. Default: 4096")
|
||||
.setName(t('settings.ModelParameters.maxTokens'))
|
||||
.setDesc(t('settings.ModelParameters.maxTokensDescription'))
|
||||
.addText((text) => {
|
||||
text
|
||||
.setValue(String(this.plugin.settings.modelOptions.max_tokens))
|
||||
@ -145,15 +146,15 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
}
|
||||
|
||||
private renderFilesSearchSection(containerEl: HTMLElement): void {
|
||||
new Setting(containerEl).setHeading().setName('File search')
|
||||
new Setting(containerEl).setHeading().setName(t('settings.FilesSearch.title'))
|
||||
new Setting(containerEl)
|
||||
.setName('Files search method')
|
||||
.setDesc('Choose the method to search for files.')
|
||||
.setName(t('settings.FilesSearch.method'))
|
||||
.setDesc(t('settings.FilesSearch.methodDescription'))
|
||||
.addDropdown((dropdown) =>
|
||||
dropdown
|
||||
.addOption('auto', 'Auto')
|
||||
.addOption('semantic', 'Semantic')
|
||||
.addOption('regex', 'Regex')
|
||||
.addOption('auto', t('settings.FilesSearch.auto'))
|
||||
.addOption('semantic', t('settings.FilesSearch.semantic'))
|
||||
.addOption('regex', t('settings.FilesSearch.regex'))
|
||||
.setValue(this.plugin.settings.filesSearchMethod)
|
||||
.onChange(async (value) => {
|
||||
await this.plugin.setSettings({
|
||||
@ -163,8 +164,8 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
}),
|
||||
)
|
||||
new Setting(containerEl)
|
||||
.setName('ripgrep path')
|
||||
.setDesc('Path to the ripgrep binary. When using regex search, this is required.')
|
||||
.setName(t('settings.FilesSearch.ripgrepPath'))
|
||||
.setDesc(t('settings.FilesSearch.ripgrepPathDescription'))
|
||||
.addText((text) =>
|
||||
text
|
||||
.setPlaceholder('/opt/homebrew/bin/')
|
||||
@ -179,15 +180,15 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
}
|
||||
|
||||
private renderChatBehaviorSection(containerEl: HTMLElement): void {
|
||||
new Setting(containerEl).setHeading().setName('Chat behavior');
|
||||
new Setting(containerEl).setHeading().setName(t('settings.ChatBehavior.title'));
|
||||
new Setting(containerEl)
|
||||
.setName('Default mention for new chat')
|
||||
.setDesc('Choose the default file mention behavior when starting a new chat.')
|
||||
.setName(t('settings.ChatBehavior.defaultMention'))
|
||||
.setDesc(t('settings.ChatBehavior.defaultMentionDescription'))
|
||||
.addDropdown((dropdown) =>
|
||||
dropdown
|
||||
.addOption('none', 'None')
|
||||
.addOption('current-file', 'Current File')
|
||||
.addOption('vault', 'Vault')
|
||||
.addOption('none', t('settings.ChatBehavior.none'))
|
||||
.addOption('current-file', t('settings.ChatBehavior.currentFile'))
|
||||
.addOption('vault', t('settings.ChatBehavior.vault'))
|
||||
.setValue(this.plugin.settings.defaultMention || 'none')
|
||||
.onChange(async (value) => {
|
||||
await this.plugin.setSettings({
|
||||
@ -207,12 +208,12 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
renderDeepResearchSection(containerEl: HTMLElement): void {
|
||||
new Setting(containerEl)
|
||||
.setHeading()
|
||||
.setName('Web search')
|
||||
.setName(t('settings.WebSearch.title'))
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Serper API key')
|
||||
.setName(t('settings.WebSearch.serperApiKey'))
|
||||
.setDesc(createFragment(el => {
|
||||
el.appendText('API key for web search functionality. Serper allows the plugin to search the internet for information, similar to a search engine. Get your key from ');
|
||||
el.appendText(t('settings.WebSearch.serperApiKeyDescription') + ' ');
|
||||
const a = el.createEl('a', {
|
||||
href: 'https://serpapi.com/manage-api-key',
|
||||
text: 'https://serpapi.com/manage-api-key'
|
||||
@ -237,13 +238,13 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
})
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Serper search engine')
|
||||
.setDesc('Choose the search engine to use for web search.')
|
||||
.setName(t('settings.WebSearch.searchEngine'))
|
||||
.setDesc(t('settings.WebSearch.searchEngineDescription'))
|
||||
.addDropdown((dropdown) =>
|
||||
dropdown
|
||||
.addOption('google', 'Google')
|
||||
.addOption('duckduckgo', 'DuckDuckGo')
|
||||
.addOption('bing', 'Bing')
|
||||
.addOption('google', t('settings.WebSearch.google'))
|
||||
.addOption('duckduckgo', t('settings.WebSearch.duckDuckGo'))
|
||||
.addOption('bing', t('settings.WebSearch.bing'))
|
||||
.setValue(this.plugin.settings.serperSearchEngine)
|
||||
.onChange(async (value) => {
|
||||
await this.plugin.setSettings({
|
||||
@ -255,9 +256,9 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Jina API key (Optional)')
|
||||
.setName(t('settings.WebSearch.jinaApiKey'))
|
||||
.setDesc(createFragment(el => {
|
||||
el.appendText('API key for parsing web pages into markdown format. If not provided, local parsing will be used. Get your key from ');
|
||||
el.appendText(t('settings.WebSearch.jinaApiKeyDescription') + ' ');
|
||||
const a = el.createEl('a', {
|
||||
href: 'https://jina.ai/api-key',
|
||||
text: 'https://jina.ai/api-key'
|
||||
@ -283,14 +284,14 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
}
|
||||
|
||||
renderRAGSection(containerEl: HTMLElement): void {
|
||||
new Setting(containerEl).setHeading().setName('RAG')
|
||||
new Setting(containerEl).setHeading().setName(t('settings.RAG.title'))
|
||||
new Setting(containerEl)
|
||||
.setName('Include patterns')
|
||||
.setName(t('settings.RAG.includePatterns'))
|
||||
.setDesc(
|
||||
'If any patterns are specified, ONLY files matching at least one pattern will be included in indexing. One pattern per line. Uses glob patterns (e.g., "notes/*", "*.md"). Leave empty to include all files not excluded by exclude patterns. After changing this, use the command "Rebuild entire vault index" to apply changes.',
|
||||
t('settings.RAG.includePatternsDescription'),
|
||||
)
|
||||
.addButton((button) =>
|
||||
button.setButtonText('Test patterns').onClick(async () => {
|
||||
button.setButtonText(t('settings.RAG.testPatterns')).onClick(async () => {
|
||||
const patterns = this.plugin.settings.ragOptions.includePatterns
|
||||
const includedFiles = await findFilesMatchingPatterns(
|
||||
patterns,
|
||||
@ -320,12 +321,12 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Exclude patterns')
|
||||
.setName(t('settings.RAG.excludePatterns'))
|
||||
.setDesc(
|
||||
'Files matching ANY of these patterns will be excluded from indexing. One pattern per line. Uses glob patterns (e.g., "private/*", "*.tmp"). Leave empty to exclude nothing. After changing this, use the command "Rebuild entire vault index" to apply changes.',
|
||||
t('settings.RAG.excludePatternsDescription'),
|
||||
)
|
||||
.addButton((button) =>
|
||||
button.setButtonText('Test patterns').onClick(async () => {
|
||||
button.setButtonText(t('settings.RAG.testPatterns')).onClick(async () => {
|
||||
const patterns = this.plugin.settings.ragOptions.excludePatterns
|
||||
const excludedFiles = await findFilesMatchingPatterns(
|
||||
patterns,
|
||||
@ -355,9 +356,9 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Chunk size')
|
||||
.setName(t('settings.RAG.chunkSize'))
|
||||
.setDesc(
|
||||
'Set the chunk size for text splitting. After changing this, please re-index the vault using the "Rebuild entire vault index" command.',
|
||||
t('settings.RAG.chunkSizeDescription'),
|
||||
)
|
||||
.addText((text) =>
|
||||
text
|
||||
@ -378,9 +379,9 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Threshold tokens')
|
||||
.setName(t('settings.RAG.thresholdTokens'))
|
||||
.setDesc(
|
||||
'Maximum number of tokens before switching to RAG. If the total tokens from mentioned files exceed this, RAG will be used instead of including all file contents.',
|
||||
t('settings.RAG.thresholdTokensDescription'),
|
||||
)
|
||||
.addText((text) =>
|
||||
text
|
||||
@ -401,9 +402,9 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Minimum similarity')
|
||||
.setName(t('settings.RAG.minSimilarity'))
|
||||
.setDesc(
|
||||
'Minimum similarity score for RAG results. Higher values return more relevant but potentially fewer results.',
|
||||
t('settings.RAG.minSimilarityDescription'),
|
||||
)
|
||||
.addText((text) =>
|
||||
text
|
||||
@ -424,9 +425,9 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
)
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Limit')
|
||||
.setName(t('settings.RAG.limit'))
|
||||
.setDesc(
|
||||
'Maximum number of RAG results to include in the prompt. Higher values provide more context but increase token usage.',
|
||||
t('settings.RAG.limitDescription'),
|
||||
)
|
||||
.addText((text) =>
|
||||
text
|
||||
@ -471,7 +472,7 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
const errors = new Map();
|
||||
|
||||
// AutoComplete base
|
||||
new Setting(containerEl).setName('AutoComplete').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<BasicAutoCompleteSettings
|
||||
settings={this.plugin.settings}
|
||||
@ -480,7 +481,7 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
);
|
||||
|
||||
// Preprocessing
|
||||
new Setting(containerEl).setName('Preprocessing').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.preprocessing.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<PreprocessingSettings
|
||||
settings={this.plugin.settings}
|
||||
@ -490,7 +491,7 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
);
|
||||
|
||||
// Postprocessing
|
||||
new Setting(containerEl).setName('Postprocessing').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.postprocessing.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<PostprocessingSettings
|
||||
settings={this.plugin.settings}
|
||||
@ -499,7 +500,7 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
);
|
||||
|
||||
// Trigger
|
||||
new Setting(containerEl).setName('Trigger').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.trigger.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<TriggerSettingsSection
|
||||
settings={this.plugin.settings}
|
||||
@ -509,7 +510,7 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
);
|
||||
|
||||
// Privacy
|
||||
new Setting(containerEl).setName('Privacy').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.privacy.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<PrivacySettings
|
||||
settings={this.plugin.settings}
|
||||
@ -519,20 +520,20 @@ export class InfioSettingTab extends PluginSettingTab {
|
||||
);
|
||||
|
||||
// Danger zone
|
||||
new Setting(containerEl).setName('Danger zone').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.dangerZone.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<DangerZoneSettings
|
||||
settings={this.plugin.settings}
|
||||
updateSettings={updateSettings}
|
||||
onReset={() => {
|
||||
new Notice("Factory reset complete.");
|
||||
new Notice(t('settings.AutoComplete.dangerZone.resetComplete'));
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
// Advanced
|
||||
if (this.plugin.settings.advancedMode) {
|
||||
new Setting(containerEl).setName('Advanced').setHeading();
|
||||
new Setting(containerEl).setName(t('settings.AutoComplete.advanced.title')).setHeading();
|
||||
this.renderComponent(containerEl,
|
||||
<AdvancedSettings
|
||||
settings={this.plugin.settings}
|
||||
@ -565,7 +566,7 @@ class ExcludedFilesModal extends Modal {
|
||||
this.titleEl.setText(`Excluded Files (${this.files.length})`)
|
||||
|
||||
if (this.files.length === 0) {
|
||||
contentEl.createEl('p', { text: 'No files match the exclusion patterns' })
|
||||
contentEl.createEl('p', { text: t('settings.RAG.noExcludedFiles') })
|
||||
return
|
||||
}
|
||||
|
||||
@ -599,14 +600,14 @@ class IncludedFilesModal extends Modal {
|
||||
|
||||
if (this.patterns.length === 0) {
|
||||
contentEl.createEl('p', {
|
||||
text: 'No inclusion patterns specified - all files will be included (except those matching exclusion patterns)',
|
||||
text: t('settings.RAG.noInclusionPatterns'),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (this.files.length === 0) {
|
||||
contentEl.createEl('p', {
|
||||
text: 'No files match the inclusion patterns',
|
||||
text: t('settings.RAG.noMatchingFiles'),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
import SettingsItem from "./SettingsItem";
|
||||
import TextSettingItem from "./TextSettingItem";
|
||||
@ -19,11 +20,11 @@ export default function AdvancedSettings({ settings, updateSettings, errors }: P
|
||||
return (
|
||||
<>
|
||||
<TextSettingItem
|
||||
name={"Chain of thought removal regex"}
|
||||
name={t("settings.AutoComplete.advanced.chainOfThoughtRemovalRegex")}
|
||||
description={
|
||||
"This regex is used to remove the chain of thought tokens from the generated answer. If it is not implemented correctly, the chain of thought tokens will be included in the suggested completion."
|
||||
t("settings.AutoComplete.advanced.chainOfThoughtRemovalRegexDescription")
|
||||
}
|
||||
placeholder={"your regex..."}
|
||||
placeholder={t("settings.AutoComplete.advanced.regexPlaceholder")}
|
||||
value={settings.chainOfThoughRemovalRegex}
|
||||
errorMessage={errors.get("chainOfThoughRemovalRegex")}
|
||||
setValue={(value: string) =>
|
||||
@ -34,9 +35,9 @@ export default function AdvancedSettings({ settings, updateSettings, errors }: P
|
||||
/>
|
||||
|
||||
<SettingsItem
|
||||
name={"System message"}
|
||||
name={t("settings.AutoComplete.advanced.systemMessage")}
|
||||
description={
|
||||
"This system message gives the models all the context and instructions they need to complete the answer generation tasks. You can edit this message to your liking. If you edit the chain of thought formatting, make sure to update the extract regex and examples accordingly."
|
||||
t("settings.AutoComplete.advanced.systemMessageDescription")
|
||||
}
|
||||
display={"block"}
|
||||
errorMessage={errors.get("systemMessage")}
|
||||
@ -44,7 +45,7 @@ export default function AdvancedSettings({ settings, updateSettings, errors }: P
|
||||
<textarea
|
||||
className="infio-autocomplete-setting-item-textarea"
|
||||
rows={10}
|
||||
placeholder="Your system message..."
|
||||
placeholder={t("settings.AutoComplete.advanced.systemMessagePlaceholder")}
|
||||
value={settings.systemMessage}
|
||||
onChange={(e) =>
|
||||
updateSettings({
|
||||
@ -55,9 +56,9 @@ export default function AdvancedSettings({ settings, updateSettings, errors }: P
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem
|
||||
name={"User message template"}
|
||||
name={t("settings.AutoComplete.advanced.userMessageTemplate")}
|
||||
description={
|
||||
"This template defines how the prefix and suffix are formatted to create the user message. You have access to two variables: {{prefix}} and {{suffix}}. If you edit this, make sure to update the examples accordingly."
|
||||
t("settings.AutoComplete.advanced.userMessageTemplateDescription")
|
||||
}
|
||||
display={"block"}
|
||||
errorMessage={errors.get("userMessageTemplate")}
|
||||
@ -77,9 +78,9 @@ export default function AdvancedSettings({ settings, updateSettings, errors }: P
|
||||
|
||||
<FewShotExampleSettings
|
||||
fewShotExamples={settings.fewShotExamples}
|
||||
name={"Few shot examples"}
|
||||
name={t("settings.AutoComplete.advanced.fewShotExamples")}
|
||||
description={
|
||||
"The model uses these examples to learn the expected answer format. Not all examples are sent at the same time. We only send the relevant examples, given the current cursor location. For example, the CodeBlock examples are only sent if the cursor is in a code block. If no special context is detected, we send the Text examples. Each context has a default of 2 examples, but you can add or remove examples if there is at least one per context. You can add more examples, but this will increase the inference costs."
|
||||
t("settings.AutoComplete.advanced.fewShotExamplesDescription")
|
||||
}
|
||||
setFewShotExamples={(value) =>
|
||||
updateSettings({ fewShotExamples: value })
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
|
||||
import CheckBoxSettingItem from "./CheckBoxSettingItem";
|
||||
@ -13,25 +14,25 @@ export default function BasicAutoCompleteSettings({ settings, updateSettings }:
|
||||
return (
|
||||
<>
|
||||
<CheckBoxSettingItem
|
||||
name={"Enable"}
|
||||
name={t("settings.AutoComplete.enable")}
|
||||
description={
|
||||
"If disabled, nothing will trigger the extension or can result in an API call."
|
||||
t("settings.AutoComplete.enableDescription")
|
||||
}
|
||||
enabled={settings.autocompleteEnabled}
|
||||
setEnabled={(value) => updateSettings({ autocompleteEnabled: value })}
|
||||
/>
|
||||
<CheckBoxSettingItem
|
||||
name={"Cache completions"}
|
||||
name={t("settings.AutoComplete.cacheCompletions")}
|
||||
description={
|
||||
"If disabled, the plugin will not cache the completions. After accepting or rejecting a completion, the plugin will not remember it. This might result in more API calls."
|
||||
t("settings.AutoComplete.cacheCompletionsDescription")
|
||||
}
|
||||
enabled={settings.cacheSuggestions}
|
||||
setEnabled={(value) => updateSettings({ cacheSuggestions: value })}
|
||||
/>
|
||||
<CheckBoxSettingItem
|
||||
name={"Debug mode"}
|
||||
name={t("settings.AutoComplete.debugMode")}
|
||||
description={
|
||||
"If enabled, various debug messages will be logged to the console, such as the complete response from the API, including the chain of thought tokens."
|
||||
t("settings.AutoComplete.debugModeDescription")
|
||||
}
|
||||
enabled={settings.debugMode}
|
||||
setEnabled={(value) => updateSettings({ debugMode: value })}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
|
||||
import CheckBoxSettingItem from "./CheckBoxSettingItem";
|
||||
@ -15,22 +16,22 @@ export default function DangerZoneSettings({ settings, updateSettings, onReset }
|
||||
return (
|
||||
<>
|
||||
<SettingsItem
|
||||
name={"Factory reset"}
|
||||
name={t("settings.AutoComplete.dangerZone.factoryReset")}
|
||||
description={
|
||||
"Messed-up the settings? No worries, press this button! After that, the plugin will go back to the default settings. The URL and API key will remain unchanged."
|
||||
t("settings.AutoComplete.dangerZone.factoryResetDescription")
|
||||
}
|
||||
>
|
||||
<button
|
||||
aria-label="Reset to default settings"
|
||||
onClick={onReset}
|
||||
>
|
||||
Reset
|
||||
{t("settings.AutoComplete.dangerZone.reset")}
|
||||
</button>
|
||||
</SettingsItem>
|
||||
<CheckBoxSettingItem
|
||||
name={"Advanced mode"}
|
||||
name={t("settings.AutoComplete.dangerZone.advancedMode")}
|
||||
description={
|
||||
"If you are familiar with prompt engineering, you can enable this setting to view the prompt generation and a few shot example settings. Turn off this button. It will not reset your changes; use the factory reset button for that."
|
||||
t("settings.AutoComplete.dangerZone.advancedModeDescription")
|
||||
}
|
||||
enabled={settings.advancedMode}
|
||||
setEnabled={(value) => updateSettings({ advancedMode: value })}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import InfioPlugin from "../../main";
|
||||
import { ApiProvider } from '../../types/llm/model';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
@ -137,7 +138,7 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
|
||||
return (
|
||||
<div className="infio-llm-setting-provider">
|
||||
<DropdownComponent
|
||||
name="Api provider:"
|
||||
name={t("settings.ApiProvider.label")}
|
||||
value={currProvider}
|
||||
options={providers}
|
||||
onChange={updateProvider}
|
||||
@ -146,7 +147,7 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
|
||||
{currProvider !== ApiProvider.Ollama && (
|
||||
<TextComponent
|
||||
name={currProvider + " api key:"}
|
||||
placeholder="Enter your api key"
|
||||
placeholder={t("settings.ApiProvider.enterApiKey")}
|
||||
value={providerSetting.apiKey || ''}
|
||||
onChange={updateProviderApiKey}
|
||||
type="password"
|
||||
@ -154,13 +155,13 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
|
||||
)}
|
||||
<div className="infio-llm-setting-divider"></div>
|
||||
<ToggleComponent
|
||||
name="Use custom base url"
|
||||
name={t("settings.ApiProvider.useCustomBaseUrl")}
|
||||
value={providerSetting.useCustomUrl || false}
|
||||
onChange={updateProviderUseCustomUrl}
|
||||
/>
|
||||
{providerSetting.useCustomUrl && (
|
||||
<TextComponent
|
||||
placeholder="Enter your custom api endpoint url"
|
||||
placeholder={t("settings.ApiProvider.enterCustomUrl")}
|
||||
value={providerSetting.baseUrl || ''}
|
||||
onChange={updateProviderBaseUrl}
|
||||
/>
|
||||
@ -169,21 +170,21 @@ const CustomProviderSettings: React.FC<CustomProviderSettingsProps> = ({ plugin,
|
||||
<div className="infio-llm-setting-divider"></div>
|
||||
<div className="infio-llm-setting-divider"></div>
|
||||
<ComboBoxComponent
|
||||
name="Chat model:"
|
||||
name={t("settings.Models.chatModel")}
|
||||
provider={settings.chatModelProvider || currProvider}
|
||||
modelId={settings.chatModelId}
|
||||
updateModel={updateChatModelId}
|
||||
/>
|
||||
<div className="infio-llm-setting-divider"></div>
|
||||
<ComboBoxComponent
|
||||
name="Autocomplete model:"
|
||||
name={t("settings.Models.autocompleteModel")}
|
||||
provider={settings.applyModelProvider || currProvider}
|
||||
modelId={settings.applyModelId}
|
||||
updateModel={updateApplyModelId}
|
||||
/>
|
||||
<div className="infio-llm-setting-divider"></div>
|
||||
<ComboBoxComponent
|
||||
name="Embedding model:"
|
||||
name={t("settings.Models.embeddingModel")}
|
||||
provider={settings.embeddingModelProvider || ApiProvider.Google}
|
||||
modelId={settings.embeddingModelId}
|
||||
isEmbedding={true}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
|
||||
import CheckBoxSettingItem from "./CheckBoxSettingItem";
|
||||
@ -13,9 +14,9 @@ export default function PostprocessingSettings({ settings, updateSettings }: Pro
|
||||
return (
|
||||
<>
|
||||
<CheckBoxSettingItem
|
||||
name={"Auto remove duplicate mat block indicators"}
|
||||
name={t("settings.AutoComplete.postprocessing.removeMathBlockIndicators")}
|
||||
description={
|
||||
"The AI model might eagerly add a math block indicator ($), even though the cursor is already inside a math block. If this setting is enabled, the plugin will automatically remove these duplicate indicators from the completion."
|
||||
t("settings.AutoComplete.postprocessing.removeMathBlockIndicatorsDescription")
|
||||
}
|
||||
enabled={settings.removeDuplicateMathBlockIndicator}
|
||||
setEnabled={(value) =>
|
||||
@ -23,9 +24,9 @@ export default function PostprocessingSettings({ settings, updateSettings }: Pro
|
||||
}
|
||||
/>
|
||||
<CheckBoxSettingItem
|
||||
name={"Auto remove duplicate code block indicators"}
|
||||
name={t("settings.AutoComplete.postprocessing.removeCodeBlockIndicators")}
|
||||
description={
|
||||
"The AI model might eagerly add a code block indicator (`), even though the cursor is already inside a code block. If this setting is enabled, the plugin will automatically remove these duplicate indicators from the completion."
|
||||
t("settings.AutoComplete.postprocessing.removeCodeBlockIndicatorsDescription")
|
||||
}
|
||||
enabled={settings.removeDuplicateCodeBlockIndicator}
|
||||
setEnabled={(value) =>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
import {
|
||||
MAX_MAX_CHAR_LIMIT,
|
||||
@ -19,9 +20,9 @@ export default function PreprocessingSettings({ settings, updateSettings, errors
|
||||
return (
|
||||
<>
|
||||
<CheckBoxSettingItem
|
||||
name={"Don't include Dataview"}
|
||||
name={t("settings.AutoComplete.preprocessing.excludeDataview")}
|
||||
description={
|
||||
"Dataview(js) blocks can be quite long while not providing much value to the AI. If this setting is enabled, data view blocks will be removed promptly to reduce the number of tokens. This could save you some money in the long run."
|
||||
t("settings.AutoComplete.preprocessing.excludeDataviewDescription")
|
||||
}
|
||||
enabled={settings.dontIncludeDataviews}
|
||||
setEnabled={(value) =>
|
||||
@ -29,9 +30,9 @@ export default function PreprocessingSettings({ settings, updateSettings, errors
|
||||
}
|
||||
/>
|
||||
<SliderSettingsItem
|
||||
name={"Maximum prefix length"}
|
||||
name={t("settings.AutoComplete.preprocessing.maxPrefixLength")}
|
||||
description={
|
||||
"The maximum number of characters that will be included in the prefix. A larger value will increase the context for the completion, but it can also increase the cost or push you over the token limit."
|
||||
t("settings.AutoComplete.preprocessing.maxPrefixLengthDescription")
|
||||
}
|
||||
value={settings.maxPrefixCharLimit}
|
||||
errorMessage={errors.get("maxPrefixCharLimit")}
|
||||
@ -41,12 +42,12 @@ export default function PreprocessingSettings({ settings, updateSettings, errors
|
||||
min={MIN_MAX_CHAR_LIMIT}
|
||||
max={MAX_MAX_CHAR_LIMIT}
|
||||
step={100}
|
||||
suffix={" chars"}
|
||||
suffix={t("settings.AutoComplete.preprocessing.chars")}
|
||||
/>
|
||||
<SliderSettingsItem
|
||||
name={"Maximum suffix length"}
|
||||
name={t("settings.AutoComplete.preprocessing.maxSuffixLength")}
|
||||
description={
|
||||
"The maximum number of characters that will be included in the suffix. A larger value will increase the context for the completion, but it can also increase the cost or push you over the token limit."
|
||||
t("settings.AutoComplete.preprocessing.maxSuffixLengthDescription")
|
||||
}
|
||||
value={settings.maxSuffixCharLimit}
|
||||
errorMessage={errors.get("maxSuffixCharLimit")}
|
||||
@ -56,7 +57,7 @@ export default function PreprocessingSettings({ settings, updateSettings, errors
|
||||
min={MIN_MAX_CHAR_LIMIT}
|
||||
max={MAX_MAX_CHAR_LIMIT}
|
||||
step={100}
|
||||
suffix={" chars"}
|
||||
suffix={t("settings.AutoComplete.preprocessing.chars")}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
|
||||
import SettingsItem from "./SettingsItem";
|
||||
@ -14,26 +15,18 @@ export default function PrivacySettings({ settings, updateSettings, errors }: Pr
|
||||
return (
|
||||
<>
|
||||
<SettingsItem
|
||||
name={"Ignored files"}
|
||||
name={t("settings.AutoComplete.privacy.ignoredFiles")}
|
||||
description={
|
||||
<div>
|
||||
<p>This field enables you to specify files and directories that the plugin should ignore. When
|
||||
you open any of these files, the plugin will automatically disable itself and display a
|
||||
'disabled' status in the bottom menu. Enter one pattern per line. These patterns function
|
||||
similar to glob patterns. Here are some frequently used patterns:</p>
|
||||
<p>{t("settings.AutoComplete.privacy.ignoredFilesDescription")}</p>
|
||||
<ul>
|
||||
<li><code>path/to/folder/**</code>: This pattern ignores all files and sub folders within
|
||||
this folder.
|
||||
<li><code>path/to/folder/**</code>: {t("settings.AutoComplete.privacy.ignoredFilesPattern1")}
|
||||
</li>
|
||||
<li><code>"**/secret/**"</code>: This pattern ignores any file located inside a 'secret'
|
||||
directory,
|
||||
regardless of its location in the path.
|
||||
<li><code>"**/secret/**"</code>: {t("settings.AutoComplete.privacy.ignoredFilesPattern2")}
|
||||
</li>
|
||||
<li><code>!path/to/folder/example.md</code>: This pattern explicitly undoes an ignore,
|
||||
making this file noticeable to the plugin.
|
||||
<li><code>!path/to/folder/example.md</code>: {t("settings.AutoComplete.privacy.ignoredFilesPattern3")}
|
||||
</li>
|
||||
<li><code>**/*Python*.md</code>: This pattern ignores any file with 'Python' in its name,
|
||||
irrespective of its location.
|
||||
<li><code>**/*Python*.md</code>: {t("settings.AutoComplete.privacy.ignoredFilesPattern4")}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -44,7 +37,7 @@ export default function PrivacySettings({ settings, updateSettings, errors }: Pr
|
||||
<textarea
|
||||
className="infio-autocomplete-setting-item-textarea"
|
||||
rows={10}
|
||||
placeholder="Your file patterns, e.g., **/secret/**"
|
||||
placeholder={t("settings.AutoComplete.privacy.ignoredFilesPlaceholder")}
|
||||
value={settings.ignoredFilePatterns}
|
||||
onChange={(e) =>
|
||||
updateSettings({
|
||||
@ -54,12 +47,10 @@ export default function PrivacySettings({ settings, updateSettings, errors }: Pr
|
||||
/>
|
||||
</SettingsItem>
|
||||
<SettingsItem
|
||||
name={"Ignored tags"}
|
||||
name={t("settings.AutoComplete.privacy.ignoredTags")}
|
||||
description={
|
||||
<div>
|
||||
<p>Files containing any of these tags will be ignored. When you open a file containing a
|
||||
tag listed here, the plugin will automatically disable itself and display a 'disabled'
|
||||
status in the bottom menu. Enter one tag per line.
|
||||
<p>{t("settings.AutoComplete.privacy.ignoredTagsDescription")}
|
||||
</p>
|
||||
</div>
|
||||
}
|
||||
@ -69,7 +60,7 @@ export default function PrivacySettings({ settings, updateSettings, errors }: Pr
|
||||
<textarea
|
||||
className="infio-autocomplete-setting-item-textarea"
|
||||
rows={10}
|
||||
placeholder="Your file tags, e.g., secret"
|
||||
placeholder={t("settings.AutoComplete.privacy.ignoredTagsPlaceholder")}
|
||||
value={settings.ignoredTags}
|
||||
onChange={(e) =>
|
||||
updateSettings({
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import * as React from "react";
|
||||
|
||||
import { t } from '../../lang/helpers';
|
||||
import { InfioSettings } from '../../types/settings';
|
||||
import {
|
||||
MAX_DELAY,
|
||||
@ -19,9 +20,9 @@ export default function TriggerSettingsSection({ settings, updateSettings, error
|
||||
return (
|
||||
<>
|
||||
<SliderSettingsItem
|
||||
name={"Delay"}
|
||||
name={t("settings.AutoComplete.trigger.delay")}
|
||||
description={
|
||||
"Delay in ms between the last character typed and the completion request."
|
||||
t("settings.AutoComplete.trigger.delayDescription")
|
||||
}
|
||||
value={settings.delay}
|
||||
errorMessage={errors.get("delay")}
|
||||
@ -29,12 +30,12 @@ export default function TriggerSettingsSection({ settings, updateSettings, error
|
||||
min={MIN_DELAY}
|
||||
max={MAX_DELAY}
|
||||
step={100}
|
||||
suffix={"ms"}
|
||||
suffix={t("settings.AutoComplete.trigger.ms")}
|
||||
/>
|
||||
<TriggerSettings
|
||||
name={"Trigger words"}
|
||||
name={t("settings.AutoComplete.trigger.words")}
|
||||
description={
|
||||
"Completions will be triggered if the text before the matches any of these words or characters. This can either be a direct string match or a regex match. When using a regex, make sure to include the end of line character ($)."
|
||||
t("settings.AutoComplete.trigger.wordsDescription")
|
||||
}
|
||||
triggers={settings.triggers}
|
||||
setValues={(triggers) => updateSettings({ triggers })}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user