mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 09:01:06 +03:00
Chore/LC v0.3 (#3517)
* bump langchain version to 0.3, upgrades on all chat models * update all docs loader to have documents and text output options * fix pnpm lock file
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import { BaseCache } from '@langchain/core/caches'
|
||||
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'
|
||||
import { BedrockChatFields } from '@langchain/community/chat_models/bedrock'
|
||||
import { ChatBedrockConverseInput, ChatBedrockConverse } from '@langchain/aws'
|
||||
import { BedrockChat } from './FlowiseAWSChatBedrock'
|
||||
|
||||
/**
|
||||
* @author Michael Connor <mlconnor@yahoo.com>
|
||||
@@ -23,12 +23,12 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
constructor() {
|
||||
this.label = 'AWS ChatBedrock'
|
||||
this.name = 'awsChatBedrock'
|
||||
this.version = 5.0
|
||||
this.version = 6.0
|
||||
this.type = 'AWSChatBedrock'
|
||||
this.icon = 'aws.svg'
|
||||
this.category = 'Chat Models'
|
||||
this.description = 'Wrapper around AWS Bedrock large language models that use the Chat endpoint'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(BedrockChat)]
|
||||
this.description = 'Wrapper around AWS Bedrock large language models that use the Converse API'
|
||||
this.baseClasses = [this.type, ...getBaseClasses(ChatBedrockConverse)]
|
||||
this.credential = {
|
||||
label: 'AWS Credential',
|
||||
name: 'credential',
|
||||
@@ -64,6 +64,14 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
type: 'string',
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'Streaming',
|
||||
name: 'streaming',
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
optional: true,
|
||||
additionalParams: true
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
name: 'temperature',
|
||||
@@ -89,7 +97,7 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
name: 'allowImageUploads',
|
||||
type: 'boolean',
|
||||
description:
|
||||
'Only works with claude-3-* models when image is being uploaded from chat. Compatible with LLMChain, Conversation Chain, ReAct Agent, Conversational Agent, Tool Agent',
|
||||
'Allow image input. Refer to the <a href="https://docs.flowiseai.com/using-flowise/uploads#image" target="_blank">docs</a> for more details.',
|
||||
default: false,
|
||||
optional: true
|
||||
}
|
||||
@@ -115,7 +123,7 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
const cache = nodeData.inputs?.cache as BaseCache
|
||||
const streaming = nodeData.inputs?.streaming as boolean
|
||||
|
||||
const obj: BedrockChatFields = {
|
||||
const obj: ChatBedrockConverseInput = {
|
||||
region: iRegion,
|
||||
model: customModel ? customModel : iModel,
|
||||
maxTokens: parseInt(iMax_tokens_to_sample, 10),
|
||||
@@ -153,7 +161,7 @@ class AWSChatBedrock_ChatModels implements INode {
|
||||
}
|
||||
|
||||
const amazonBedrock = new BedrockChat(nodeData.id, obj)
|
||||
if (obj.model?.includes('anthropic.claude-3')) amazonBedrock.setMultiModalOption(multiModalOption)
|
||||
amazonBedrock.setMultiModalOption(multiModalOption)
|
||||
return amazonBedrock
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user