parent
9da05acc30
commit
d1da628b7c
|
|
@ -21,7 +21,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Azure ChatOpenAI'
|
this.label = 'Azure ChatOpenAI'
|
||||||
this.name = 'azureChatOpenAI'
|
this.name = 'azureChatOpenAI'
|
||||||
this.version = 4.0
|
this.version = 5.0
|
||||||
this.type = 'AzureChatOpenAI'
|
this.type = 'AzureChatOpenAI'
|
||||||
this.icon = 'Azure.svg'
|
this.icon = 'Azure.svg'
|
||||||
this.category = 'Chat Models'
|
this.category = 'Chat Models'
|
||||||
|
|
@ -94,6 +94,13 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||||
optional: true,
|
optional: true,
|
||||||
additionalParams: true
|
additionalParams: true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'BasePath',
|
||||||
|
name: 'basepath',
|
||||||
|
type: 'string',
|
||||||
|
optional: true,
|
||||||
|
additionalParams: true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Allow Image Uploads',
|
label: 'Allow Image Uploads',
|
||||||
name: 'allowImageUploads',
|
name: 'allowImageUploads',
|
||||||
|
|
@ -146,6 +153,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||||
const streaming = nodeData.inputs?.streaming as boolean
|
const streaming = nodeData.inputs?.streaming as boolean
|
||||||
const cache = nodeData.inputs?.cache as BaseCache
|
const cache = nodeData.inputs?.cache as BaseCache
|
||||||
const topP = nodeData.inputs?.topP as string
|
const topP = nodeData.inputs?.topP as string
|
||||||
|
const basePath = nodeData.inputs?.basepath as string
|
||||||
|
|
||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
||||||
|
|
@ -172,6 +180,7 @@ class AzureChatOpenAI_ChatModels implements INode {
|
||||||
if (timeout) obj.timeout = parseInt(timeout, 10)
|
if (timeout) obj.timeout = parseInt(timeout, 10)
|
||||||
if (cache) obj.cache = cache
|
if (cache) obj.cache = cache
|
||||||
if (topP) obj.topP = parseFloat(topP)
|
if (topP) obj.topP = parseFloat(topP)
|
||||||
|
if (basePath) obj.azureOpenAIBasePath = basePath
|
||||||
|
|
||||||
const multiModalOption: IMultiModalOption = {
|
const multiModalOption: IMultiModalOption = {
|
||||||
image: {
|
image: {
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.label = 'Azure OpenAI'
|
this.label = 'Azure OpenAI'
|
||||||
this.name = 'azureOpenAI'
|
this.name = 'azureOpenAI'
|
||||||
this.version = 3.0
|
this.version = 4.0
|
||||||
this.type = 'AzureOpenAI'
|
this.type = 'AzureOpenAI'
|
||||||
this.icon = 'Azure.svg'
|
this.icon = 'Azure.svg'
|
||||||
this.category = 'LLMs'
|
this.category = 'LLMs'
|
||||||
|
|
@ -101,6 +101,13 @@ class AzureOpenAI_LLMs implements INode {
|
||||||
step: 1,
|
step: 1,
|
||||||
optional: true,
|
optional: true,
|
||||||
additionalParams: true
|
additionalParams: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'BasePath',
|
||||||
|
name: 'basepath',
|
||||||
|
type: 'string',
|
||||||
|
optional: true,
|
||||||
|
additionalParams: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -122,6 +129,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||||
const timeout = nodeData.inputs?.timeout as string
|
const timeout = nodeData.inputs?.timeout as string
|
||||||
const bestOf = nodeData.inputs?.bestOf as string
|
const bestOf = nodeData.inputs?.bestOf as string
|
||||||
const streaming = nodeData.inputs?.streaming as boolean
|
const streaming = nodeData.inputs?.streaming as boolean
|
||||||
|
const basePath = nodeData.inputs?.basepath as string
|
||||||
|
|
||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
|
||||||
|
|
@ -148,6 +156,7 @@ class AzureOpenAI_LLMs implements INode {
|
||||||
if (timeout) obj.timeout = parseInt(timeout, 10)
|
if (timeout) obj.timeout = parseInt(timeout, 10)
|
||||||
if (bestOf) obj.bestOf = parseInt(bestOf, 10)
|
if (bestOf) obj.bestOf = parseInt(bestOf, 10)
|
||||||
if (cache) obj.cache = cache
|
if (cache) obj.cache = cache
|
||||||
|
if (basePath) obj.azureOpenAIBasePath = basePath
|
||||||
|
|
||||||
const model = new OpenAI(obj)
|
const model = new OpenAI(obj)
|
||||||
return model
|
return model
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue