Commit 6d4b331 1 parent a6bb554 commit 6d4b331 Copy full SHA for 6d4b331
File tree 2 files changed +9
-5
lines changed
projects/app/src/service/moduleDispatch/agent
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ import {
24
24
ChatCompletionTool
25
25
} from '@fastgpt/global/core/ai/type' ;
26
26
import { DispatchNodeResultType } from '@fastgpt/global/core/module/runtime/type' ;
27
+ import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt' ;
27
28
28
29
type Props = ModuleDispatchProps < {
29
30
[ ModuleInputKeyEnum . aiModel ] : string ;
@@ -125,7 +126,7 @@ const getFunctionCallSchema = ({
125
126
? `<背景知识>
126
127
${ systemPrompt }
127
128
</背景知识>
128
-
129
+
129
130
问题: "${ userChatInput } "
130
131
`
131
132
: userChatInput
@@ -284,7 +285,9 @@ const completions = async ({
284
285
typeList : agents
285
286
. map ( ( item ) => `{"questionType": "${ item . value } ", "typeId": "${ item . key } "}` )
286
287
. join ( '\n' ) ,
287
- history : histories . map ( ( item ) => `${ item . obj } :${ item . value } ` ) . join ( '\n' ) ,
288
+ history : histories
289
+ . map ( ( item ) => `${ item . obj } :${ chatValue2RuntimePrompt ( item . value ) . text } ` )
290
+ . join ( '\n' ) ,
288
291
question : userChatInput
289
292
} )
290
293
}
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
} from '@fastgpt/global/core/ai/type' ;
26
26
import { ChatCompletionRequestMessageRoleEnum } from '@fastgpt/global/core/ai/constants' ;
27
27
import { DispatchNodeResultType } from '@fastgpt/global/core/module/runtime/type' ;
28
+ import { chatValue2RuntimePrompt } from '@fastgpt/global/core/chat/adapt' ;
28
29
29
30
type Props = ModuleDispatchProps < {
30
31
[ ModuleInputKeyEnum . history ] ?: ChatItemType [ ] ;
@@ -160,7 +161,7 @@ const getFunctionCallSchema = ({
160
161
- 字符串不要换行。
161
162
- 结合上下文和当前问题进行获取。
162
163
"""
163
-
164
+
164
165
当前问题: "${ content } "`
165
166
}
166
167
}
@@ -325,8 +326,8 @@ const completions = async ({
325
326
} }`
326
327
)
327
328
. join ( '\n' ) ,
328
- text : `${ histories . map ( ( item ) => `${ item . obj } :${ item . value } ` ) . join ( '\n' ) }
329
- Human: ${ content } `
329
+ text : `${ histories . map ( ( item ) => `${ item . obj } :${ chatValue2RuntimePrompt ( item . value ) . text } ` ) . join ( '\n' ) }
330
+ Human: ${ content } `
330
331
} )
331
332
}
332
333
}
You can’t perform that action at this time.
0 commit comments