Skip to content

Commit

Permalink
fix: prompt role 判断错误
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark committed Nov 15, 2024
1 parent da4a0c8 commit f66939d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/buildinfo.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/lib/core/src/agent/anthropic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Anthropic implements ChatAgent {
'content-type': 'application/json',
};

if (messages.length > 0 && messages[0].role === 'assistant') {
if (messages.length > 0 && messages[0].role === 'system') {
messages.shift();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/lib/core/src/config/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const BUILD_TIMESTAMP = 1731589675;
export const BUILD_VERSION = '463cf14';
export const BUILD_TIMESTAMP = 1731634114;
export const BUILD_VERSION = 'da4a0c8';
2 changes: 1 addition & 1 deletion packages/lib/next/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class NextChatAgent implements ChatAgent {
}
if (params.prompt) {
params.messages.unshift({
role: 'assistant',
role: 'system',
content: params.prompt,
});
}
Expand Down

0 comments on commit f66939d

Please sign in to comment.