mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 11:01:18 +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,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'
|
||||
|
||||
Reference in New Issue
Block a user