mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 23:01:09 +03:00
update bedrock
This commit is contained in:
@@ -27,7 +27,7 @@ class AWSBedrock_LLMs implements INode {
|
||||
constructor() {
|
||||
this.label = 'AWS Bedrock'
|
||||
this.name = 'awsBedrock'
|
||||
this.version = 2.0
|
||||
this.version = 3.0
|
||||
this.type = 'AWSBedrock'
|
||||
this.icon = 'awsBedrock.png'
|
||||
this.category = 'LLMs'
|
||||
@@ -105,6 +105,13 @@ class AWSBedrock_LLMs implements INode {
|
||||
{ label: 'ai21.j2-ultra', name: 'ai21.j2-ultra' }
|
||||
]
|
||||
},
|
||||
{
|
||||
label: 'Custom Model Name',
|
||||
name: 'customModel',
|
||||
description: 'If provided, will override model selected from Model Name option',
|
||||
type: 'string',
|
||||
optional: true
|
||||
},
|
||||
{
|
||||
label: 'Temperature',
|
||||
name: 'temperature',
|
||||
@@ -112,6 +119,7 @@ class AWSBedrock_LLMs implements INode {
|
||||
step: 0.1,
|
||||
description: 'Temperature parameter may not apply to certain model. Please check available model parameters',
|
||||
optional: true,
|
||||
additionalParams: true,
|
||||
default: 0.7
|
||||
},
|
||||
{
|
||||
@@ -121,6 +129,7 @@ class AWSBedrock_LLMs implements INode {
|
||||
step: 10,
|
||||
description: 'Max Tokens parameter may not apply to certain model. Please check available model parameters',
|
||||
optional: true,
|
||||
additionalParams: true,
|
||||
default: 200
|
||||
}
|
||||
]
|
||||
@@ -129,11 +138,12 @@ class AWSBedrock_LLMs implements INode {
|
||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||
const iRegion = nodeData.inputs?.region as string
|
||||
const iModel = nodeData.inputs?.model as string
|
||||
const customModel = nodeData.inputs?.customModel as string
|
||||
const iTemperature = nodeData.inputs?.temperature as string
|
||||
const iMax_tokens_to_sample = nodeData.inputs?.max_tokens_to_sample as string
|
||||
const cache = nodeData.inputs?.cache as BaseCache
|
||||
const obj: Partial<BaseBedrockInput> & BaseLLMParams = {
|
||||
model: iModel,
|
||||
model: customModel ?? iModel,
|
||||
region: iRegion,
|
||||
temperature: parseFloat(iTemperature),
|
||||
maxTokens: parseInt(iMax_tokens_to_sample, 10)
|
||||
|
||||
Reference in New Issue
Block a user