buildGoogleCredentials (src/google-utils.ts)

Flowise · packages/components/src/google-utils.ts · typescript · Apache-2.0
auth

Utility that builds Google Vertex AI auth options from node data and credentials.

// Source: https://github.com/FlowiseAI/Flowise | License: Apache-2.0 | Copyright 2023-present FlowiseAI, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { getCredentialData, getCredentialParam, type ICommonObject, type INodeData } from '.'
import type { ChatVertexAIInput, VertexAIInput } from '@langchain/google-vertexai'

type SupportedAuthOptions = ChatVertexAIInput['authOptions'] | VertexAIInput['authOptions']

export const buildGoogleCredentials = async (nodeData: INodeData, options: ICommonObject): Promise<SupportedAuthOptions | null> => {
    const credentialData = await getCredentialData(nodeData.credential ?? '', options)
    const googleApplicationCredentialFilePath = getCredentialParam('googleApplicationCredentialFilePath', credentialData, nodeData)
  

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key