mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
add modelName selection into Azure
This commit is contained in:
@@ -27,6 +27,39 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
name: 'azureOpenAIApiKey',
|
name: 'azureOpenAIApiKey',
|
||||||
type: 'password'
|
type: 'password'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Model Name',
|
||||||
|
name: 'modelName',
|
||||||
|
type: 'options',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'gpt-4',
|
||||||
|
name: 'gpt-4'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'gpt-4-0314',
|
||||||
|
name: 'gpt-4-0314'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'gpt-4-32k',
|
||||||
|
name: 'gpt-4-32k'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'gpt-4-32k-0314',
|
||||||
|
name: 'gpt-4-32k-0314'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'gpt-3.5-turbo',
|
||||||
|
name: 'gpt-3.5-turbo'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'gpt-3.5-turbo-0301',
|
||||||
|
name: 'gpt-3.5-turbo-0301'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
default: 'gpt-3.5-turbo',
|
||||||
|
optional: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Temperature',
|
label: 'Temperature',
|
||||||
name: 'temperature',
|
name: 'temperature',
|
||||||
@@ -73,6 +106,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
|
|
||||||
async init(nodeData: INodeData): Promise<any> {
|
async init(nodeData: INodeData): Promise<any> {
|
||||||
const azureOpenAIApiKey = nodeData.inputs?.azureOpenAIApiKey as string
|
const azureOpenAIApiKey = nodeData.inputs?.azureOpenAIApiKey as string
|
||||||
|
const modelName = nodeData.inputs?.modelName as string
|
||||||
const temperature = nodeData.inputs?.temperature as string
|
const temperature = nodeData.inputs?.temperature as string
|
||||||
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
||||||
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
||||||
@@ -82,6 +116,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
|||||||
|
|
||||||
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIBaseInput> = {
|
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIBaseInput> = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseInt(temperature, 10),
|
||||||
|
modelName,
|
||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
azureOpenAIApiDeploymentName,
|
azureOpenAIApiDeploymentName,
|
||||||
|
|||||||
@@ -27,6 +27,23 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
|
|||||||
name: 'azureOpenAIApiKey',
|
name: 'azureOpenAIApiKey',
|
||||||
type: 'password'
|
type: 'password'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Model Name',
|
||||||
|
name: 'modelName',
|
||||||
|
type: 'options',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'text-embedding-ada-002',
|
||||||
|
name: 'text-embedding-ada-002'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'text-search-ada-doc-001',
|
||||||
|
name: 'text-search-ada-doc-001'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
default: 'text-embedding-ada-002',
|
||||||
|
optional: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Azure OpenAI Api Instance Name',
|
label: 'Azure OpenAI Api Instance Name',
|
||||||
name: 'azureOpenAIApiInstanceName',
|
name: 'azureOpenAIApiInstanceName',
|
||||||
@@ -74,11 +91,13 @@ class AzureOpenAIEmbedding_Embeddings implements INode {
|
|||||||
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
||||||
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
||||||
const azureOpenAIApiVersion = nodeData.inputs?.azureOpenAIApiVersion as string
|
const azureOpenAIApiVersion = nodeData.inputs?.azureOpenAIApiVersion as string
|
||||||
|
const modelName = nodeData.inputs?.modelName as string
|
||||||
const stripNewLines = nodeData.inputs?.stripNewLines as boolean
|
const stripNewLines = nodeData.inputs?.stripNewLines as boolean
|
||||||
const batchSize = nodeData.inputs?.batchSize as string
|
const batchSize = nodeData.inputs?.batchSize as string
|
||||||
const timeout = nodeData.inputs?.timeout as string
|
const timeout = nodeData.inputs?.timeout as string
|
||||||
|
|
||||||
const obj: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> = {
|
const obj: Partial<OpenAIEmbeddingsParams> & Partial<AzureOpenAIInput> = {
|
||||||
|
modelName,
|
||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
azureOpenAIApiDeploymentName,
|
azureOpenAIApiDeploymentName,
|
||||||
|
|||||||
@@ -26,6 +26,35 @@ class AzureOpenAI_LLMs implements INode {
|
|||||||
name: 'azureOpenAIApiKey',
|
name: 'azureOpenAIApiKey',
|
||||||
type: 'password'
|
type: 'password'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'Model Name',
|
||||||
|
name: 'modelName',
|
||||||
|
type: 'options',
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
label: 'text-davinci-003',
|
||||||
|
name: 'text-davinci-003'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'text-davinci-002',
|
||||||
|
name: 'text-davinci-002'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'text-curie-001',
|
||||||
|
name: 'text-curie-001'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'text-babbage-001',
|
||||||
|
name: 'text-babbage-001'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'text-ada-001',
|
||||||
|
name: 'text-ada-001'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
default: 'text-davinci-003',
|
||||||
|
optional: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Temperature',
|
label: 'Temperature',
|
||||||
name: 'temperature',
|
name: 'temperature',
|
||||||
@@ -73,6 +102,7 @@ class AzureOpenAI_LLMs implements INode {
|
|||||||
async init(nodeData: INodeData): Promise<any> {
|
async init(nodeData: INodeData): Promise<any> {
|
||||||
const azureOpenAIApiKey = nodeData.inputs?.azureOpenAIApiKey as string
|
const azureOpenAIApiKey = nodeData.inputs?.azureOpenAIApiKey as string
|
||||||
const temperature = nodeData.inputs?.temperature as string
|
const temperature = nodeData.inputs?.temperature as string
|
||||||
|
const modelName = nodeData.inputs?.modelName as string
|
||||||
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
const azureOpenAIApiInstanceName = nodeData.inputs?.azureOpenAIApiInstanceName as string
|
||||||
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
const azureOpenAIApiDeploymentName = nodeData.inputs?.azureOpenAIApiDeploymentName as string
|
||||||
const azureOpenAIApiVersion = nodeData.inputs?.azureOpenAIApiVersion as string
|
const azureOpenAIApiVersion = nodeData.inputs?.azureOpenAIApiVersion as string
|
||||||
@@ -81,6 +111,7 @@ class AzureOpenAI_LLMs implements INode {
|
|||||||
|
|
||||||
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIInput> = {
|
const obj: Partial<AzureOpenAIInput> & Partial<OpenAIInput> = {
|
||||||
temperature: parseInt(temperature, 10),
|
temperature: parseInt(temperature, 10),
|
||||||
|
modelName,
|
||||||
azureOpenAIApiKey,
|
azureOpenAIApiKey,
|
||||||
azureOpenAIApiInstanceName,
|
azureOpenAIApiInstanceName,
|
||||||
azureOpenAIApiDeploymentName,
|
azureOpenAIApiDeploymentName,
|
||||||
|
|||||||
Reference in New Issue
Block a user