Skip to content

Latest commit

 

History

History
238 lines (180 loc) · 6.47 KB

CONFIG.md

File metadata and controls

238 lines (180 loc) · 6.47 KB

MynahUI Config

You can set the config from the constructor parameters while creating a new instance of mynah-ui.

Note: You cannot set it on runtime. It is getting used just once during the initialization.

...
interface ConfigModel {
    // Do not forget that you have to provide all of them
    // Config allows partial set of texts
    texts: {
        mainTitle?: string;
        feedbackFormTitle?: string;
        feedbackFormOptionsLabel?: string;
        feedbackFormCommentLabel?: string;
        feedbackThanks?: string;
        feedbackReportButtonLabel?: string;
        codeSuggestions?: string;
        files?: string;
        insertAtCursorLabel?: string;
        copy?: string;
        showMore?: string;
        save?: string;
        cancel?: string;
        submit?: string;
        pleaseSelect?: string;
        stopGenerating?: string;
        copyToClipboard?: string;
        noMoreTabsTooltip?: string;
        codeSuggestionWithReferenceTitle?: string;
        spinnerText?: string;
        tabCloseConfirmationMessage?: string;
        tabCloseConfirmationKeepButton?: string;
        tabCloseConfirmationCloseButton?: string;
    };
    // Options to show up on the overlay feedback form
    // after user clicks to downvote on a chat item
    // and clicks 'Report' again
    feedbackOptions: Array<{
        label: string;
        value: string;
    }>;
    maxUserInput: number; // max number of chars for the input field
    autoFocus: boolean; // auto focuses to input panel after every action
    maxTabs: number; // set 1 to hide tabs panel
    showPromptField: boolean; // shows prompt field (default: true)
}
...


texts

All static texts will be shown on UI. Please take a look at each image to identify which text blongs to which item on UI.

mainTitle

Default tab title text if it is not set through store data for that tab.

mainTitle


feedbackFormTitle, feedbackFormOptionsLabel, feedbackFormCommentLabel, submit, cancel

feedbackForm


fileTreeTitle, rootFolderTitle, feedbackFormCommentLabel, submit, cancel

fileTree


pleaseSelect

feedbackForm


feedbackThanks, feedbackReportButtonLabel, showMore

voteAndSourceActions


stopGenerating

stopGenerating


insertAtCursorLabel, copy

copyInsertToCursor


codeSuggestions, files, codeSuggestionWithReferenceTitle

codeFileSuggestions


spinnerText

spinnerText


tabCloseConfirmationMessage, tabCloseConfirmationKeepButton, tabCloseConfirmationCloseButton

tabCloseConfirmation


noMoreTabsTooltip

noMoreTabsTooltip



feedbackOptions

Feedback type options to be shown on feedback form. defaults:

...
feedbackOptions: [
    {
      value: 'inaccurate-response',
      label: 'Inaccurate response',
    },
    {
      value: 'harmful-content',
      label: 'Harmful content'
    },
    {
      value: 'overlap',
      label: 'Overlaps with existing content'
    },
    {
      value: 'incorrect-syntax',
      label: 'Incorrect syntax'
    },
    {
      value: 'buggy-code',
      label: 'Buggy code'
    },
    {
      value: 'low-quality',
      label: 'Low quality'
    },
    {
      value: 'other',
      label: 'Other'
    }
  ],
...

feedbackOptions



maxTabs

Maximum number of tabs user/system can open in a single instance of mynah-ui.

default: 1000

An important note here is that if you provide 1 to maxTabs, it will not show the tab bar at all. However you still need to add a tab then initially to show a content.

And finally, if you try to add tabs more than given maxTabs amount while initializing the MynahUI with Constructor Properties, it will only generate the tabs till it reaches the maxTabs limit.

Assume that you've provided 1 for maxTabs.

maxTabs1



autoFocus

Just auto focus to prompt input field after every response arrival or initialization.

default: true



maxUserInput

Max number of chars user can insert into the prompt field. But, as might know you can also add code attachments under the prompt field. A treshold of 96 chars will be automatically reduced from the maxUserInput.

So beware that if you want 4000 chars exact, you need to give 4096 to the config.

default: 4096



showPromptField

Show or hide the prompt input field completely. You may want to hide the prompt field by setting showPromptField to false to make the chat work one way only. Just to provide answers or information.

default: true

If you set showPromptField to false

noPrompt