diff --git a/src/components/chat-view/Chat.tsx b/src/components/chat-view/Chat.tsx index 937abe3..d2bb336 100644 --- a/src/components/chat-view/Chat.tsx +++ b/src/components/chat-view/Chat.tsx @@ -652,7 +652,7 @@ const Chat = forwardRef((props, ref) => { {submitMutation.isPending && ( )} diff --git a/src/components/chat-view/LLMResponseInfoPopover.tsx b/src/components/chat-view/LLMResponseInfoPopover.tsx index fa954e8..7e3e0f3 100644 --- a/src/components/chat-view/LLMResponseInfoPopover.tsx +++ b/src/components/chat-view/LLMResponseInfoPopover.tsx @@ -30,9 +30,9 @@ export default function LLMResponseInfoPopover({ {usage ? ( -
LLM Response Information
+
LLM response information
-
Token Count
+
Token count
@@ -59,7 +59,7 @@ export default function LLMResponseInfoPopover({
- Estimated Price: + Estimated price: {estimatedPrice === null ? 'Not available' diff --git a/src/components/chat-view/chat-input/MentionableBadge.tsx b/src/components/chat-view/chat-input/MentionableBadge.tsx index 9ed09e9..9530dd1 100644 --- a/src/components/chat-view/chat-input/MentionableBadge.tsx +++ b/src/components/chat-view/chat-input/MentionableBadge.tsx @@ -150,7 +150,7 @@ function CurrentFileBadge({ {mentionable.file.name}
- {' (Current File)'} + {' (Current file)'}
) : null diff --git a/src/main.ts b/src/main.ts index c166cdb..2e35e2a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -208,7 +208,7 @@ export default class InfioPlugin extends Plugin { this.addCommand({ id: 'autocomplete-accept', - name: 'Autocomplete Accept', + name: 'Autocomplete accept', editorCheckCallback: ( checking: boolean, editor: Editor, @@ -228,7 +228,7 @@ export default class InfioPlugin extends Plugin { this.addCommand({ id: 'autocomplete-predict', - name: 'Autocomplete Predict', + name: 'Autocomplete predict', editorCheckCallback: ( checking: boolean, editor: Editor, @@ -251,7 +251,7 @@ export default class InfioPlugin extends Plugin { this.addCommand({ id: "autocomplete-toggle", - name: "Autocomplete Toggle", + name: "Autocomplete toggle", callback: () => { const newValue = !this.settings.autocompleteEnabled; this.setSettings({ @@ -262,8 +262,8 @@ export default class InfioPlugin extends Plugin { }); this.addCommand({ - id: "infio-autocomplete-enable", - name: "Infio Autocomplete Enable", + id: "autocomplete-enable", + name: "Autocomplete enable", checkCallback: (checking) => { if (checking) { return !this.settings.autocompleteEnabled; @@ -279,7 +279,7 @@ export default class InfioPlugin extends Plugin { this.addCommand({ id: "autocomplete-disable", - name: "Autocomplete Disable", + name: "Autocomplete disable", checkCallback: (checking) => { if (checking) { return this.settings.autocompleteEnabled; @@ -295,7 +295,7 @@ export default class InfioPlugin extends Plugin { this.addCommand({ id: "ai-inline-edit", - name: "Inline Edit", + name: "Inline edit", // hotkeys: [ // { // modifiers: ['Mod', 'Shift'], diff --git a/src/settings/AutoCompleteSettings.tsx b/src/settings/AutoCompleteSettings.tsx deleted file mode 100644 index 58eb6bf..0000000 --- a/src/settings/AutoCompleteSettings.tsx +++ /dev/null @@ -1,610 +0,0 @@ -import { Notice } from "obsidian"; -import * as React from "react"; -import { useState } from "react"; - -import { - InfioSettings, -} from '../types/settings'; -import { checkForErrors } from "../utils/auto-complete"; - -import CheckBoxSettingItem from "./components/CheckBoxSettingItem"; -import FewShotExampleSettings from "./components/FewShotExampleSettings"; -import SettingsItem from "./components/SettingsItem"; -import SliderSettingsItem from "./components/SliderSettingsItem"; -import TextSettingItem from "./components/TextSettingItem"; -import TriggerSettings from "./components/TriggerSettings"; -import { - MAX_DELAY, - MAX_FREQUENCY_PENALTY, - MAX_MAX_CHAR_LIMIT, - MAX_MAX_TOKENS, - MAX_PRESENCE_PENALTY, - MAX_TEMPERATURE, - MAX_TOP_P, - MIN_DELAY, - MIN_FREQUENCY_PENALTY, - MIN_MAX_CHAR_LIMIT, - MIN_MAX_TOKENS, - MIN_PRESENCE_PENALTY, - MIN_TEMPERATURE, - MIN_TOP_P -} from "./versions"; - -type IProps = { - onSettingsChanged(settings: InfioSettings): void; - - settings: InfioSettings; -} - -export default function AutoCompleteSettings(props: IProps): React.JSX.Element { - const [settings, _setSettings] = useState(props.settings); - const errors = checkForErrors(settings); - - React.useEffect(() => { - _setSettings(props.settings); - }, [props.settings]); - - const updateSettings = (update: Partial) => { - _setSettings((settings: InfioSettings) => { - const newSettings = { ...settings, ...update }; - props.onSettingsChanged(newSettings); - return newSettings; - }); - }; - const resetSettings = () => { - // const azureOAIApiSettings = settings.azureOAIApiSettings, - // const openAIApiSettings = settings.openAIApiSettings, - // const ollamaApiSettings = settings.ollamaApiSettings - - // const newSettings: SmartCopilotSettings = { - // ...settings - // azureOAIApiSettings, - // openAIApiSettings, - // ollamaApiSettings, - // advancedMode: settings.advancedMode, - // }; - // updateSettings(newSettings); - new Notice("Factory reset complete."); - }; - - - // const renderAPISettings = () => { - // if (settings.apiProvider === "azure") { - // return ( - // <> - // - // updateSettings({ - // azureOAIApiSettings: { - // ...settings.azureOAIApiSettings, - // url: value, - // }, - // }) - // } - // /> - // - // updateSettings({ - // azureOAIApiSettings: { - // ...settings.azureOAIApiSettings, - // key: value, - // }, - // }) - // } - // /> - // - // - // ); - // } - // if (settings.apiProvider === "openai") { - // return ( - // <> - // - // updateSettings({ - // openAIApiSettings: { - // ...settings.openAIApiSettings, - // url: value, - // }, - // }) - // } - // /> - // - // updateSettings({ - // openAIApiSettings: { - // ...settings.openAIApiSettings, - // key: value, - // }, - // }) - // } - // /> - // - // updateSettings({ - // openAIApiSettings: { - // ...settings.openAIApiSettings, - // model: value, - // } - // }) - // } - // errorMessage={errors.get("openAIApiSettings.model")} - // /> - - // - // - // ); - // } - // if (settings.apiProvider === "ollama") { - // return ( - // <> - // - // updateSettings({ - // ollamaApiSettings: { - // ...settings.ollamaApiSettings, - // url: value, - // }, - // }) - // } - // /> - // - // updateSettings({ - // ollamaApiSettings: { - // ...settings.ollamaApiSettings, - // model: value, - // } - // }) - // } - // errorMessage={errors.get("ollamaApiSettings.model")} - // /> - - // - // - // ); - // } - // }; - - return ( -
-

AutoComplete

- updateSettings({ autocompleteEnabled: value })} - /> - updateSettings({ cacheSuggestions: value })} - /> - {/* { - if (value === "openai" || value === "azure" || value === "ollama") { - updateSettings({ apiProvider: value }); - } - }} - options={{ - openai: "OpenAI API", - azure: "Azure OAI API", - ollama: "Self-hosted OLLAMA API" - }} - errorMessage={errors.get("apiProvider")} - /> */} - updateSettings({ debugMode: value })} - /> - {/*

API

- {renderAPISettings()} */} -

Model Options

- - updateSettings({ - modelOptions: { - ...settings.modelOptions, - temperature: value, - }, - }) - } - min={MIN_TEMPERATURE} - max={MAX_TEMPERATURE} - step={0.05} - /> - - updateSettings({ - modelOptions: { - ...settings.modelOptions, - top_p: value, - }, - }) - } - min={MIN_TOP_P} - max={MAX_TOP_P} - step={0.05} - /> - {settings.apiProvider !== "ollama" && (<> - - updateSettings({ - modelOptions: { - ...settings.modelOptions, - frequency_penalty: value, - }, - }) - } - min={MIN_FREQUENCY_PENALTY} - max={MAX_FREQUENCY_PENALTY} - step={0.05} - /> - - updateSettings({ - modelOptions: { - ...settings.modelOptions, - presence_penalty: value, - }, - }) - } - min={MIN_PRESENCE_PENALTY} - max={MAX_PRESENCE_PENALTY} - step={0.05} - /> - - updateSettings({ - modelOptions: { - ...settings.modelOptions, - max_tokens: value, - }, - }) - } - min={MIN_MAX_TOKENS} - max={MAX_MAX_TOKENS} - step={10} - /> - )} - -

Preprocessing

- - updateSettings({ dontIncludeDataviews: value }) - } - /> - - updateSettings({ maxPrefixCharLimit: value }) - } - min={MIN_MAX_CHAR_LIMIT} - max={MAX_MAX_CHAR_LIMIT} - step={100} - suffix={" chars"} - /> - - updateSettings({ maxSuffixCharLimit: value }) - } - min={MIN_MAX_CHAR_LIMIT} - max={MAX_MAX_CHAR_LIMIT} - step={100} - suffix={" chars"} - /> -

Postprocessing

- - updateSettings({ removeDuplicateMathBlockIndicator: value }) - } - /> - - updateSettings({ removeDuplicateCodeBlockIndicator: value }) - } - /> - -

Trigger

- updateSettings({ delay: value })} - min={MIN_DELAY} - max={MAX_DELAY} - step={100} - suffix={"ms"} - /> - updateSettings({ triggers })} - errorMessage={errors.get("triggerWords")} - errorMessages={errors} - /> -

Privacy

- -

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:

-
    -
  • path/to/folder/**: This pattern ignores all files and sub folders within - this folder. -
  • -
  • "**/secret/**": This pattern ignores any file located inside a 'secret' - directory, - regardless of its location in the path. -
  • -
  • !path/to/folder/example.md: This pattern explicitly undoes an ignore, - making this file noticeable to the plugin. -
  • -
  • **/*Python*.md: This pattern ignores any file with 'Python' in its name, - irrespective of its location. -
  • -
-
- } - display={"block"} - errorMessage={errors.get("ignoredFilePatterns")} - > -