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)
}
...
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.
Default tab title text if it is not set through store data for that tab.
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'
}
],
...
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
.
Just auto focus to prompt input field after every response arrival or initialization.
default: true
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
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