mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 17:01:00 +03:00
models.json support for Groq (#2328)
* Add Groq models Added current Groq models to improve UX. * Add support for models.json Added the ability to load models from models.json * fix linting * increment groq node version --------- Co-authored-by: Henry Heng <henryheng@flowiseai.com>
This commit is contained in:
@@ -365,6 +365,27 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "groqChat",
|
||||||
|
"models": [
|
||||||
|
{
|
||||||
|
"label": "gemma-7b-it",
|
||||||
|
"name": "gemma-7b-it"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "llama3-70b-8192",
|
||||||
|
"name": "llama3-70b-8192"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "llama3-8b-8192",
|
||||||
|
"name": "llama3-8b-8192"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "mixtral-8x7b-32768",
|
||||||
|
"name": "mixtral-8x7b-32768"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "chatCohere",
|
"name": "chatCohere",
|
||||||
"models": [
|
"models": [
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { BaseCache } from '@langchain/core/caches'
|
import { BaseCache } from '@langchain/core/caches'
|
||||||
import { ChatGroq, ChatGroqInput } from '@langchain/groq'
|
import { ChatGroq, ChatGroqInput } from '@langchain/groq'
|
||||||
import { ICommonObject, INode, INodeData, INodeParams } from '../../../src/Interface'
|
import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from '../../../src/Interface'
|
||||||
|
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||||
|
|
||||||
class Groq_ChatModels implements INode {
|
class Groq_ChatModels implements INode {
|
||||||
@@ -18,7 +19,7 @@ class Groq_ChatModels implements INode {
|
|||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'GroqChat'
|
this.label = 'GroqChat'
|
||||||
this.name = 'groqChat'
|
this.name = 'groqChat'
|
||||||
this.version = 2.0
|
this.version = 3.0
|
||||||
this.type = 'GroqChat'
|
this.type = 'GroqChat'
|
||||||
this.icon = 'groq.png'
|
this.icon = 'groq.png'
|
||||||
this.category = 'Chat Models'
|
this.category = 'Chat Models'
|
||||||
@@ -41,8 +42,9 @@ class Groq_ChatModels implements INode {
|
|||||||
{
|
{
|
||||||
label: 'Model Name',
|
label: 'Model Name',
|
||||||
name: 'modelName',
|
name: 'modelName',
|
||||||
type: 'string',
|
type: 'asyncOptions',
|
||||||
placeholder: 'mixtral-8x7b-32768'
|
loadMethod: 'listModels',
|
||||||
|
placeholder: 'llama3-70b-8192'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Temperature',
|
label: 'Temperature',
|
||||||
@@ -55,6 +57,13 @@ class Groq_ChatModels implements INode {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
|
loadMethods = {
|
||||||
|
async listModels(): Promise<INodeOptionsValue[]> {
|
||||||
|
return await getModels(MODEL_TYPE.CHAT, 'groqChat')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {
|
||||||
const modelName = nodeData.inputs?.modelName as string
|
const modelName = nodeData.inputs?.modelName as string
|
||||||
const cache = nodeData.inputs?.cache as BaseCache
|
const cache = nodeData.inputs?.cache as BaseCache
|
||||||
|
|||||||
Reference in New Issue
Block a user