MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / initializeProvider

Method initializeProvider

packages/components/src/handler.ts:808–914  ·  view source on GitHub ↗
(provider: string, providerConfig: any, credentialData: any)

Source from the content-addressed store, hash-verified

806 }
807
808 async initializeProvider(provider: string, providerConfig: any, credentialData: any) {
809 if (provider === 'langSmith') {
810 const langSmithProject = providerConfig.projectName as string
811 const langSmithApiKey = getCredentialParam('langSmithApiKey', credentialData, this.nodeData)
812 const langSmithEndpoint = getCredentialParam('langSmithEndpoint', credentialData, this.nodeData)
813
814 const client = new LangsmithClient({
815 apiUrl: langSmithEndpoint ?? 'https://api.smith.langchain.com',
816 apiKey: langSmithApiKey
817 })
818
819 this.handlers['langSmith'] = {
820 client,
821 langSmithProject
822 }
823 } else if (provider === 'langFuse') {
824 const release = providerConfig.release as string
825 const langFuseSecretKey = getCredentialParam('langFuseSecretKey', credentialData, this.nodeData)
826 const langFusePublicKey = getCredentialParam('langFusePublicKey', credentialData, this.nodeData)
827 const langFuseEndpoint = getCredentialParam('langFuseEndpoint', credentialData, this.nodeData)
828
829 const langfuse = new Langfuse({
830 secretKey: langFuseSecretKey,
831 publicKey: langFusePublicKey,
832 baseUrl: langFuseEndpoint ?? 'https://cloud.langfuse.com',
833 sdkIntegration: 'Flowise',
834 release
835 })
836 this.handlers['langFuse'] = { client: langfuse }
837 } else if (provider === 'lunary') {
838 const lunaryPublicKey = getCredentialParam('lunaryAppId', credentialData, this.nodeData)
839 const lunaryEndpoint = getCredentialParam('lunaryEndpoint', credentialData, this.nodeData)
840
841 lunary.init({
842 publicKey: lunaryPublicKey,
843 apiUrl: lunaryEndpoint,
844 runtime: 'flowise'
845 })
846
847 this.handlers['lunary'] = { client: lunary }
848 } else if (provider === 'langWatch') {
849 const langWatchApiKey = getCredentialParam('langWatchApiKey', credentialData, this.nodeData)
850 const langWatchEndpoint = getCredentialParam('langWatchEndpoint', credentialData, this.nodeData)
851
852 const langwatch = new LangWatch({
853 apiKey: langWatchApiKey,
854 endpoint: langWatchEndpoint
855 })
856
857 this.handlers['langWatch'] = { client: langwatch }
858 } else if (provider === 'arize') {
859 const arizeApiKey = getCredentialParam('arizeApiKey', credentialData, this.nodeData)
860 const arizeSpaceId = getCredentialParam('arizeSpaceId', credentialData, this.nodeData)
861 const arizeEndpoint = getCredentialParam('arizeEndpoint', credentialData, this.nodeData)
862 const arizeProject = providerConfig.projectName as string
863
864 let arizeOptions: ArizeTracerOptions = {
865 apiKey: arizeApiKey,

Callers 1

initMethod · 0.95

Calls 5

getCredentialParamFunction · 0.90
getArizeTracerFunction · 0.85
getPhoenixTracerFunction · 0.85
getOpikTracerFunction · 0.85
initMethod · 0.65

Tested by

no test coverage detected