@sap-ai-sdk/langchain 1.13.1-20250523013202.0 → 1.13.1-20250524013200.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/orchestration/client.d.ts +11 -2
- package/dist/orchestration/client.d.ts.map +1 -1
- package/dist/orchestration/client.js +43 -7
- package/dist/orchestration/client.js.map +1 -1
- package/dist/orchestration/orchestration-message-chunk.d.ts +0 -1
- package/dist/orchestration/orchestration-message-chunk.d.ts.map +1 -1
- package/dist/orchestration/orchestration-message-chunk.js +0 -1
- package/dist/orchestration/orchestration-message-chunk.js.map +1 -1
- package/dist/orchestration/types.d.ts +3 -2
- package/dist/orchestration/types.d.ts.map +1 -1
- package/dist/orchestration/util.d.ts +34 -2
- package/dist/orchestration/util.d.ts.map +1 -1
- package/dist/orchestration/util.js +84 -4
- package/dist/orchestration/util.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AzureOpenAiChatClient, AzureOpenAiEmbeddingClient } from './openai/index.js';
|
|
2
2
|
export type { AzureOpenAiChatModelParams, AzureOpenAiEmbeddingModelParams, AzureOpenAiChatCallOptions, ChatAzureOpenAIToolType } from './openai/index.js';
|
|
3
|
-
export { OrchestrationClient } from './orchestration/index.js';
|
|
3
|
+
export { OrchestrationClient, OrchestrationMessageChunk } from './orchestration/index.js';
|
|
4
4
|
export type { OrchestrationCallOptions, LangchainOrchestrationModuleConfig } from './orchestration/index.js';
|
|
5
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,0BAA0B,EAC1B,+BAA+B,EAC/B,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,wBAAwB,EACxB,kCAAkC,EACnC,MAAM,0BAA0B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { AzureOpenAiChatClient, AzureOpenAiEmbeddingClient } from './openai/index.js';
|
|
2
|
-
export { OrchestrationClient } from './orchestration/index.js';
|
|
2
|
+
export { OrchestrationClient, OrchestrationMessageChunk } from './orchestration/index.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
+
import { ChatGenerationChunk } from '@langchain/core/outputs';
|
|
3
|
+
import { type BaseMessage } from '@langchain/core/messages';
|
|
4
|
+
import type { OrchestrationMessageChunk } from './orchestration-message-chunk.js';
|
|
2
5
|
import type { BaseLanguageModelInput } from '@langchain/core/language_models/base';
|
|
3
6
|
import type { Runnable, RunnableLike } from '@langchain/core/runnables';
|
|
4
|
-
import type { OrchestrationMessageChunk } from './orchestration-message-chunk.js';
|
|
5
7
|
import type { ChatResult } from '@langchain/core/outputs';
|
|
6
8
|
import type { BaseChatModelParams } from '@langchain/core/language_models/chat_models';
|
|
7
9
|
import type { ResourceGroupConfig } from '@sap-ai-sdk/ai-api';
|
|
8
|
-
import type { BaseMessage } from '@langchain/core/messages';
|
|
9
10
|
import type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
|
|
10
11
|
import type { OrchestrationCallOptions, LangchainOrchestrationModuleConfig } from './types.js';
|
|
11
12
|
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
|
|
@@ -27,6 +28,14 @@ export declare class OrchestrationClient extends BaseChatModel<OrchestrationCall
|
|
|
27
28
|
*/
|
|
28
29
|
pipe<NewRunOutput>(coerceable: RunnableLike<OrchestrationMessageChunk, NewRunOutput>): Runnable<BaseLanguageModelInput, Exclude<NewRunOutput, Error>, OrchestrationCallOptions>;
|
|
29
30
|
_generate(messages: BaseMessage[], options: typeof this.ParsedCallOptions, runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
|
|
31
|
+
/**
|
|
32
|
+
* Stream response chunks from the Orchestration client.
|
|
33
|
+
* @param messages - The messages to send to the model.
|
|
34
|
+
* @param options - The call options.
|
|
35
|
+
* @param runManager - The callback manager for the run.
|
|
36
|
+
* @returns An async generator of chat generation chunks.
|
|
37
|
+
*/
|
|
38
|
+
_streamResponseChunks(messages: BaseMessage[], options: typeof this.ParsedCallOptions, runManager?: CallbackManagerForLLMRun): AsyncGenerator<ChatGenerationChunk>;
|
|
30
39
|
private mergeOrchestrationConfig;
|
|
31
40
|
}
|
|
32
41
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/orchestration/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/orchestration/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAE5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAU5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AACnF,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AACvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EACV,wBAAwB,EACxB,kCAAkC,EACnC,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AASjF;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,aAAa,CACpD,wBAAwB,EACxB,yBAAyB,CAC1B;IAEU,mBAAmB,EAAE,kCAAkC;IACvD,gBAAgB,EAAE,mBAAmB;IACrC,gBAAgB,CAAC,EAAE,mBAAmB;IACtC,WAAW,CAAC,EAAE,6BAA6B;gBAH3C,mBAAmB,EAAE,kCAAkC,EACvD,gBAAgB,GAAE,mBAAwB,EAC1C,gBAAgB,CAAC,EAAE,mBAAmB,YAAA,EACtC,WAAW,CAAC,EAAE,6BAA6B,YAAA;IAcpD,QAAQ,IAAI,MAAM;IAIlB;;;;;OAKG;IACM,IAAI,CAAC,YAAY,EACxB,UAAU,EAAE,YAAY,CAAC,yBAAyB,EAAE,YAAY,CAAC,GAChE,QAAQ,CACT,sBAAsB,EACtB,OAAO,CAAC,YAAY,EAAE,KAAK,CAAC,EAC5B,wBAAwB,CACzB;IAQc,SAAS,CACtB,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,OAAO,IAAI,CAAC,iBAAiB,EACtC,UAAU,CAAC,EAAE,wBAAwB,GACpC,OAAO,CAAC,UAAU,CAAC;IAmCtB;;;;;;OAMG;IACa,qBAAqB,CACnC,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,EAAE,OAAO,IAAI,CAAC,iBAAiB,EACtC,UAAU,CAAC,EAAE,wBAAwB,GACpC,cAAc,CAAC,mBAAmB,CAAC;IA8DtC,OAAO,CAAC,wBAAwB;CAyBjC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
2
|
import { OrchestrationClient as OrchestrationClientBase } from '@sap-ai-sdk/orchestration';
|
|
3
|
-
import {
|
|
3
|
+
import { ChatGenerationChunk } from '@langchain/core/outputs';
|
|
4
|
+
import { mapOrchestrationChunkToLangChainMessageChunk, isTemplate, setFinishReason, setTokenUsage, mapLangChainMessagesToOrchestrationMessages, mapOutputToChatResult, computeTokenIndices } from './util.js';
|
|
4
5
|
function isInputFilteringError(error) {
|
|
5
6
|
return (error.cause?.status === 400 &&
|
|
6
7
|
error.cause?.response?.data?.location?.includes('Input Filter'));
|
|
@@ -13,9 +14,7 @@ export class OrchestrationClient extends BaseChatModel {
|
|
|
13
14
|
langchainOptions;
|
|
14
15
|
deploymentConfig;
|
|
15
16
|
destination;
|
|
16
|
-
constructor(
|
|
17
|
-
// TODO: Omit streaming until supported
|
|
18
|
-
orchestrationConfig, langchainOptions = {}, deploymentConfig, destination) {
|
|
17
|
+
constructor(orchestrationConfig, langchainOptions = {}, deploymentConfig, destination) {
|
|
19
18
|
// Avoid retry if the error is due to input filtering
|
|
20
19
|
const { onFailedAttempt } = langchainOptions;
|
|
21
20
|
langchainOptions.onFailedAttempt = error => {
|
|
@@ -49,17 +48,54 @@ export class OrchestrationClient extends BaseChatModel {
|
|
|
49
48
|
const { inputParams, customRequestConfig } = options;
|
|
50
49
|
const mergedOrchestrationConfig = this.mergeOrchestrationConfig(options);
|
|
51
50
|
const orchestrationClient = new OrchestrationClientBase(mergedOrchestrationConfig, this.deploymentConfig, this.destination);
|
|
52
|
-
const
|
|
51
|
+
const allMessages = mapLangChainMessagesToOrchestrationMessages(messages);
|
|
53
52
|
return orchestrationClient.chatCompletion({
|
|
54
|
-
messages:
|
|
53
|
+
messages: allMessages,
|
|
55
54
|
inputParams
|
|
56
55
|
}, customRequestConfig);
|
|
57
56
|
});
|
|
58
57
|
const content = res.getContent();
|
|
59
|
-
// TODO: Add streaming as soon as we support it
|
|
60
58
|
await runManager?.handleLLMNewToken(typeof content === 'string' ? content : '');
|
|
61
59
|
return mapOutputToChatResult(res.data);
|
|
62
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Stream response chunks from the Orchestration client.
|
|
63
|
+
* @param messages - The messages to send to the model.
|
|
64
|
+
* @param options - The call options.
|
|
65
|
+
* @param runManager - The callback manager for the run.
|
|
66
|
+
* @returns An async generator of chat generation chunks.
|
|
67
|
+
*/
|
|
68
|
+
async *_streamResponseChunks(messages, options, runManager) {
|
|
69
|
+
const controller = new AbortController();
|
|
70
|
+
if (options.signal) {
|
|
71
|
+
options.signal.addEventListener('abort', () => controller.abort());
|
|
72
|
+
}
|
|
73
|
+
const orchestrationMessages = mapLangChainMessagesToOrchestrationMessages(messages);
|
|
74
|
+
const { inputParams, customRequestConfig } = options;
|
|
75
|
+
const mergedOrchestrationConfig = this.mergeOrchestrationConfig(options);
|
|
76
|
+
const orchestrationClient = new OrchestrationClientBase(mergedOrchestrationConfig, this.deploymentConfig, this.destination);
|
|
77
|
+
const response = await this.caller.callWithOptions({
|
|
78
|
+
signal: controller.signal
|
|
79
|
+
}, () => orchestrationClient.stream({ messages: orchestrationMessages, inputParams }, controller, options.streamOptions, customRequestConfig));
|
|
80
|
+
for await (const chunk of response.stream) {
|
|
81
|
+
const messageChunk = mapOrchestrationChunkToLangChainMessageChunk(chunk);
|
|
82
|
+
const tokenIndices = computeTokenIndices(chunk);
|
|
83
|
+
const finishReason = response.getFinishReason();
|
|
84
|
+
const tokenUsage = response.getTokenUsage();
|
|
85
|
+
setFinishReason(messageChunk, finishReason);
|
|
86
|
+
setTokenUsage(messageChunk, tokenUsage);
|
|
87
|
+
const content = chunk.getDeltaContent() ?? '';
|
|
88
|
+
const generationChunk = new ChatGenerationChunk({
|
|
89
|
+
message: messageChunk,
|
|
90
|
+
text: content,
|
|
91
|
+
generationInfo: { ...tokenIndices }
|
|
92
|
+
});
|
|
93
|
+
// Notify the run manager about the new token
|
|
94
|
+
// Some parameters(`_runId`, `_parentRunId`, `_tags`) are set as undefined as they are implicitly read from the context.
|
|
95
|
+
await runManager?.handleLLMNewToken(content, tokenIndices, undefined, undefined, undefined, { chunk: generationChunk });
|
|
96
|
+
yield generationChunk;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
63
99
|
mergeOrchestrationConfig(options) {
|
|
64
100
|
const { tools = [], stop = [] } = options;
|
|
65
101
|
const config = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/orchestration/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAC5E,OAAO,EAAE,mBAAmB,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EACL,UA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/messages';
|
|
|
3
3
|
import type { ModuleResults } from '@sap-ai-sdk/orchestration';
|
|
4
4
|
/**
|
|
5
5
|
* An AI Message Chunk containing module results and request ID.
|
|
6
|
-
* @internal
|
|
7
6
|
*/
|
|
8
7
|
export declare class OrchestrationMessageChunk extends AIMessageChunk {
|
|
9
8
|
module_results: ModuleResults;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-message-chunk.d.ts","sourceRoot":"","sources":["../../src/orchestration/orchestration-message-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D
|
|
1
|
+
{"version":3,"file":"orchestration-message-chunk.d.ts","sourceRoot":"","sources":["../../src/orchestration/orchestration-message-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,cAAc;IAC3D,cAAc,EAAE,aAAa,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;gBAEjB,MAAM,EAAE,MAAM,GAAG,oBAAoB,EACrC,cAAc,EAAE,aAAa,EAC7B,UAAU,EAAE,MAAM;CAMrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orchestration-message-chunk.js","sourceRoot":"","sources":["../../src/orchestration/orchestration-message-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D
|
|
1
|
+
{"version":3,"file":"orchestration-message-chunk.js","sourceRoot":"","sources":["../../src/orchestration/orchestration-message-chunk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI1D;;GAEG;AACH,MAAM,OAAO,yBAA0B,SAAQ,cAAc;IAC3D,cAAc,CAAgB;IAC9B,UAAU,CAAS;IACnB,YACE,MAAqC,EACrC,cAA6B,EAC7B,UAAkB;QAElB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Prompt, Template, TemplatingModuleConfig, OrchestrationModuleConfig as OrchestrationModuleConfigWithStringTemplating } from '@sap-ai-sdk/orchestration';
|
|
1
|
+
import type { Prompt, Template, TemplatingModuleConfig, StreamOptions, OrchestrationModuleConfig as OrchestrationModuleConfigWithStringTemplating } from '@sap-ai-sdk/orchestration';
|
|
2
2
|
import type { BaseChatModelCallOptions } from '@langchain/core/language_models/chat_models';
|
|
3
3
|
import type { CustomRequestConfig } from '@sap-ai-sdk/core';
|
|
4
4
|
/**
|
|
@@ -8,11 +8,12 @@ export type OrchestrationCallOptions = Pick<BaseChatModelCallOptions, 'stop' | '
|
|
|
8
8
|
customRequestConfig?: CustomRequestConfig;
|
|
9
9
|
tools?: Template['tools'];
|
|
10
10
|
inputParams?: Prompt['inputParams'];
|
|
11
|
+
streamOptions?: StreamOptions;
|
|
11
12
|
};
|
|
12
13
|
/**
|
|
13
14
|
* Orchestration module configuration for Langchain.
|
|
14
15
|
*/
|
|
15
|
-
export type LangchainOrchestrationModuleConfig = Omit<OrchestrationModuleConfigWithStringTemplating, '
|
|
16
|
+
export type LangchainOrchestrationModuleConfig = Omit<OrchestrationModuleConfigWithStringTemplating, 'templating'> & {
|
|
16
17
|
templating?: TemplatingModuleConfig;
|
|
17
18
|
};
|
|
18
19
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,sBAAsB,EACtB,yBAAyB,IAAI,6CAA6C,EAC3E,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,wBAAwB,EACtB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,SAAS,GACT,MAAM,CACT,GAAG;IACF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EACN,QAAQ,EACR,sBAAsB,EACtB,aAAa,EACb,yBAAyB,IAAI,6CAA6C,EAC3E,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,wBAAwB,EACtB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,SAAS,GACT,MAAM,CACT,GAAG;IACF,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACnD,6CAA6C,EAC7C,YAAY,CACb,GAAG;IACF,UAAU,CAAC,EAAE,sBAAsB,CAAC;CACrC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { AIMessageChunk } from '@langchain/core/messages';
|
|
1
2
|
import type { ChatResult } from '@langchain/core/outputs';
|
|
2
|
-
import type { ChatMessage, CompletionPostResponse, Template, TemplatingModuleConfig } from '@sap-ai-sdk/orchestration';
|
|
3
|
+
import type { ChatMessage, CompletionPostResponse, Template, OrchestrationStreamChunkResponse, TokenUsage, TemplatingModuleConfig } from '@sap-ai-sdk/orchestration';
|
|
3
4
|
import type { BaseMessage } from '@langchain/core/messages';
|
|
4
5
|
/**
|
|
5
6
|
* Checks if the object is a {@link Template}.
|
|
@@ -14,7 +15,7 @@ export declare function isTemplate(object: TemplatingModuleConfig): object is Te
|
|
|
14
15
|
* @returns The orchestration messages mapped from LangChain messages.
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|
|
17
|
-
export declare function
|
|
18
|
+
export declare function mapLangChainMessagesToOrchestrationMessages(messages: BaseMessage[]): ChatMessage[];
|
|
18
19
|
/**
|
|
19
20
|
* Maps the completion response to a {@link ChatResult}.
|
|
20
21
|
* @param completionResponse - The completion response to map.
|
|
@@ -22,4 +23,35 @@ export declare function mapLangchainMessagesToOrchestrationMessages(messages: Ba
|
|
|
22
23
|
* @internal
|
|
23
24
|
*/
|
|
24
25
|
export declare function mapOutputToChatResult(completionResponse: CompletionPostResponse): ChatResult;
|
|
26
|
+
/**
|
|
27
|
+
* Converts orchestration stream chunk to a LangChain message chunk.
|
|
28
|
+
* @param chunk - The orchestration stream chunk.
|
|
29
|
+
* @returns An {@link AIMessageChunk}
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function mapOrchestrationChunkToLangChainMessageChunk(chunk: OrchestrationStreamChunkResponse): AIMessageChunk;
|
|
33
|
+
/**
|
|
34
|
+
* Sets finish reason on a LangChain message chunk if available.
|
|
35
|
+
* @param messageChunk - The LangChain message chunk to update.
|
|
36
|
+
* @param finishReason - The finish reason from the response.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
export declare function setFinishReason(messageChunk: AIMessageChunk, finishReason?: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Sets usage metadata on a message chunk if available.
|
|
42
|
+
* @param messageChunk - The LangChain message chunk to update.
|
|
43
|
+
* @param tokenUsage - The token usage information.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
export declare function setTokenUsage(messageChunk: AIMessageChunk, tokenUsage?: TokenUsage): void;
|
|
47
|
+
/**
|
|
48
|
+
* Computes token indices for a chunk of the orchestration stream response.
|
|
49
|
+
* @param chunk - A chunk of the orchestration stream response.
|
|
50
|
+
* @returns An object with prompt and completion indices.
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function computeTokenIndices(chunk: OrchestrationStreamChunkResponse): {
|
|
54
|
+
prompt: number;
|
|
55
|
+
completion: number;
|
|
56
|
+
};
|
|
25
57
|
//# sourceMappingURL=util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/orchestration/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/orchestration/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EACV,WAAW,EACX,sBAAsB,EACtB,QAAQ,EAER,gCAAgC,EAChC,UAAU,EACV,sBAAsB,EACvB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,KAAK,EACV,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,sBAAsB,GAAG,MAAM,IAAI,QAAQ,CAE7E;AAwED;;;;;GAKG;AACH,wBAAgB,2CAA2C,CACzD,QAAQ,EAAE,WAAW,EAAE,GACtB,WAAW,EAAE,CAEf;AAqCD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,kBAAkB,EAAE,sBAAsB,GACzC,UAAU,CA0CZ;AAED;;;;;GAKG;AACH,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,gCAAgC,GACtC,cAAc,CAiBhB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,YAAY,EAAE,cAAc,EAC5B,YAAY,CAAC,EAAE,MAAM,GACpB,IAAI,CAIN;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,YAAY,EAAE,cAAc,EAC5B,UAAU,CAAC,EAAE,UAAU,GACtB,IAAI,CASN;AAED;;;;;GAKG;AAGH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gCAAgC,GAAG;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;CACpB,CAQA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AIMessage } from '@langchain/core/messages';
|
|
1
|
+
import { AIMessage, AIMessageChunk } from '@langchain/core/messages';
|
|
2
2
|
/**
|
|
3
3
|
* Checks if the object is a {@link Template}.
|
|
4
4
|
* @param object - The object to check.
|
|
@@ -72,7 +72,7 @@ function mapSystemMessageToAzureOpenAiSystemMessage(message) {
|
|
|
72
72
|
* @returns The orchestration messages mapped from LangChain messages.
|
|
73
73
|
* @internal
|
|
74
74
|
*/
|
|
75
|
-
export function
|
|
75
|
+
export function mapLangChainMessagesToOrchestrationMessages(messages) {
|
|
76
76
|
return messages.map(mapBaseMessageToChatMessage);
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
@@ -80,7 +80,7 @@ export function mapLangchainMessagesToOrchestrationMessages(messages) {
|
|
|
80
80
|
* @param toolCalls - The {@link AzureOpenAiChatCompletionMessageToolCalls} response.
|
|
81
81
|
* @returns The LangChain {@link ToolCall}.
|
|
82
82
|
*/
|
|
83
|
-
function
|
|
83
|
+
function mapAzureOpenAiToLangChainToolCall(toolCalls) {
|
|
84
84
|
if (toolCalls) {
|
|
85
85
|
return toolCalls.map(toolCall => ({
|
|
86
86
|
id: toolCall.id,
|
|
@@ -90,6 +90,20 @@ function mapAzureOpenAiToLangchainToolCall(toolCalls) {
|
|
|
90
90
|
}));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* Maps {@link OrchestrationToolCallChunk} to LangChain's {@link ToolCallChunk}.
|
|
95
|
+
* @param toolCallChunks - The {@link OrchestrationToolCallChunk} in a stream response chunk.
|
|
96
|
+
* @returns An array of LangChain {@link ToolCallChunk}.
|
|
97
|
+
*/
|
|
98
|
+
function mapOrchestrationToLangChainToolCallChunk(toolCallChunks) {
|
|
99
|
+
return toolCallChunks.map(chunk => ({
|
|
100
|
+
name: chunk.function?.name,
|
|
101
|
+
args: chunk.function?.arguments,
|
|
102
|
+
id: chunk.id,
|
|
103
|
+
index: chunk.index,
|
|
104
|
+
type: 'tool_call_chunk'
|
|
105
|
+
}));
|
|
106
|
+
}
|
|
93
107
|
/**
|
|
94
108
|
* Maps the completion response to a {@link ChatResult}.
|
|
95
109
|
* @param completionResponse - The completion response to map.
|
|
@@ -104,7 +118,7 @@ export function mapOutputToChatResult(completionResponse) {
|
|
|
104
118
|
text: choice.message.content ?? '',
|
|
105
119
|
message: new AIMessage({
|
|
106
120
|
content: choice.message.content ?? '',
|
|
107
|
-
tool_calls:
|
|
121
|
+
tool_calls: mapAzureOpenAiToLangChainToolCall(choice.message.tool_calls),
|
|
108
122
|
additional_kwargs: {
|
|
109
123
|
finish_reason: choice.finish_reason,
|
|
110
124
|
index: choice.index,
|
|
@@ -135,4 +149,70 @@ export function mapOutputToChatResult(completionResponse) {
|
|
|
135
149
|
}
|
|
136
150
|
};
|
|
137
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Converts orchestration stream chunk to a LangChain message chunk.
|
|
154
|
+
* @param chunk - The orchestration stream chunk.
|
|
155
|
+
* @returns An {@link AIMessageChunk}
|
|
156
|
+
* @internal
|
|
157
|
+
*/
|
|
158
|
+
export function mapOrchestrationChunkToLangChainMessageChunk(chunk) {
|
|
159
|
+
const { module_results, request_id } = chunk.data;
|
|
160
|
+
const content = chunk.getDeltaContent() ?? '';
|
|
161
|
+
const toolCallChunks = chunk.getDeltaToolCalls();
|
|
162
|
+
const additional_kwargs = {
|
|
163
|
+
module_results,
|
|
164
|
+
request_id
|
|
165
|
+
};
|
|
166
|
+
let tool_call_chunks = [];
|
|
167
|
+
if (toolCallChunks) {
|
|
168
|
+
tool_call_chunks = mapOrchestrationToLangChainToolCallChunk(toolCallChunks);
|
|
169
|
+
}
|
|
170
|
+
// Use `AIMessageChunk` to represent message chunks for roles such as 'tool' and 'user' as well.
|
|
171
|
+
// While the `ChatDelta` type can accommodate other roles in the orchestration service's stream chunk response, in realtime, we only expect messages with the 'assistant' role to be returned.
|
|
172
|
+
return new AIMessageChunk({ content, additional_kwargs, tool_call_chunks });
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Sets finish reason on a LangChain message chunk if available.
|
|
176
|
+
* @param messageChunk - The LangChain message chunk to update.
|
|
177
|
+
* @param finishReason - The finish reason from the response.
|
|
178
|
+
* @internal
|
|
179
|
+
*/
|
|
180
|
+
export function setFinishReason(messageChunk, finishReason) {
|
|
181
|
+
if (finishReason) {
|
|
182
|
+
messageChunk.response_metadata.finish_reason = finishReason;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Sets usage metadata on a message chunk if available.
|
|
187
|
+
* @param messageChunk - The LangChain message chunk to update.
|
|
188
|
+
* @param tokenUsage - The token usage information.
|
|
189
|
+
* @internal
|
|
190
|
+
*/
|
|
191
|
+
export function setTokenUsage(messageChunk, tokenUsage) {
|
|
192
|
+
if (tokenUsage) {
|
|
193
|
+
messageChunk.usage_metadata = {
|
|
194
|
+
input_tokens: tokenUsage.prompt_tokens,
|
|
195
|
+
output_tokens: tokenUsage.completion_tokens,
|
|
196
|
+
total_tokens: tokenUsage.total_tokens
|
|
197
|
+
};
|
|
198
|
+
messageChunk.response_metadata.token_usage = tokenUsage;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Computes token indices for a chunk of the orchestration stream response.
|
|
203
|
+
* @param chunk - A chunk of the orchestration stream response.
|
|
204
|
+
* @returns An object with prompt and completion indices.
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
// TODO: Remove after https://github.com/SAP/ai-sdk-js-backlog/issues/321
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
209
|
+
export function computeTokenIndices(chunk) {
|
|
210
|
+
return {
|
|
211
|
+
// Indicates the token is part of the first prompt
|
|
212
|
+
prompt: 0,
|
|
213
|
+
// Hardcoding to 0 as mutiple choices are not currently supported in the orchestration service.
|
|
214
|
+
// TODO: Switch to `chunk.data.orchestration_result.choices[0].index` when support is added via https://github.com/SAP/ai-sdk-js-backlog/issues/321
|
|
215
|
+
completion: 0
|
|
216
|
+
};
|
|
217
|
+
}
|
|
138
218
|
//# sourceMappingURL=util.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/orchestration/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/orchestration/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAmBrE;;;;;GAKG;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IAAI,gBAAgB,GAAoB,EAAE,CAAC;IAC3C,IAAI,cAAc,EAAE,CAAC;QACnB,gBAAgB,GAAG,wCAAwC,CAAC,cAAc,CAAC,CAAC;IAC9E,CAAC;IACD,gGAAgG;IAChG,8LAA8L;IAC9L,OAAO,IAAI,cAAc,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAC7B,YAA4B,EAC5B,YAAqB;IAErB,IAAI,YAAY,EAAE,CAAC;QACjB,YAAY,CAAC,iBAAiB,CAAC,aAAa,GAAG,YAAY,CAAC;IAC9D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,YAA4B,EAC5B,UAAuB;IAEvB,IAAI,UAAU,EAAE,CAAC;QACf,YAAY,CAAC,cAAc,GAAG;YAC5B,YAAY,EAAE,UAAU,CAAC,aAAa;YACtC,aAAa,EAAE,UAAU,CAAC,iBAAiB;YAC3C,YAAY,EAAE,UAAU,CAAC,YAAY;SACtC,CAAC;QACF,YAAY,CAAC,iBAAiB,CAAC,WAAW,GAAG,UAAU,CAAC;IAC1D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,UAAU,mBAAmB,CAAC,KAAuC;IAIzE,OAAO;QACL,kDAAkD;QAClD,MAAM,EAAE,CAAC;QACT,+FAA+F;QAC/F,mJAAmJ;QACnJ,UAAU,EAAE,CAAC;KACd,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ai-sdk/langchain",
|
|
3
|
-
"version": "1.13.1-
|
|
3
|
+
"version": "1.13.1-20250524013200.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"uuid": "^11.1.0",
|
|
24
24
|
"@langchain/core": "0.3.56",
|
|
25
25
|
"zod-to-json-schema": "^3.24.5",
|
|
26
|
-
"@sap-ai-sdk/ai-api": "^1.13.1-
|
|
27
|
-
"@sap-ai-sdk/core": "^1.13.1-
|
|
28
|
-
"@sap-ai-sdk/foundation-models": "^1.13.1-
|
|
29
|
-
"@sap-ai-sdk/orchestration": "^1.13.1-
|
|
26
|
+
"@sap-ai-sdk/ai-api": "^1.13.1-20250524013200.0",
|
|
27
|
+
"@sap-ai-sdk/core": "^1.13.1-20250524013200.0",
|
|
28
|
+
"@sap-ai-sdk/foundation-models": "^1.13.1-20250524013200.0",
|
|
29
|
+
"@sap-ai-sdk/orchestration": "^1.13.1-20250524013200.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"zod": "^3.25.
|
|
32
|
+
"zod": "^3.25.23"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"compile": "tsc",
|