Merge branch 'main' into feature/Indexing

# Conflicts:
#	pnpm-lock.yaml
This commit is contained in:
Henry
2024-03-15 15:30:37 +08:00
parent 1459190adc
commit fa081acea0
8 changed files with 30021 additions and 30205 deletions
@@ -3,7 +3,7 @@ import { BaseCache } from '@langchain/core/caches'
import { BaseLLMParams } from '@langchain/core/language_models/llms'
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
import { ChatAnthropic } from './FlowiseChatAntrhopic'
import { ChatAnthropic } from './FlowiseChatAnthropic'
class ChatAnthropic_ChatModels implements INode {
label: string
@@ -20,7 +20,7 @@ class ChatAnthropic_ChatModels implements INode {
constructor() {
this.label = 'ChatAnthropic'
this.name = 'chatAnthropic'
this.version = 4.0
this.version = 5.0
this.type = 'ChatAnthropic'
this.icon = 'Anthropic.svg'
this.category = 'Chat Models'
@@ -44,6 +44,11 @@ class ChatAnthropic_ChatModels implements INode {
name: 'modelName',
type: 'options',
options: [
{
label: 'claude-3-haiku',
name: 'claude-3-haiku-20240307',
description: 'Fastest and most compact model, designed for near-instant responsiveness'
},
{
label: 'claude-3-opus',
name: 'claude-3-opus-20240229',
@@ -55,66 +60,22 @@ class ChatAnthropic_ChatModels implements INode {
description: 'Ideal balance of intelligence and speed for enterprise workloads'
},
{
label: 'claude-2',
name: 'claude-2',
label: 'claude-2.0 (legacy)',
name: 'claude-2.0',
description: 'Claude 2 latest major version, automatically get updates to the model as they are released'
},
{
label: 'claude-2.1',
label: 'claude-2.1 (legacy)',
name: 'claude-2.1',
description: 'Claude 2 latest full version'
},
{
label: 'claude-instant-1',
name: 'claude-instant-1',
label: 'claude-instant-1.2 (legacy)',
name: 'claude-instant-1.2',
description: 'Claude Instant latest major version, automatically get updates to the model as they are released'
},
{
label: 'claude-v1',
name: 'claude-v1'
},
{
label: 'claude-v1-100k',
name: 'claude-v1-100k'
},
{
label: 'claude-v1.0',
name: 'claude-v1.0'
},
{
label: 'claude-v1.2',
name: 'claude-v1.2'
},
{
label: 'claude-v1.3',
name: 'claude-v1.3'
},
{
label: 'claude-v1.3-100k',
name: 'claude-v1.3-100k'
},
{
label: 'claude-instant-v1',
name: 'claude-instant-v1'
},
{
label: 'claude-instant-v1-100k',
name: 'claude-instant-v1-100k'
},
{
label: 'claude-instant-v1.0',
name: 'claude-instant-v1.0'
},
{
label: 'claude-instant-v1.1',
name: 'claude-instant-v1.1'
},
{
label: 'claude-instant-v1.1-100k',
name: 'claude-instant-v1.1-100k'
}
],
default: 'claude-2',
default: 'claude-3-haiku',
optional: true
},
{
@@ -1,6 +1,6 @@
import { AnthropicInput, ChatAnthropic as LangchainChatAnthropic } from '@langchain/anthropic'
import { IVisionChatModal, IMultiModalOption } from '../../../src'
import { BaseLLMParams } from '@langchain/core/language_models/llms'
import { IVisionChatModal, IMultiModalOption } from '../../../src'
export class ChatAnthropic extends LangchainChatAnthropic implements IVisionChatModal {
configuredModel: string
@@ -11,7 +11,7 @@ export class ChatAnthropic extends LangchainChatAnthropic implements IVisionChat
constructor(id: string, fields: Partial<AnthropicInput> & BaseLLMParams & { anthropicApiKey?: string }) {
super(fields)
this.id = id
this.configuredModel = fields?.modelName || 'claude-3-opus-20240229'
this.configuredModel = fields?.modelName || 'claude-3-haiku-20240307'
this.configuredMaxToken = fields?.maxTokens ?? 256
}
@@ -26,7 +26,7 @@ export class ChatAnthropic extends LangchainChatAnthropic implements IVisionChat
setVisionModel(): void {
if (!this.modelName.startsWith('claude-3')) {
super.modelName = 'claude-3-opus-20240229'
super.modelName = 'claude-3-haiku-20240307'
super.maxTokens = 1024
}
}