Skip to content

Commit 7304fa3

Browse files
HenryHengZJAlves, Patrick
authored and
Alves, Patrick
committed
Feature/Add base path to azure (FlowiseAI#2984)
add base path to azure
1 parent 2dc87eb commit 7304fa3

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

packages/components/nodes/chatmodels/AzureChatOpenAI/AzureChatOpenAI.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class AzureChatOpenAI_ChatModels implements INode {
2121
constructor() {
2222
this.label = 'Azure ChatOpenAI'
2323
this.name = 'azureChatOpenAI'
24-
this.version = 4.0
24+
this.version = 5.0
2525
this.type = 'AzureChatOpenAI'
2626
this.icon = 'Azure.svg'
2727
this.category = 'Chat Models'
@@ -94,6 +94,13 @@ class AzureChatOpenAI_ChatModels implements INode {
9494
optional: true,
9595
additionalParams: true
9696
},
97+
{
98+
label: 'BasePath',
99+
name: 'basepath',
100+
type: 'string',
101+
optional: true,
102+
additionalParams: true
103+
},
97104
{
98105
label: 'Allow Image Uploads',
99106
name: 'allowImageUploads',
@@ -146,6 +153,7 @@ class AzureChatOpenAI_ChatModels implements INode {
146153
const streaming = nodeData.inputs?.streaming as boolean
147154
const cache = nodeData.inputs?.cache as BaseCache
148155
const topP = nodeData.inputs?.topP as string
156+
const basePath = nodeData.inputs?.basepath as string
149157

150158
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
151159
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
@@ -172,6 +180,7 @@ class AzureChatOpenAI_ChatModels implements INode {
172180
if (timeout) obj.timeout = parseInt(timeout, 10)
173181
if (cache) obj.cache = cache
174182
if (topP) obj.topP = parseFloat(topP)
183+
if (basePath) obj.azureOpenAIBasePath = basePath
175184

176185
const multiModalOption: IMultiModalOption = {
177186
image: {

packages/components/nodes/llms/Azure OpenAI/AzureOpenAI.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class AzureOpenAI_LLMs implements INode {
2020
constructor() {
2121
this.label = 'Azure OpenAI'
2222
this.name = 'azureOpenAI'
23-
this.version = 3.0
23+
this.version = 4.0
2424
this.type = 'AzureOpenAI'
2525
this.icon = 'Azure.svg'
2626
this.category = 'LLMs'
@@ -101,6 +101,13 @@ class AzureOpenAI_LLMs implements INode {
101101
step: 1,
102102
optional: true,
103103
additionalParams: true
104+
},
105+
{
106+
label: 'BasePath',
107+
name: 'basepath',
108+
type: 'string',
109+
optional: true,
110+
additionalParams: true
104111
}
105112
]
106113
}
@@ -122,6 +129,7 @@ class AzureOpenAI_LLMs implements INode {
122129
const timeout = nodeData.inputs?.timeout as string
123130
const bestOf = nodeData.inputs?.bestOf as string
124131
const streaming = nodeData.inputs?.streaming as boolean
132+
const basePath = nodeData.inputs?.basepath as string
125133

126134
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
127135
const azureOpenAIApiKey = getCredentialParam('azureOpenAIApiKey', credentialData, nodeData)
@@ -148,6 +156,7 @@ class AzureOpenAI_LLMs implements INode {
148156
if (timeout) obj.timeout = parseInt(timeout, 10)
149157
if (bestOf) obj.bestOf = parseInt(bestOf, 10)
150158
if (cache) obj.cache = cache
159+
if (basePath) obj.azureOpenAIBasePath = basePath
151160

152161
const model = new OpenAI(obj)
153162
return model

0 commit comments

Comments
 (0)