fix conversation retrieval qa agent original prompt
This commit is contained in:
parent
af5efaa751
commit
d37bc6acf6
|
|
@ -5,6 +5,8 @@ import { flatten } from 'lodash'
|
||||||
import { BaseChatMemory } from 'langchain/memory'
|
import { BaseChatMemory } from 'langchain/memory'
|
||||||
import { ConsoleCallbackHandler, CustomChainHandler } from '../../../src/handler'
|
import { ConsoleCallbackHandler, CustomChainHandler } from '../../../src/handler'
|
||||||
|
|
||||||
|
const defaultMessage = `Do your best to answer the questions. Feel free to use any tools available to look up relevant information, only if necessary.`
|
||||||
|
|
||||||
class ConversationalRetrievalAgent_Agents implements INode {
|
class ConversationalRetrievalAgent_Agents implements INode {
|
||||||
label: string
|
label: string
|
||||||
name: string
|
name: string
|
||||||
|
|
@ -46,6 +48,7 @@ class ConversationalRetrievalAgent_Agents implements INode {
|
||||||
label: 'System Message',
|
label: 'System Message',
|
||||||
name: 'systemMessage',
|
name: 'systemMessage',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
|
default: defaultMessage,
|
||||||
rows: 4,
|
rows: 4,
|
||||||
optional: true,
|
optional: true,
|
||||||
additionalParams: true
|
additionalParams: true
|
||||||
|
|
@ -65,7 +68,7 @@ class ConversationalRetrievalAgent_Agents implements INode {
|
||||||
agentType: 'openai-functions',
|
agentType: 'openai-functions',
|
||||||
verbose: process.env.DEBUG === 'true' ? true : false,
|
verbose: process.env.DEBUG === 'true' ? true : false,
|
||||||
agentArgs: {
|
agentArgs: {
|
||||||
prefix: systemMessage ?? `You are a helpful AI assistant.`
|
prefix: systemMessage ?? defaultMessage
|
||||||
},
|
},
|
||||||
returnIntermediateSteps: true
|
returnIntermediateSteps: true
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue