UNPKG

@sap-ai-sdk/langchain

Version:

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

53 lines 4.09 kB
import { BaseChatModel } from '@langchain/core/language_models/chat_models'; import { type Runnable, type RunnableLike } from '@langchain/core/runnables'; import { type InteropZodType } from '@langchain/core/utils/types'; import { ChatGenerationChunk } from '@langchain/core/outputs'; import type { BaseLanguageModelInput, StructuredOutputMethodOptions } from '@langchain/core/language_models/base'; import type { ChatResult } from '@langchain/core/outputs'; import type { ResourceGroupConfig } from '@sap-ai-sdk/ai-api'; import type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager'; import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity'; import type { BaseMessage } from '@langchain/core/messages'; import type { OrchestrationMessageChunk } from './orchestration-message-chunk.js'; import type { OrchestrationCallOptions, LangChainOrchestrationModuleConfig, LangChainOrchestrationModuleConfigList, LangChainOrchestrationChatModelParams, ChatOrchestrationToolType } from './types.js'; /** * The Orchestration client. */ export declare class OrchestrationClient extends BaseChatModel<OrchestrationCallOptions, OrchestrationMessageChunk> { orchestrationConfig: LangChainOrchestrationModuleConfig | LangChainOrchestrationModuleConfigList; langchainOptions: LangChainOrchestrationChatModelParams; deploymentConfig?: ResourceGroupConfig | undefined; destination?: HttpDestinationOrFetchOptions | undefined; streaming: boolean; constructor(orchestrationConfig: LangChainOrchestrationModuleConfig | LangChainOrchestrationModuleConfigList, langchainOptions?: LangChainOrchestrationChatModelParams, deploymentConfig?: ResourceGroupConfig | undefined, destination?: HttpDestinationOrFetchOptions | undefined); _llmType(): string; /** * Create a new runnable sequence that runs each individual runnable in series, * piping the output of one runnable into another runnable or runnable-like. * @param coerceable - A runnable, function, or object whose values are functions or runnables. * @returns A new runnable sequence. */ pipe<NewRunOutput>(coerceable: RunnableLike<OrchestrationMessageChunk, NewRunOutput>): Runnable<BaseLanguageModelInput, Exclude<NewRunOutput, Error>, OrchestrationCallOptions>; _generate(messages: BaseMessage[], options: typeof this.ParsedCallOptions, runManager?: CallbackManagerForLLMRun): Promise<ChatResult>; bindTools(tools: ChatOrchestrationToolType[], kwargs?: Partial<OrchestrationCallOptions> | undefined): Runnable<BaseLanguageModelInput, OrchestrationMessageChunk, OrchestrationCallOptions>; withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>; withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput; }>; withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput; }>; /** * Stream response chunks from the Orchestration client. * @param messages - The messages to send to the model. * @param options - The call options. * @param runManager - The callback manager for the run. * @returns An async generator of chat generation chunks. */ _streamResponseChunks(messages: BaseMessage[], options: typeof this.ParsedCallOptions, runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>; private mergeOrchestrationConfig; private mergeOrchestrationConfigs; } //# sourceMappingURL=client.d.ts.map