frontend feature adaptation for api params (user_name, assistant_name, presystem)
This commit is contained in:
parent
f89e89c1c9
commit
fcfaa5944e
@ -250,5 +250,8 @@
|
||||
"VRAM": "VRAM",
|
||||
"GPU Usage": "GPU使用率",
|
||||
"Use Custom Tokenizer": "カスタムトークナイザーを使用する",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "トークナイザーパス (例: backend-python/rwkv_pip/20B_tokenizer.json)"
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "トークナイザーパス (例: backend-python/rwkv_pip/20B_tokenizer.json)",
|
||||
"User Name": "ユーザー名",
|
||||
"Assistant Name": "アシスタント名",
|
||||
"Insert default system prompt at the beginning": "最初にデフォルトのシステムプロンプトを挿入"
|
||||
}
|
@ -250,5 +250,8 @@
|
||||
"VRAM": "显存",
|
||||
"GPU Usage": "GPU占用",
|
||||
"Use Custom Tokenizer": "使用自定义Tokenizer",
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "Tokenizer路径 (例如: backend-python/rwkv_pip/20B_tokenizer.json)"
|
||||
"Tokenizer Path (e.g. backend-python/rwkv_pip/20B_tokenizer.json)": "Tokenizer路径 (例如: backend-python/rwkv_pip/20B_tokenizer.json)",
|
||||
"User Name": "用户名称",
|
||||
"Assistant Name": "AI名称",
|
||||
"Insert default system prompt at the beginning": "在开头自动插入默认系统提示"
|
||||
}
|
@ -312,7 +312,10 @@ const ChatPanel: FC = observer(() => {
|
||||
stream: true,
|
||||
model: commonStore.settings.apiChatModelName, // 'gpt-3.5-turbo'
|
||||
temperature: apiParams.temperature,
|
||||
top_p: apiParams.topP
|
||||
top_p: apiParams.topP,
|
||||
user_name: commonStore.activePreset?.userName,
|
||||
assistant_name: commonStore.activePreset?.assistantName,
|
||||
presystem: commonStore.activePreset?.presystem
|
||||
}),
|
||||
signal: chatSseController?.signal,
|
||||
onmessage(e) {
|
||||
|
@ -56,6 +56,9 @@ export type Preset = {
|
||||
stop: string,
|
||||
injectStart: string,
|
||||
injectEnd: string,
|
||||
presystem?: boolean,
|
||||
userName?: string,
|
||||
assistantName?: string
|
||||
}
|
||||
|
||||
export const defaultPreset: Preset = {
|
||||
@ -255,9 +258,36 @@ export const ChatPresetEditor: FC<{
|
||||
} />
|
||||
{
|
||||
editingMessages ?
|
||||
<MessagesEditor /> :
|
||||
<div className="flex flex-col gap-1">
|
||||
<Labeled flex spaceBetween label={t('Insert default system prompt at the beginning')}
|
||||
content={
|
||||
<Switch checked={editingPreset.presystem === undefined ? true : editingPreset.presystem}
|
||||
onChange={(e, data) => {
|
||||
setEditingPreset({
|
||||
presystem: data.checked
|
||||
});
|
||||
}} />
|
||||
} />
|
||||
<Labeled flex breakline label={t('User Name')}
|
||||
content={
|
||||
<Input placeholder="User" value={editingPreset.userName} onChange={(e, data) => {
|
||||
setEditingPreset({
|
||||
userName: data.value
|
||||
});
|
||||
}} />
|
||||
} />
|
||||
<Labeled flex breakline label={t('Assistant Name')}
|
||||
content={
|
||||
<Input placeholder="Assistant" value={editingPreset.assistantName} onChange={(e, data) => {
|
||||
setEditingPreset({
|
||||
assistantName: data.value
|
||||
});
|
||||
}} />
|
||||
} />
|
||||
<MessagesEditor />
|
||||
</div> :
|
||||
<div className="flex flex-col gap-1 p-2 overflow-x-hidden overflow-y-auto">
|
||||
<Labeled flex breakline label={`${t('Description')} (${t("Preview Only")})`}
|
||||
<Labeled flex breakline label={`${t('Description')} (${t('Preview Only')})`}
|
||||
content={
|
||||
<Input value={editingPreset.desc} onChange={(e, data) => {
|
||||
setEditingPreset({
|
||||
|
Loading…
Reference in New Issue
Block a user