Skip to content

Commit

Permalink
fix: NextChatAgent prompt拼接逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Nov 14, 2024
1 parent 226c08d commit f373dde
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/lib/next/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,14 @@ export class NextChatAgent implements ChatAgent {
if (!model) {
throw new Error('Model not found');
}
if (params.prompt) {
params.messages.unshift({
role: 'assistant',
content: params.prompt,
});
}
return requestChatCompletionsV2({
model: this.providerCreator(context).languageModel(model),
prompt: params.prompt,
messages: params.messages,
}, onStream);
};
Expand Down

0 comments on commit f373dde

Please sign in to comment.