mirror of https://github.com/FlowiseAI/Flowise.git
feature/fetch openaiKey via overrideConfig (vars) (#2018)
* fetch openaiKey via overrideConfig (vars) * support dynamic openai credentialId via chatflowConfig * fix lintpull/2048/head
parent
a702e7408c
commit
b177644354
|
|
@ -221,6 +221,9 @@ class ChatOpenAI_ChatModels implements INode {
|
|||
const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
|
||||
const imageResolution = nodeData.inputs?.imageResolution as string
|
||||
|
||||
if (nodeData.inputs?.credentialId) {
|
||||
nodeData.credential = nodeData.inputs?.credentialId
|
||||
}
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ class OpenAIEmbedding_Embeddings implements INode {
|
|||
const basePath = nodeData.inputs?.basepath as string
|
||||
const modelName = nodeData.inputs?.modelName as string
|
||||
|
||||
if (nodeData.inputs?.credentialId) {
|
||||
nodeData.credential = nodeData.inputs?.credentialId
|
||||
}
|
||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue