fix merging mistake
This commit is contained in:
parent
4838cfceb9
commit
2e9a7e216f
1 changed files with 1 additions and 17 deletions
|
|
@ -98,23 +98,7 @@ class Anthropic extends BaseLLM {
|
|||
messages: ChatMessage[],
|
||||
options: CompletionOptions,
|
||||
): AsyncGenerator<ChatMessage> {
|
||||
const shouldCacheSystemMessage =
|
||||
!!this.cacheSystemMessage;
|
||||
|
||||
const body = JSON.stringify({
|
||||
...this._convertArgs(options),
|
||||
messages: this._convertMessages(messages),
|
||||
system: shouldCacheSystemMessage
|
||||
? [
|
||||
{
|
||||
type: "text",
|
||||
text: this.systemMessage,
|
||||
cache_control: { type: "ephemeral" },
|
||||
},
|
||||
]
|
||||
: this.systemMessage,
|
||||
});
|
||||
|
||||
const shouldCacheSystemMessage = !!this.systemMessage && !!this.cacheSystemMessage;
|
||||
const systemMessage: string = stripImages(
|
||||
messages.filter((m) => m.role === "system")[0]?.content,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue