🤖 feat: Claude 3.5 Haiku (#4629)

This commit is contained in:
Danny Avila 2024-11-04 15:10:24 -05:00 committed by GitHub
parent 2e519f9b57
commit fc41032923
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 28 additions and 4 deletions

View file

@ -98,8 +98,8 @@ class AnthropicClient extends BaseClient {
);
const modelMatch = matchModelName(this.modelOptions.model, EModelEndpoint.anthropic);
this.isClaude3 = modelMatch.startsWith('claude-3');
this.isLegacyOutput = !modelMatch.startsWith('claude-3-5-sonnet');
this.isClaude3 = modelMatch.includes('claude-3');
this.isLegacyOutput = !modelMatch.includes('claude-3-5-sonnet');
this.supportsCacheControl =
this.options.promptCache && this.checkPromptCacheSupport(modelMatch);
@ -634,7 +634,7 @@ class AnthropicClient extends BaseClient {
);
};
if (this.modelOptions.model.startsWith('claude-3')) {
if (this.modelOptions.model.includes('claude-3')) {
await buildMessagesPayload();
processTokens();
return {
@ -687,6 +687,7 @@ class AnthropicClient extends BaseClient {
}
if (
modelMatch === 'claude-3-5-sonnet' ||
modelMatch === 'claude-3-5-haiku' ||
modelMatch === 'claude-3-haiku' ||
modelMatch === 'claude-3-opus'
) {