mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 21:00:58 +03:00
feature/fetch openaiKey via overrideConfig (vars) (#2018)
* fetch openaiKey via overrideConfig (vars) * support dynamic openai credentialId via chatflowConfig * fix lint
This commit is contained in:
@@ -221,6 +221,9 @@ class ChatOpenAI_ChatModels implements INode {
|
|||||||
const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
|
const allowImageUploads = nodeData.inputs?.allowImageUploads as boolean
|
||||||
const imageResolution = nodeData.inputs?.imageResolution as string
|
const imageResolution = nodeData.inputs?.imageResolution as string
|
||||||
|
|
||||||
|
if (nodeData.inputs?.credentialId) {
|
||||||
|
nodeData.credential = nodeData.inputs?.credentialId
|
||||||
|
}
|
||||||
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
const credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
||||||
|
|
||||||
|
|||||||
@@ -89,6 +89,9 @@ class OpenAIEmbedding_Embeddings implements INode {
|
|||||||
const basePath = nodeData.inputs?.basepath as string
|
const basePath = nodeData.inputs?.basepath as string
|
||||||
const modelName = nodeData.inputs?.modelName 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 credentialData = await getCredentialData(nodeData.credential ?? '', options)
|
||||||
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
const openAIApiKey = getCredentialParam('openAIApiKey', credentialData, nodeData)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user