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,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
|
||||
|
||||
Reference in New Issue
Block a user