mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 15:00:57 +03:00
[Azure OpenAI] Make credentials optional when env variables are set (#3418)
* Make Azure OpenAI credentials optional when env variables are set * Add documentation for env vars
This commit is contained in:
@@ -5,6 +5,12 @@ import { ICommonObject, INode, INodeData, INodeOptionsValue, INodeParams } from
|
||||
import { getBaseClasses, getCredentialData, getCredentialParam } from '../../../src/utils'
|
||||
import { getModels, MODEL_TYPE } from '../../../src/modelLoader'
|
||||
|
||||
const serverCredentialsExists =
|
||||
!!process.env.AZURE_OPENAI_API_KEY &&
|
||||
!!process.env.AZURE_OPENAI_API_INSTANCE_NAME &&
|
||||
!!process.env.AZURE_OPENAI_API_DEPLOYMENT_NAME &&
|
||||
!!process.env.AZURE_OPENAI_API_VERSION
|
||||
|
||||
class AzureOpenAI_LLMs implements INode {
|
||||
label: string
|
||||
name: string
|
||||
@@ -30,7 +36,8 @@ class AzureOpenAI_LLMs implements INode {
|
||||
label: 'Connect Credential',
|
||||
name: 'credential',
|
||||
type: 'credential',
|
||||
credentialNames: ['azureOpenAIApi']
|
||||
credentialNames: ['azureOpenAIApi'],
|
||||
optional: serverCredentialsExists
|
||||
}
|
||||
this.inputs = [
|
||||
{
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Azure OpenAI LLM
|
||||
|
||||
Azure OpenAI LLM integration for Flowise
|
||||
|
||||
## 🌱 Env Variables
|
||||
|
||||
| Variable | Description | Type | Default |
|
||||
| ---------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------ | ----------------------------------- |
|
||||
| AZURE_OPENAI_API_KEY | Default `credential.azureOpenAIApiKey` for Azure OpenAI LLM | String | |
|
||||
| AZURE_OPENAI_API_INSTANCE_NAME | Default `credential.azureOpenAIApiInstanceName` for Azure OpenAI LLM | String | |
|
||||
| AZURE_OPENAI_API_DEPLOYMENT_NAME | Default `credential.azureOpenAIApiDeploymentName` for Azure OpenAI LLM | String | |
|
||||
| AZURE_OPENAI_API_VERSION | Default `credential.azureOpenAIApiVersion` for Azure OpenAI LLM | String | |
|
||||
|
||||
## License
|
||||
|
||||
Source code in this repository is made available under the [Apache License Version 2.0](https://github.com/FlowiseAI/Flowise/blob/master/LICENSE.md).
|
||||
Reference in New Issue
Block a user