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:
Vinod Kiran
2024-04-12 17:16:10 +05:30
committed by GitHub
parent 4daf29db80
commit 788d40f26b
76 changed files with 789 additions and 4044 deletions
+12 -31
View File
@@ -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