mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
Feature/externalize model list (#2113)
* fixes * test json * test json * externalize model list * externalize model list * correcting awsChatBedRock Name * lint fixes * externalize models * externalize chat models * externalize chat models * externalize llm models * externalize llm models * lint fixes * addition of models for ChatMistral * updating version numbers for all imapacted nodes. * marketplace template updates * update embeddings, marketplaces, add chatCohere * config changes for new env variable * removal of local models.json * update models json file --------- Co-authored-by: Henry <hzj94@hotmail.com>
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
|
||||
import { BaseBedrockInput } from '@langchain/community/dist/utils/bedrock'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { BedrockChat } from './FlowiseAWSChatBedrock'
|
||||
import { getModels, getRegions, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
/**
|
||||
* @author Michael Connor <mlconnor@yahoo.com>
|
||||
@@ -23,7 +24,7 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'AWS ChatBedrock'
|
||||
this.name = 'awsChatBedrock'
|
||||
this.version = 4.0
|
||||
this.version = 5.0
|
||||
this.type = 'AWSChatBedrock'
|
||||
this.icon = 'aws.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -46,61 +47,15 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
{
|
||||
label: 'Region',
|
||||
name: 'region',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'af-south-1', name: 'af-south-1' },
|
||||
{ label: 'ap-east-1', name: 'ap-east-1' },
|
||||
{ label: 'ap-northeast-1', name: 'ap-northeast-1' },
|
||||
{ label: 'ap-northeast-2', name: 'ap-northeast-2' },
|
||||
{ label: 'ap-northeast-3', name: 'ap-northeast-3' },
|
||||
{ label: 'ap-south-1', name: 'ap-south-1' },
|
||||
{ label: 'ap-south-2', name: 'ap-south-2' },
|
||||
{ label: 'ap-southeast-1', name: 'ap-southeast-1' },
|
||||
{ label: 'ap-southeast-2', name: 'ap-southeast-2' },
|
||||
{ label: 'ap-southeast-3', name: 'ap-southeast-3' },
|
||||
{ label: 'ap-southeast-4', name: 'ap-southeast-4' },
|
||||
{ label: 'ap-southeast-5', name: 'ap-southeast-5' },
|
||||
{ label: 'ap-southeast-6', name: 'ap-southeast-6' },
|
||||
{ label: 'ca-central-1', name: 'ca-central-1' },
|
||||
{ label: 'ca-west-1', name: 'ca-west-1' },
|
||||
{ label: 'cn-north-1', name: 'cn-north-1' },
|
||||
{ label: 'cn-northwest-1', name: 'cn-northwest-1' },
|
||||
{ label: 'eu-central-1', name: 'eu-central-1' },
|
||||
{ label: 'eu-central-2', name: 'eu-central-2' },
|
||||
{ label: 'eu-north-1', name: 'eu-north-1' },
|
||||
{ label: 'eu-south-1', name: 'eu-south-1' },
|
||||
{ label: 'eu-south-2', name: 'eu-south-2' },
|
||||
{ label: 'eu-west-1', name: 'eu-west-1' },
|
||||
{ label: 'eu-west-2', name: 'eu-west-2' },
|
||||
{ label: 'eu-west-3', name: 'eu-west-3' },
|
||||
{ label: 'il-central-1', name: 'il-central-1' },
|
||||
{ label: 'me-central-1', name: 'me-central-1' },
|
||||
{ label: 'me-south-1', name: 'me-south-1' },
|
||||
{ label: 'sa-east-1', name: 'sa-east-1' },
|
||||
{ label: 'us-east-1', name: 'us-east-1' },
|
||||
{ label: 'us-east-2', name: 'us-east-2' },
|
||||
{ label: 'us-gov-east-1', name: 'us-gov-east-1' },
|
||||
{ label: 'us-gov-west-1', name: 'us-gov-west-1' },
|
||||
{ label: 'us-west-1', name: 'us-west-1' },
|
||||
{ label: 'us-west-2', name: 'us-west-2' }
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listRegions',
|
||||
default: 'us-east-1'
|
||||
},
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'anthropic.claude-3-haiku', name: 'anthropic.claude-3-haiku-20240307-v1:0' },
|
||||
{ label: 'anthropic.claude-3-sonnet', name: 'anthropic.claude-3-sonnet-20240229-v1:0' },
|
||||
{ label: 'anthropic.claude-instant-v1', name: 'anthropic.claude-instant-v1' },
|
||||
{ label: 'anthropic.claude-v2:1', name: 'anthropic.claude-v2:1' },
|
||||
{ label: 'anthropic.claude-v2', name: 'anthropic.claude-v2' },
|
||||
{ label: 'meta.llama2-13b-chat-v1', name: 'meta.llama2-13b-chat-v1' },
|
||||
{ label: 'meta.llama2-70b-chat-v1', name: 'meta.llama2-70b-chat-v1' },
|
||||
{ label: 'mistral.mistral-7b-instruct-v0:2', name: 'mistral.mistral-7b-instruct-v0:2' },
|
||||
{ label: 'mistral.mixtral-8x7b-instruct-v0:1', name: 'mistral.mixtral-8x7b-instruct-v0:1' }
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'anthropic.claude-3-haiku'
|
||||
},
|
||||
{
|
||||
@@ -142,6 +97,16 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'awsChatBedrock')
|
||||
},
|
||||
async listRegions(): Promise<INodeOptionsValue[]> {
|
||||
return await getRegions(MODEL_TYPE.CHAT, 'awsChatBedrock')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const iRegion = nodeData.inputs?.region as string
|
||||
const iModel = nodeData.inputs?.model as string
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { AzureOpenAIInput, ChatOpenAI as LangchainChatOpenAI, OpenAIChatInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { ChatOpenAI } from '../ChatOpenAI/FlowiseChatOpenAI'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class AzureChatOpenAI_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -20,7 +21,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'Azure ChatOpenAI'
|
||||
this.name = 'azureChatOpenAI'
|
||||
this.version = 3.0
|
||||
this.version = 4.0
|
||||
this.type = 'AzureChatOpenAI'
|
||||
this.icon = 'Azure.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -42,31 +43,8 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gpt-4',
|
||||
name: 'gpt-4'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k',
|
||||
name: 'gpt-4-32k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-35-turbo',
|
||||
name: 'gpt-35-turbo'
|
||||
},
|
||||
{
|
||||
label: 'gpt-35-turbo-16k',
|
||||
name: 'gpt-35-turbo-16k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-vision-preview',
|
||||
name: 'gpt-4-vision-preview'
|
||||
}
|
||||
],
|
||||
default: 'gpt-35-turbo',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -151,6 +129,13 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'azureChatOpenAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
|
||||
+13
-23
@@ -1,6 +1,7 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { OpenAI, ALL_AVAILABLE_OPENAI_MODELS } from 'llamaindex'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
interface AzureOpenAIConfig {
|
||||
apiKey?: string
|
||||
@@ -25,7 +26,7 @@ class AzureChatOpenAI_LlamaIndex_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'AzureChatOpenAI'
|
||||
this.name = 'azureChatOpenAI_LlamaIndex'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'AzureChatOpenAI'
|
||||
this.icon = 'Azure.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -42,27 +43,9 @@ class AzureChatOpenAI_LlamaIndex_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gpt-4',
|
||||
name: 'gpt-4'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k',
|
||||
name: 'gpt-4-32k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo',
|
||||
name: 'gpt-3.5-turbo'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-16k',
|
||||
name: 'gpt-3.5-turbo-16k'
|
||||
}
|
||||
],
|
||||
default: 'gpt-3.5-turbo-16k',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'gpt-3.5-turbo-16k'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -99,6 +82,13 @@ class AzureChatOpenAI_LlamaIndex_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'azureChatOpenAI_LlamaIndex')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as keyof typeof ALL_AVAILABLE_OPENAI_MODELS
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { AnthropicInput, ChatAnthropic as LangchainChatAnthropic } from '@langchain/anthropic'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { ChatAnthropic } from './FlowiseChatAnthropic'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class ChatAnthropic_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -20,7 +21,7 @@ class ChatAnthropic_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatAnthropic'
|
||||
this.name = 'chatAnthropic'
|
||||
this.version = 5.0
|
||||
this.version = 6.0
|
||||
this.type = 'ChatAnthropic'
|
||||
this.icon = 'Anthropic.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -42,41 +43,9 @@ class ChatAnthropic_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
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',
|
||||
description: 'Most powerful model for highly complex tasks'
|
||||
},
|
||||
{
|
||||
label: 'claude-3-sonnet',
|
||||
name: 'claude-3-sonnet-20240229',
|
||||
description: 'Ideal balance of intelligence and speed for enterprise workloads'
|
||||
},
|
||||
{
|
||||
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 (legacy)',
|
||||
name: 'claude-2.1',
|
||||
description: 'Claude 2 latest full version'
|
||||
},
|
||||
{
|
||||
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'
|
||||
}
|
||||
],
|
||||
default: 'claude-3-haiku',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'claude-3-haiku'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -122,6 +91,13 @@ class ChatAnthropic_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatAnthropic')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { Anthropic } from 'llamaindex'
|
||||
|
||||
@@ -18,7 +19,7 @@ class ChatAnthropic_LlamaIndex_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatAnthropic'
|
||||
this.name = 'chatAnthropic_LlamaIndex'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'ChatAnthropic'
|
||||
this.icon = 'Anthropic.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -36,30 +37,8 @@ class ChatAnthropic_LlamaIndex_ChatModels implements INode {
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'claude-3-opus',
|
||||
name: 'claude-3-opus',
|
||||
description: 'Most powerful model for highly complex tasks'
|
||||
},
|
||||
{
|
||||
label: 'claude-3-sonnet',
|
||||
name: 'claude-3-sonnet',
|
||||
description: 'Ideal balance of intelligence and speed for enterprise workloads'
|
||||
},
|
||||
{
|
||||
label: 'claude-2.1',
|
||||
name: 'claude-2.1',
|
||||
description: 'Claude 2 latest major version, automatically get updates to the model as they are released'
|
||||
},
|
||||
{
|
||||
label: 'claude-instant-1.2',
|
||||
name: 'claude-instant-1.2',
|
||||
description: 'Claude Instant latest major version, automatically get updates to the model as they are released'
|
||||
}
|
||||
],
|
||||
default: 'claude-2',
|
||||
optional: true
|
||||
loadMethod: 'listModels',
|
||||
default: 'claude-3-haiku'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -88,6 +67,13 @@ class ChatAnthropic_LlamaIndex_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatAnthropic_LlamaIndex')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as 'claude-3-opus' | 'claude-3-sonnet' | 'claude-2.1' | 'claude-instant-1.2'
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ChatCohere, ChatCohereInput } from '@langchain/cohere'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class ChatCohere_ChatModels implements INode {
|
||||
label: string
|
||||
name: string
|
||||
version: number
|
||||
type: string
|
||||
icon: string
|
||||
category: string
|
||||
description: string
|
||||
baseClasses: string[]
|
||||
credential: INodeParams
|
||||
inputs: INodeParams[]
|
||||
|
||||
constructor() {
|
||||
this.label = 'ChatCohere'
|
||||
this.name = 'chatCohere'
|
||||
this.version = 1.0
|
||||
this.type = 'ChatCohere'
|
||||
this.icon = 'Cohere.svg'
|
||||
this.category = 'Chat Models'
|
||||
this.description = 'Wrapper around Cohere Chat Endpoints'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(ChatCohere)]
|
||||
this.credential = {
|
||||
label: 'Connect Credential',
|
||||
name: 'credential',
|
||||
type: 'credential',
|
||||
credentialNames: ['cohereApi']
|
||||
}
|
||||
this.inputs = [
|
||||
{
|
||||
label: 'Cache',
|
||||
name: 'cache',
|
||||
type: 'BaseCache',
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'command-r'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
name: 'temperature',
|
||||
type: 'number',
|
||||
step: 0.1,
|
||||
default: 0.7,
|
||||
optional: true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatCohere')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const cache = nodeData.inputs?.cache as BaseCache
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const streaming = nodeData.inputs?.streaming as boolean
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const cohereApiKey = getCredentialParam('cohereApiKey', credentialData, nodeData)
|
||||
|
||||
const obj: ChatCohereInput = {
|
||||
model: modelName,
|
||||
apiKey: cohereApiKey,
|
||||
temperature: temperature ? parseFloat(temperature) : undefined,
|
||||
streaming: streaming ?? true
|
||||
}
|
||||
if (cache) obj.cache = cache
|
||||
|
||||
const model = new ChatCohere(obj)
|
||||
return model
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { nodeClass: ChatCohere_ChatModels }
|
||||
@@ -0,0 +1 @@
|
||||
<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M11.776 18.304c.64 0 1.92-.032 3.712-.768 2.08-.864 6.176-2.4 9.152-4 2.08-1.12 2.976-2.592 2.976-4.576 0-2.72-2.208-4.96-4.96-4.96h-11.52A7.143 7.143 0 0 0 4 11.136c0 3.936 3.008 7.168 7.776 7.168Z" fill="#39594D"/><path fill-rule="evenodd" clip-rule="evenodd" d="M13.728 23.2c0-1.92 1.152-3.68 2.944-4.416l3.616-1.504C23.968 15.776 28 18.464 28 22.432A5.572 5.572 0 0 1 22.432 28h-3.936c-2.624 0-4.768-2.144-4.768-4.8Z" fill="#D18EE2"/><path d="M8.128 19.232A4.138 4.138 0 0 0 4 23.36v.544C4 26.144 5.856 28 8.128 28a4.138 4.138 0 0 0 4.128-4.128v-.544c-.032-2.24-1.856-4.096-4.128-4.096Z" fill="#FF7759"/></svg>
|
||||
|
After Width: | Height: | Size: 738 B |
+12
-9
@@ -2,8 +2,9 @@ import { HarmBlockThreshold, HarmCategory } from '@google/generative-ai'
|
||||
import type { SafetySetting } from '@google/generative-ai'
|
||||
import { ChatGoogleGenerativeAI, GoogleGenerativeAIChatInput } from '@langchain/google-genai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { convertMultiOptionsToStringArray, getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class GoogleGenerativeAI_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -20,7 +21,7 @@ class GoogleGenerativeAI_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatGoogleGenerativeAI'
|
||||
this.name = 'chatGoogleGenerativeAI'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'ChatGoogleGenerativeAI'
|
||||
this.icon = 'GoogleGemini.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -44,13 +45,8 @@ class GoogleGenerativeAI_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gemini-pro',
|
||||
name: 'gemini-pro'
|
||||
}
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'gemini-pro'
|
||||
},
|
||||
{
|
||||
@@ -147,6 +143,13 @@ class GoogleGenerativeAI_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatGoogleGenerativeAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const apiKey = getCredentialParam('googleGenerativeAPIKey', credentialData, nodeData)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { ChatGooglePaLM, GooglePaLMChatInput } from '@langchain/community/chat_models/googlepalm'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class ChatGooglePaLM_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class ChatGooglePaLM_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatGooglePaLM'
|
||||
this.name = 'chatGooglePaLM'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'ChatGooglePaLM'
|
||||
this.icon = 'GooglePaLM.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -40,15 +41,9 @@ class ChatGooglePaLM_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'models/chat-bison-001',
|
||||
name: 'models/chat-bison-001'
|
||||
}
|
||||
],
|
||||
default: 'models/chat-bison-001',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'models/chat-bison-001'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -98,6 +93,13 @@ class ChatGooglePaLM_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatGooglePaLM')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { GoogleAuthOptions } from 'google-auth-library'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ChatGoogleVertexAI, GoogleVertexAIChatInput } from '@langchain/community/chat_models/googlevertexai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class GoogleVertexAI_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -19,7 +20,7 @@ class GoogleVertexAI_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatGoogleVertexAI'
|
||||
this.name = 'chatGoogleVertexAI'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'ChatGoogleVertexAI'
|
||||
this.icon = 'GoogleVertex.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -44,27 +45,9 @@ class GoogleVertexAI_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'chat-bison',
|
||||
name: 'chat-bison'
|
||||
},
|
||||
{
|
||||
label: 'codechat-bison',
|
||||
name: 'codechat-bison'
|
||||
},
|
||||
{
|
||||
label: 'chat-bison-32k',
|
||||
name: 'chat-bison-32k'
|
||||
},
|
||||
{
|
||||
label: 'codechat-bison-32k',
|
||||
name: 'codechat-bison-32k'
|
||||
}
|
||||
],
|
||||
default: 'chat-bison',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'chat-bison'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -93,6 +76,13 @@ class GoogleVertexAI_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatGoogleVertexAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const googleApplicationCredentialFilePath = getCredentialParam('googleApplicationCredentialFilePath', credentialData, nodeData)
|
||||
|
||||
@@ -42,8 +42,7 @@ class ChatHuggingFace_ChatModels implements INode {
|
||||
name: 'model',
|
||||
type: 'string',
|
||||
description: 'If using own inference endpoint, leave this blank',
|
||||
placeholder: 'gpt2',
|
||||
optional: true
|
||||
placeholder: 'gpt2'
|
||||
},
|
||||
{
|
||||
label: 'Endpoint',
|
||||
|
||||
@@ -15,8 +15,9 @@ import {
|
||||
ChatMessageChunk
|
||||
} from '@langchain/core/messages'
|
||||
import { ChatMistralAI as LangchainChatMistralAI, ChatMistralAIInput } from '@langchain/mistralai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
interface TokenUsage {
|
||||
completionTokens?: number
|
||||
@@ -46,7 +47,7 @@ class ChatMistral_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatMistralAI'
|
||||
this.name = 'chatMistralAI'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'ChatMistralAI'
|
||||
this.icon = 'MistralAI.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -68,9 +69,8 @@ class ChatMistral_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'string',
|
||||
description:
|
||||
'Refer to <a target="_blank" href="https://docs.mistral.ai/guides/model-selection/">Model Selection</a> for more available models',
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'mistral-tiny'
|
||||
},
|
||||
{
|
||||
@@ -129,6 +129,13 @@ class ChatMistral_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatMistralAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const apiKey = getCredentialParam('mistralAIAPIKey', credentialData, nodeData)
|
||||
|
||||
@@ -2,9 +2,10 @@ import type { ClientOptions } from 'openai'
|
||||
import { ChatOpenAI as LangchainChatOpenAI, OpenAIChatInput, AzureOpenAIInput, LegacyOpenAIInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseChatModelParams } from '@langchain/core/language_models/chat_models'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, IMultiModalOption, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { ChatOpenAI } from './FlowiseChatOpenAI'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class ChatOpenAI_ChatModels implements INode {
|
||||
label: string
|
||||
@@ -21,7 +22,7 @@ class ChatOpenAI_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatOpenAI'
|
||||
this.name = 'chatOpenAI'
|
||||
this.version = 5.0
|
||||
this.version = 6.0
|
||||
this.type = 'ChatOpenAI'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -43,71 +44,9 @@ class ChatOpenAI_ChatModels implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gpt-4',
|
||||
name: 'gpt-4'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-turbo-preview',
|
||||
name: 'gpt-4-turbo-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-0125-preview',
|
||||
name: 'gpt-4-0125-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-1106-preview',
|
||||
name: 'gpt-4-1106-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-1106-vision-preview',
|
||||
name: 'gpt-4-1106-vision-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-vision-preview',
|
||||
name: 'gpt-4-vision-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-0613',
|
||||
name: 'gpt-4-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k',
|
||||
name: 'gpt-4-32k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k-0613',
|
||||
name: 'gpt-4-32k-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo',
|
||||
name: 'gpt-3.5-turbo'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-0125',
|
||||
name: 'gpt-3.5-turbo-0125'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-1106',
|
||||
name: 'gpt-3.5-turbo-1106'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-0613',
|
||||
name: 'gpt-3.5-turbo-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-16k',
|
||||
name: 'gpt-3.5-turbo-16k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-16k-0613',
|
||||
name: 'gpt-3.5-turbo-16k-0613'
|
||||
}
|
||||
],
|
||||
default: 'gpt-3.5-turbo',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'gpt-3.5-turbo'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -206,6 +145,13 @@ class ChatOpenAI_ChatModels implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatOpenAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { OpenAI, ALL_AVAILABLE_OPENAI_MODELS } from 'llamaindex'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class ChatOpenAI_LlamaIndex_LLMs implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class ChatOpenAI_LlamaIndex_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatOpenAI'
|
||||
this.name = 'chatOpenAI_LlamaIndex'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'ChatOpenAI'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'Chat Models'
|
||||
@@ -35,63 +36,9 @@ class ChatOpenAI_LlamaIndex_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gpt-4',
|
||||
name: 'gpt-4'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-turbo-preview',
|
||||
name: 'gpt-4-turbo-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-0125-preview',
|
||||
name: 'gpt-4-0125-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-1106-preview',
|
||||
name: 'gpt-4-1106-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-vision-preview',
|
||||
name: 'gpt-4-vision-preview'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-0613',
|
||||
name: 'gpt-4-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k',
|
||||
name: 'gpt-4-32k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k-0613',
|
||||
name: 'gpt-4-32k-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo',
|
||||
name: 'gpt-3.5-turbo'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-1106',
|
||||
name: 'gpt-3.5-turbo-1106'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-0613',
|
||||
name: 'gpt-3.5-turbo-0613'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-16k',
|
||||
name: 'gpt-3.5-turbo-16k'
|
||||
},
|
||||
{
|
||||
label: 'gpt-3.5-turbo-16k-0613',
|
||||
name: 'gpt-3.5-turbo-16k-0613'
|
||||
}
|
||||
],
|
||||
default: 'gpt-3.5-turbo',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'gpt-3.5-turbo'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -135,6 +82,13 @@ class ChatOpenAI_LlamaIndex_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.CHAT, 'chatOpenAI_LlamaIndex')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as keyof typeof ALL_AVAILABLE_OPENAI_MODELS
|
||||
|
||||
@@ -19,7 +19,7 @@ class ChatOpenAICustom_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'ChatOpenAI Custom'
|
||||
this.name = 'chatOpenAICustom'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'ChatOpenAI-Custom'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'Chat Models'
|
||||
|
||||
@@ -42,7 +42,7 @@ class Groq_ChatModels implements INode {
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'string',
|
||||
placeholder: 'ft:gpt-3.5-turbo:my-org:custom_suffix:id'
|
||||
placeholder: 'mixtral-8x7b-32768'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { BedrockRuntimeClient, InvokeModelCommand } from '@aws-sdk/client-bedrock-runtime'
|
||||
import { BedrockEmbeddings, BedrockEmbeddingsParams } from '@langchain/community/embeddings/bedrock'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels, getRegions } from '../../../src/modelLoader'
|
||||
|
||||
class AWSBedrockEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class AWSBedrockEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'AWS Bedrock Embeddings'
|
||||
this.name = 'AWSBedrockEmbeddings'
|
||||
this.version = 3.0
|
||||
this.version = 4.0
|
||||
this.type = 'AWSBedrockEmbeddings'
|
||||
this.icon = 'aws.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -35,56 +36,15 @@ class AWSBedrockEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Region',
|
||||
name: 'region',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'af-south-1', name: 'af-south-1' },
|
||||
{ label: 'ap-east-1', name: 'ap-east-1' },
|
||||
{ label: 'ap-northeast-1', name: 'ap-northeast-1' },
|
||||
{ label: 'ap-northeast-2', name: 'ap-northeast-2' },
|
||||
{ label: 'ap-northeast-3', name: 'ap-northeast-3' },
|
||||
{ label: 'ap-south-1', name: 'ap-south-1' },
|
||||
{ label: 'ap-south-2', name: 'ap-south-2' },
|
||||
{ label: 'ap-southeast-1', name: 'ap-southeast-1' },
|
||||
{ label: 'ap-southeast-2', name: 'ap-southeast-2' },
|
||||
{ label: 'ap-southeast-3', name: 'ap-southeast-3' },
|
||||
{ label: 'ap-southeast-4', name: 'ap-southeast-4' },
|
||||
{ label: 'ap-southeast-5', name: 'ap-southeast-5' },
|
||||
{ label: 'ap-southeast-6', name: 'ap-southeast-6' },
|
||||
{ label: 'ca-central-1', name: 'ca-central-1' },
|
||||
{ label: 'ca-west-1', name: 'ca-west-1' },
|
||||
{ label: 'cn-north-1', name: 'cn-north-1' },
|
||||
{ label: 'cn-northwest-1', name: 'cn-northwest-1' },
|
||||
{ label: 'eu-central-1', name: 'eu-central-1' },
|
||||
{ label: 'eu-central-2', name: 'eu-central-2' },
|
||||
{ label: 'eu-north-1', name: 'eu-north-1' },
|
||||
{ label: 'eu-south-1', name: 'eu-south-1' },
|
||||
{ label: 'eu-south-2', name: 'eu-south-2' },
|
||||
{ label: 'eu-west-1', name: 'eu-west-1' },
|
||||
{ label: 'eu-west-2', name: 'eu-west-2' },
|
||||
{ label: 'eu-west-3', name: 'eu-west-3' },
|
||||
{ label: 'il-central-1', name: 'il-central-1' },
|
||||
{ label: 'me-central-1', name: 'me-central-1' },
|
||||
{ label: 'me-south-1', name: 'me-south-1' },
|
||||
{ label: 'sa-east-1', name: 'sa-east-1' },
|
||||
{ label: 'us-east-1', name: 'us-east-1' },
|
||||
{ label: 'us-east-2', name: 'us-east-2' },
|
||||
{ label: 'us-gov-east-1', name: 'us-gov-east-1' },
|
||||
{ label: 'us-gov-west-1', name: 'us-gov-west-1' },
|
||||
{ label: 'us-west-1', name: 'us-west-1' },
|
||||
{ label: 'us-west-2', name: 'us-west-2' }
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listRegions',
|
||||
default: 'us-east-1'
|
||||
},
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'amazon.titan-embed-text-v1', name: 'amazon.titan-embed-text-v1' },
|
||||
{ label: 'amazon.titan-embed-g1-text-02', name: 'amazon.titan-embed-g1-text-02' },
|
||||
{ label: 'cohere.embed-english-v3', name: 'cohere.embed-english-v3' },
|
||||
{ label: 'cohere.embed-multilingual-v3', name: 'cohere.embed-multilingual-v3' }
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'amazon.titan-embed-text-v1'
|
||||
},
|
||||
{
|
||||
@@ -97,6 +57,16 @@ class AWSBedrockEmbedding_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')
|
||||
},
|
||||
async listRegions(): Promise<INodeOptionsValue[]> {
|
||||
return await getRegions(MODEL_TYPE.EMBEDDING, 'AWSBedrockEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const iRegion = nodeData.inputs?.region as string
|
||||
const iModel = nodeData.inputs?.model as string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { CohereEmbeddings, CohereEmbeddingsParams } from '@langchain/cohere'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class CohereEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -17,7 +18,7 @@ class CohereEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'Cohere Embeddings'
|
||||
this.name = 'cohereEmbeddings'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'CohereEmbeddings'
|
||||
this.icon = 'Cohere.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -33,46 +34,9 @@ class CohereEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'embed-english-v3.0',
|
||||
name: 'embed-english-v3.0',
|
||||
description: 'Embedding Dimensions: 1024'
|
||||
},
|
||||
{
|
||||
label: 'embed-english-light-v3.0',
|
||||
name: 'embed-english-light-v3.0',
|
||||
description: 'Embedding Dimensions: 384'
|
||||
},
|
||||
{
|
||||
label: 'embed-multilingual-v3.0',
|
||||
name: 'embed-multilingual-v3.0',
|
||||
description: 'Embedding Dimensions: 1024'
|
||||
},
|
||||
{
|
||||
label: 'embed-multilingual-light-v3.0',
|
||||
name: 'embed-multilingual-light-v3.0',
|
||||
description: 'Embedding Dimensions: 384'
|
||||
},
|
||||
{
|
||||
label: 'embed-english-v2.0',
|
||||
name: 'embed-english-v2.0',
|
||||
description: 'Embedding Dimensions: 4096'
|
||||
},
|
||||
{
|
||||
label: 'embed-english-light-v2.0',
|
||||
name: 'embed-english-light-v2.0',
|
||||
description: 'Embedding Dimensions: 1024'
|
||||
},
|
||||
{
|
||||
label: 'embed-multilingual-v2.0',
|
||||
name: 'embed-multilingual-v2.0',
|
||||
description: 'Embedding Dimensions: 768'
|
||||
}
|
||||
],
|
||||
default: 'embed-english-v2.0',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'embed-english-v2.0'
|
||||
},
|
||||
{
|
||||
label: 'Type',
|
||||
@@ -108,6 +72,13 @@ class CohereEmbedding_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'cohereEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const inputType = nodeData.inputs?.inputType as string
|
||||
|
||||
+12
-9
@@ -1,7 +1,8 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { GoogleGenerativeAIEmbeddings, GoogleGenerativeAIEmbeddingsParams } from '@langchain/google-genai'
|
||||
import { TaskType } from '@google/generative-ai'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class GoogleGenerativeAIEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class GoogleGenerativeAIEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'GoogleGenerativeAI Embeddings'
|
||||
this.name = 'googleGenerativeAiEmbeddings'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'GoogleGenerativeAiEmbeddings'
|
||||
this.icon = 'GoogleGemini.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -36,13 +37,8 @@ class GoogleGenerativeAIEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'embedding-001',
|
||||
name: 'embedding-001'
|
||||
}
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'embedding-001'
|
||||
},
|
||||
{
|
||||
@@ -63,6 +59,13 @@ class GoogleGenerativeAIEmbedding_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'googleGenerativeAiEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line unused-imports/no-unused-vars
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { GooglePaLMEmbeddings, GooglePaLMEmbeddingsParams } from '@langchain/community/embeddings/googlepalm'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class GooglePaLMEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -17,7 +18,7 @@ class GooglePaLMEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'Google PaLM Embeddings'
|
||||
this.name = 'googlePaLMEmbeddings'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'GooglePaLMEmbeddings'
|
||||
this.icon = 'GooglePaLM.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -33,19 +34,20 @@ class GooglePaLMEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'models/embedding-gecko-001',
|
||||
name: 'models/embedding-gecko-001'
|
||||
}
|
||||
],
|
||||
default: 'models/embedding-gecko-001',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'models/embedding-gecko-001'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'googlePaLMEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
|
||||
+13
-19
@@ -1,7 +1,8 @@
|
||||
import { GoogleAuthOptions } from 'google-auth-library'
|
||||
import { GoogleVertexAIEmbeddings, GoogleVertexAIEmbeddingsParams } from '@langchain/community/embeddings/googlevertexai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class GoogleVertexAIEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'GoogleVertexAI Embeddings'
|
||||
this.name = 'googlevertexaiEmbeddings'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'GoogleVertexAIEmbeddings'
|
||||
this.icon = 'GoogleVertex.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -37,27 +38,20 @@ class GoogleVertexAIEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'textembedding-gecko@001',
|
||||
name: 'textembedding-gecko@001'
|
||||
},
|
||||
{
|
||||
label: 'textembedding-gecko@latest',
|
||||
name: 'textembedding-gecko@latest'
|
||||
},
|
||||
{
|
||||
label: 'textembedding-gecko-multilingual@latest',
|
||||
name: 'textembedding-gecko-multilingual@latest'
|
||||
}
|
||||
],
|
||||
default: 'textembedding-gecko@001',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'textembedding-gecko@001'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'googlevertexaiEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { MistralAIEmbeddings, MistralAIEmbeddingsParams } from '@langchain/mistralai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class MistralEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -16,8 +17,8 @@ class MistralEmbedding_Embeddings implements INode {
|
||||
|
||||
constructor() {
|
||||
this.label = 'MistralAI Embeddings'
|
||||
this.name = 'mistralAI Embeddings'
|
||||
this.version = 1.0
|
||||
this.name = 'mistralAIEmbeddings'
|
||||
this.version = 2.0
|
||||
this.type = 'MistralAIEmbeddings'
|
||||
this.icon = 'MistralAI.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -33,13 +34,8 @@ class MistralEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'mistral-embed',
|
||||
name: 'mistral-embed'
|
||||
}
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'mistral-embed'
|
||||
},
|
||||
{
|
||||
@@ -69,6 +65,13 @@ class MistralEmbedding_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'mistralAIEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const batchSize = nodeData.inputs?.batchSize as string
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { OpenAIEmbeddings, OpenAIEmbeddingsParams } from '@langchain/openai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
|
||||
class OpenAIEmbedding_Embeddings implements INode {
|
||||
label: string
|
||||
@@ -17,7 +18,7 @@ class OpenAIEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'OpenAI Embeddings'
|
||||
this.name = 'openAIEmbeddings'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'OpenAIEmbeddings'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -33,23 +34,9 @@ class OpenAIEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'text-embedding-3-large',
|
||||
name: 'text-embedding-3-large'
|
||||
},
|
||||
{
|
||||
label: 'text-embedding-3-small',
|
||||
name: 'text-embedding-3-small'
|
||||
},
|
||||
{
|
||||
label: 'text-embedding-ada-002',
|
||||
name: 'text-embedding-ada-002'
|
||||
}
|
||||
],
|
||||
default: 'text-embedding-ada-002',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'text-embedding-ada-002'
|
||||
},
|
||||
{
|
||||
label: 'Strip New Lines',
|
||||
@@ -82,6 +69,13 @@ class OpenAIEmbedding_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'openAIEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const stripNewLines = nodeData.inputs?.stripNewLines as boolean
|
||||
const batchSize = nodeData.inputs?.batchSize as string
|
||||
|
||||
+13
-19
@@ -1,4 +1,5 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { OpenAIEmbedding } from 'llamaindex'
|
||||
|
||||
@@ -18,7 +19,7 @@ class OpenAIEmbedding_LlamaIndex_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'OpenAI Embedding'
|
||||
this.name = 'openAIEmbedding_LlamaIndex'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'OpenAIEmbedding'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'Embeddings'
|
||||
@@ -35,23 +36,9 @@ class OpenAIEmbedding_LlamaIndex_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'text-embedding-3-large',
|
||||
name: 'text-embedding-3-large'
|
||||
},
|
||||
{
|
||||
label: 'text-embedding-3-small',
|
||||
name: 'text-embedding-3-small'
|
||||
},
|
||||
{
|
||||
label: 'text-embedding-ada-002',
|
||||
name: 'text-embedding-ada-002'
|
||||
}
|
||||
],
|
||||
default: 'text-embedding-ada-002',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'text-embedding-ada-002'
|
||||
},
|
||||
{
|
||||
label: 'Timeout',
|
||||
@@ -70,6 +57,13 @@ class OpenAIEmbedding_LlamaIndex_Embeddings implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'openAIEmbedding_LlamaIndex')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const timeout = nodeData.inputs?.timeout as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { MODEL_TYPE, getModels } from '../../../src/modelLoader'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { VoyageEmbeddings, VoyageEmbeddingsParams } from 'langchain/embeddings/voyage'
|
||||
|
||||
@@ -17,7 +18,7 @@ class VoyageAIEmbedding_Embeddings implements INode {
|
||||
constructor() {
|
||||
this.label = 'VoyageAI Embeddings'
|
||||
this.name = 'voyageAIEmbeddings'
|
||||
this.version = 1.0
|
||||
this.version = 2.0
|
||||
this.type = 'VoyageAIEmbeddings'
|
||||
this.icon = 'voyageai.png'
|
||||
this.category = 'Embeddings'
|
||||
@@ -33,35 +34,20 @@ class VoyageAIEmbedding_Embeddings implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'voyage-2',
|
||||
name: 'voyage-2',
|
||||
description: 'Base generalist embedding model optimized for both latency and quality'
|
||||
},
|
||||
{
|
||||
label: 'voyage-code-2',
|
||||
name: 'voyage-code-2',
|
||||
description: 'Optimized for code retrieval'
|
||||
},
|
||||
{
|
||||
label: 'voyage-large-2',
|
||||
name: 'voyage-large-2',
|
||||
description: 'Powerful generalist embedding model'
|
||||
},
|
||||
{
|
||||
label: 'voyage-lite-02-instruct',
|
||||
name: 'voyage-lite-02-instruct',
|
||||
description: 'Instruction-tuned for classification, clustering, and sentence textual similarity tasks'
|
||||
}
|
||||
],
|
||||
default: 'voyage-2',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'voyage-2'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.EMBEDDING, 'voyageAIEmbeddings')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { Bedrock } from '@langchain/community/llms/bedrock'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { BaseBedrockInput } from '@langchain/community/dist/utils/bedrock'
|
||||
import { getModels, getRegions, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
/**
|
||||
* @author Michael Connor <mlconnor@yahoo.com>
|
||||
@@ -23,7 +24,7 @@ class AWSBedrock_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'AWS Bedrock'
|
||||
this.name = 'awsBedrock'
|
||||
this.version = 3.0
|
||||
this.version = 4.0
|
||||
this.type = 'AWSBedrock'
|
||||
this.icon = 'aws.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -46,60 +47,15 @@ class AWSBedrock_LLMs implements INode {
|
||||
{
|
||||
label: 'Region',
|
||||
name: 'region',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'af-south-1', name: 'af-south-1' },
|
||||
{ label: 'ap-east-1', name: 'ap-east-1' },
|
||||
{ label: 'ap-northeast-1', name: 'ap-northeast-1' },
|
||||
{ label: 'ap-northeast-2', name: 'ap-northeast-2' },
|
||||
{ label: 'ap-northeast-3', name: 'ap-northeast-3' },
|
||||
{ label: 'ap-south-1', name: 'ap-south-1' },
|
||||
{ label: 'ap-south-2', name: 'ap-south-2' },
|
||||
{ label: 'ap-southeast-1', name: 'ap-southeast-1' },
|
||||
{ label: 'ap-southeast-2', name: 'ap-southeast-2' },
|
||||
{ label: 'ap-southeast-3', name: 'ap-southeast-3' },
|
||||
{ label: 'ap-southeast-4', name: 'ap-southeast-4' },
|
||||
{ label: 'ap-southeast-5', name: 'ap-southeast-5' },
|
||||
{ label: 'ap-southeast-6', name: 'ap-southeast-6' },
|
||||
{ label: 'ca-central-1', name: 'ca-central-1' },
|
||||
{ label: 'ca-west-1', name: 'ca-west-1' },
|
||||
{ label: 'cn-north-1', name: 'cn-north-1' },
|
||||
{ label: 'cn-northwest-1', name: 'cn-northwest-1' },
|
||||
{ label: 'eu-central-1', name: 'eu-central-1' },
|
||||
{ label: 'eu-central-2', name: 'eu-central-2' },
|
||||
{ label: 'eu-north-1', name: 'eu-north-1' },
|
||||
{ label: 'eu-south-1', name: 'eu-south-1' },
|
||||
{ label: 'eu-south-2', name: 'eu-south-2' },
|
||||
{ label: 'eu-west-1', name: 'eu-west-1' },
|
||||
{ label: 'eu-west-2', name: 'eu-west-2' },
|
||||
{ label: 'eu-west-3', name: 'eu-west-3' },
|
||||
{ label: 'il-central-1', name: 'il-central-1' },
|
||||
{ label: 'me-central-1', name: 'me-central-1' },
|
||||
{ label: 'me-south-1', name: 'me-south-1' },
|
||||
{ label: 'sa-east-1', name: 'sa-east-1' },
|
||||
{ label: 'us-east-1', name: 'us-east-1' },
|
||||
{ label: 'us-east-2', name: 'us-east-2' },
|
||||
{ label: 'us-gov-east-1', name: 'us-gov-east-1' },
|
||||
{ label: 'us-gov-west-1', name: 'us-gov-west-1' },
|
||||
{ label: 'us-west-1', name: 'us-west-1' },
|
||||
{ label: 'us-west-2', name: 'us-west-2' }
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listRegions',
|
||||
default: 'us-east-1'
|
||||
},
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'model',
|
||||
type: 'options',
|
||||
options: [
|
||||
{ label: 'amazon.titan-tg1-large', name: 'amazon.titan-tg1-large' },
|
||||
{ label: 'amazon.titan-e1t-medium', name: 'amazon.titan-e1t-medium' },
|
||||
{ label: 'cohere.command-text-v14', name: 'cohere.command-text-v14' },
|
||||
{ label: 'cohere.command-light-text-v14', name: 'cohere.command-light-text-v14' },
|
||||
{ label: 'ai21.j2-grande-instruct', name: 'ai21.j2-grande-instruct' },
|
||||
{ label: 'ai21.j2-jumbo-instruct', name: 'ai21.j2-jumbo-instruct' },
|
||||
{ label: 'ai21.j2-mid', name: 'ai21.j2-mid' },
|
||||
{ label: 'ai21.j2-ultra', name: 'ai21.j2-ultra' }
|
||||
]
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels'
|
||||
},
|
||||
{
|
||||
label: 'Custom Model Name',
|
||||
@@ -131,6 +87,16 @@ class AWSBedrock_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'awsBedrock')
|
||||
},
|
||||
async listRegions(): Promise<INodeOptionsValue[]> {
|
||||
return await getRegions(MODEL_TYPE.LLM, 'awsBedrock')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const iRegion = nodeData.inputs?.region as string
|
||||
const iModel = nodeData.inputs?.model as string
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { AzureOpenAIInput, OpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class AzureOpenAI_LLMs implements INode {
|
||||
label: string
|
||||
@@ -19,7 +20,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'Azure OpenAI'
|
||||
this.name = 'azureOpenAI'
|
||||
this.version = 2.1
|
||||
this.version = 3.0
|
||||
this.type = 'AzureOpenAI'
|
||||
this.icon = 'Azure.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -41,67 +42,9 @@ class AzureOpenAI_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'text-davinci-003',
|
||||
name: 'text-davinci-003'
|
||||
},
|
||||
{
|
||||
label: 'ada',
|
||||
name: 'ada'
|
||||
},
|
||||
{
|
||||
label: 'text-ada-001',
|
||||
name: 'text-ada-001'
|
||||
},
|
||||
{
|
||||
label: 'babbage',
|
||||
name: 'babbage'
|
||||
},
|
||||
{
|
||||
label: 'text-babbage-001',
|
||||
name: 'text-babbage-001'
|
||||
},
|
||||
{
|
||||
label: 'curie',
|
||||
name: 'curie'
|
||||
},
|
||||
{
|
||||
label: 'text-curie-001',
|
||||
name: 'text-curie-001'
|
||||
},
|
||||
{
|
||||
label: 'davinci',
|
||||
name: 'davinci'
|
||||
},
|
||||
{
|
||||
label: 'text-davinci-001',
|
||||
name: 'text-davinci-001'
|
||||
},
|
||||
{
|
||||
label: 'text-davinci-002',
|
||||
name: 'text-davinci-002'
|
||||
},
|
||||
{
|
||||
label: 'text-davinci-fine-tune-002',
|
||||
name: 'text-davinci-fine-tune-002'
|
||||
},
|
||||
{
|
||||
label: 'gpt-35-turbo',
|
||||
name: 'gpt-35-turbo'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4',
|
||||
name: 'gpt-4'
|
||||
},
|
||||
{
|
||||
label: 'gpt-4-32k',
|
||||
name: 'gpt-4-32k'
|
||||
}
|
||||
],
|
||||
default: 'text-davinci-003',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'text-davinci-003'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -162,6 +105,13 @@ class AzureOpenAI_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'azureOpenAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { Cohere, CohereInput } from './core'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class Cohere_LLMs implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class Cohere_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'Cohere'
|
||||
this.name = 'cohere'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'Cohere'
|
||||
this.icon = 'Cohere.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -40,35 +41,9 @@ class Cohere_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'command',
|
||||
name: 'command'
|
||||
},
|
||||
{
|
||||
label: 'command-light',
|
||||
name: 'command-light'
|
||||
},
|
||||
{
|
||||
label: 'command-nightly',
|
||||
name: 'command-nightly'
|
||||
},
|
||||
{
|
||||
label: 'command-light-nightly',
|
||||
name: 'command-light-nightly'
|
||||
},
|
||||
{
|
||||
label: 'base',
|
||||
name: 'base'
|
||||
},
|
||||
{
|
||||
label: 'base-light',
|
||||
name: 'base-light'
|
||||
}
|
||||
],
|
||||
default: 'command',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'command'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -88,6 +63,12 @@ class Cohere_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'cohere')
|
||||
}
|
||||
}
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { GooglePaLM, GooglePaLMTextInput } from '@langchain/community/llms/googlepalm'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class GooglePaLM_LLMs implements INode {
|
||||
label: string
|
||||
@@ -18,7 +19,7 @@ class GooglePaLM_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'GooglePaLM'
|
||||
this.name = 'GooglePaLM'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'GooglePaLM'
|
||||
this.icon = 'GooglePaLM.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -40,15 +41,9 @@ class GooglePaLM_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'models/text-bison-001',
|
||||
name: 'models/text-bison-001'
|
||||
}
|
||||
],
|
||||
default: 'models/text-bison-001',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'models/text-bison-001'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -126,6 +121,13 @@ class GooglePaLM_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'GooglePaLM')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { GoogleAuthOptions } from 'google-auth-library'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { GoogleVertexAI, GoogleVertexAITextInput } from '@langchain/community/llms/googlevertexai'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class GoogleVertexAI_LLMs implements INode {
|
||||
label: string
|
||||
@@ -19,7 +20,7 @@ class GoogleVertexAI_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'GoogleVertexAI'
|
||||
this.name = 'googlevertexai'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'GoogleVertexAI'
|
||||
this.icon = 'GoogleVertex.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -44,33 +45,8 @@ class GoogleVertexAI_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'text-bison',
|
||||
name: 'text-bison'
|
||||
},
|
||||
{
|
||||
label: 'code-bison',
|
||||
name: 'code-bison'
|
||||
},
|
||||
{
|
||||
label: 'code-gecko',
|
||||
name: 'code-gecko'
|
||||
},
|
||||
{
|
||||
label: 'text-bison-32k',
|
||||
name: 'text-bison-32k'
|
||||
},
|
||||
{
|
||||
label: 'code-bison-32k',
|
||||
name: 'code-bison-32k'
|
||||
},
|
||||
{
|
||||
label: 'code-gecko-32k',
|
||||
name: 'code-gecko-32k'
|
||||
}
|
||||
],
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'text-bison'
|
||||
},
|
||||
{
|
||||
@@ -100,6 +76,13 @@ class GoogleVertexAI_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'googlevertexai')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const googleApplicationCredentialFilePath = getCredentialParam('googleApplicationCredentialFilePath', credentialData, nodeData)
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { OpenAI, OpenAIInput } from '@langchain/openai'
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
import { BaseLLMParams } from '@langchain/core/language_models/llms'
|
||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
||||
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
class OpenAI_LLMs implements INode {
|
||||
label: string
|
||||
@@ -19,7 +20,7 @@ class OpenAI_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'OpenAI'
|
||||
this.name = 'openAI'
|
||||
this.version = 3.0
|
||||
this.version = 4.0
|
||||
this.type = 'OpenAI'
|
||||
this.icon = 'openai.svg'
|
||||
this.category = 'LLMs'
|
||||
@@ -41,23 +42,9 @@ class OpenAI_LLMs implements INode {
|
||||
{
|
||||
label: 'Model Name',
|
||||
name: 'modelName',
|
||||
type: 'options',
|
||||
options: [
|
||||
{
|
||||
label: 'gpt-3.5-turbo-instruct',
|
||||
name: 'gpt-3.5-turbo-instruct'
|
||||
},
|
||||
{
|
||||
label: 'babbage-002',
|
||||
name: 'babbage-002'
|
||||
},
|
||||
{
|
||||
label: 'davinci-002',
|
||||
name: 'davinci-002'
|
||||
}
|
||||
],
|
||||
default: 'gpt-3.5-turbo-instruct',
|
||||
optional: true
|
||||
type: 'asyncOptions',
|
||||
loadMethod: 'listModels',
|
||||
default: 'gpt-3.5-turbo-instruct'
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
@@ -140,6 +127,13 @@ class OpenAI_LLMs implements INode {
|
||||
]
|
||||
}
|
||||
|
||||
//@ts-ignore
|
||||
loadMethods = {
|
||||
async listModels(): Promise<INodeOptionsValue[]> {
|
||||
return await getModels(MODEL_TYPE.LLM, 'openAI')
|
||||
}
|
||||
}
|
||||
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const temperature = nodeData.inputs?.temperature as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
import { INodeOptionsValue } from './Interface'
|
||||
import axios from 'axios'
|
||||
|
||||
const MASTER_MODEL_LIST = 'https://raw.githubusercontent.com/FlowiseAI/Flowise/main/packages/components/models.json'
|
||||
|
||||
export enum MODEL_TYPE {
|
||||
CHAT = 'chat',
|
||||
LLM = 'llm',
|
||||
EMBEDDING = 'embedding'
|
||||
}
|
||||
|
||||
const getModelConfig = async (category: MODEL_TYPE, name: string) => {
|
||||
const modelFile = process.env.MODEL_LIST_CONFIG_JSON || MASTER_MODEL_LIST
|
||||
if (!modelFile) {
|
||||
throw new Error('MODEL_LIST_CONFIG_JSON not set')
|
||||
}
|
||||
const resp = await axios.get(modelFile)
|
||||
const models = resp.data
|
||||
const categoryModels = models[category]
|
||||
return categoryModels.find((model: any) => model.name === name)
|
||||
}
|
||||
|
||||
export const getModels = async (category: MODEL_TYPE, name: string) => {
|
||||
const returnData: INodeOptionsValue[] = []
|
||||
try {
|
||||
const modelConfig = await getModelConfig(category, name)
|
||||
returnData.push(...modelConfig.models)
|
||||
return returnData
|
||||
} catch (e) {
|
||||
throw new Error(`Error: getModels - ${e}`)
|
||||
}
|
||||
}
|
||||
|
||||
export const getRegions = async (category: MODEL_TYPE, name: string) => {
|
||||
const returnData: INodeOptionsValue[] = []
|
||||
try {
|
||||
const modelConfig = await getModelConfig(category, name)
|
||||
returnData.push(...modelConfig.regions)
|
||||
return returnData
|
||||
} catch (e) {
|
||||
throw new Error(`Error: getRegions - ${e}`)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user