UNPKG

@sap-ai-sdk/orchestration

Version:

SAP Cloud SDK for AI is the official Software Development Kit (SDK) for **SAP AI Core**, **SAP Generative AI Hub**, and **Orchestration Service**.

39 lines 2.31 kB
import { OrchestrationStreamResponse } from './orchestration-stream-response.js'; import { OrchestrationResponse } from './orchestration-response.js'; import type { CustomRequestConfig } from '@sap-cloud-sdk/http-client'; import type { DeploymentIdConfig, ResourceGroupConfig } from '@sap-ai-sdk/ai-api/internal.js'; import type { OrchestrationModuleConfig, ChatCompletionRequest, StreamOptions } from './orchestration-types.js'; import type { OrchestrationStreamChunkResponse } from './orchestration-stream-chunk-response.js'; import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity'; /** * Get the orchestration client. */ export declare class OrchestrationClient { private config; private deploymentConfig?; private destination?; /** * Creates an instance of the orchestration client. * @param config - Orchestration module configuration. This can either be an `OrchestrationModuleConfig` object or a JSON string obtained from AI Launchpad. * @param deploymentConfig - Deployment configuration. * @param destination - The destination to use for the request. */ constructor(config: OrchestrationModuleConfig | string, deploymentConfig?: (ResourceGroupConfig | DeploymentIdConfig) | undefined, destination?: HttpDestinationOrFetchOptions | undefined); chatCompletion(request?: ChatCompletionRequest, requestConfig?: CustomRequestConfig): Promise<OrchestrationResponse>; stream(request?: ChatCompletionRequest, signal?: AbortSignal, options?: StreamOptions, requestConfig?: CustomRequestConfig): Promise<OrchestrationStreamResponse<OrchestrationStreamChunkResponse>>; private executeRequest; private createStreamResponse; /** * Validate if a string is valid JSON. * @param config - The JSON string to validate. */ private validateJsonConfig; /** * Parse and merge templating into the config object. * @param config - The orchestration module configuration with templating either as object or string. * @returns The updated and merged orchestration module configuration. * @throws Error if the YAML parsing fails or if the parsed object does not conform to the expected schema. */ private parseAndMergeTemplating; } //# sourceMappingURL=orchestration-client.d.ts.map