Browse Source

Fix: prompt of expert mode (#3168)

tags/0.6.0-fix1
KVOJJJin 1 year ago
parent
commit
d8db728c33
No account linked to committer's email address
2 changed files with 11 additions and 2 deletions
  1. 4
    1
      web/app/components/app/configuration/index.tsx
  2. 7
    1
      web/config/index.ts

+ 4
- 1
web/app/components/app/configuration/index.tsx View File

const promptMode = modelConfig.prompt_type === PromptMode.advanced ? PromptMode.advanced : PromptMode.simple const promptMode = modelConfig.prompt_type === PromptMode.advanced ? PromptMode.advanced : PromptMode.simple
doSetPromptMode(promptMode) doSetPromptMode(promptMode)
if (promptMode === PromptMode.advanced) { if (promptMode === PromptMode.advanced) {
setChatPromptConfig(modelConfig.chat_prompt_config || clone(DEFAULT_CHAT_PROMPT_CONFIG) as any)
if (modelConfig.chat_prompt_config && modelConfig.chat_prompt_config.prompt.length > 0)
setChatPromptConfig(modelConfig.chat_prompt_config)
else
setChatPromptConfig(clone(DEFAULT_CHAT_PROMPT_CONFIG) as any)
setCompletionPromptConfig(modelConfig.completion_prompt_config || clone(DEFAULT_COMPLETION_PROMPT_CONFIG) as any) setCompletionPromptConfig(modelConfig.completion_prompt_config || clone(DEFAULT_COMPLETION_PROMPT_CONFIG) as any)
setCanReturnToSimpleMode(false) setCanReturnToSimpleMode(false)
} }

+ 7
- 1
web/config/index.ts View File

/* eslint-disable import/no-mutable-exports */ /* eslint-disable import/no-mutable-exports */
import { InputVarType } from '@/app/components/workflow/types' import { InputVarType } from '@/app/components/workflow/types'
import { AgentStrategy } from '@/types/app' import { AgentStrategy } from '@/types/app'
import { PromptRole } from '@/models/debug'


export let apiPrefix = '' export let apiPrefix = ''
export let publicApiPrefix = '' export let publicApiPrefix = ''
] ]


export const DEFAULT_CHAT_PROMPT_CONFIG = { export const DEFAULT_CHAT_PROMPT_CONFIG = {
prompt: [],
prompt: [
{
role: PromptRole.system,
text: '',
},
],
} }


export const DEFAULT_COMPLETION_PROMPT_CONFIG = { export const DEFAULT_COMPLETION_PROMPT_CONFIG = {

Loading…
Cancel
Save