SAP AI SDK for JavaScript - v2.15.0
    Preparing search index...

    Function createTokenProvider

    • Experimental

      Creates a token provider function compatible with AzureOpenAI's azureADTokenProvider option. On each invocation, resolves the AI Core destination and returns the bearer token.

      Parameters

      • Optionaldestination: HttpDestinationOrFetchOptions

        Optional HTTP destination or fetch options for the AI Core service. If omitted, falls back to the aicore service binding or the AICORE_SERVICE_KEY environment variable (local testing only).

      Returns () => Promise<string>

      A function that returns a promise resolving to the bearer token string. This function is experimental and may change at any time without prior notice.