@sap-ai-sdk/langchain 2.5.1-20260120104129.0 → 2.5.1-20260122013429.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/orchestration/client.d.ts +5 -15
- package/dist/orchestration/client.d.ts.map +1 -1
- package/dist/orchestration/client.js +1 -106
- package/dist/orchestration/client.js.map +1 -1
- package/dist/orchestration/types.d.ts +1 -2
- package/dist/orchestration/types.d.ts.map +1 -1
- package/package.json +6 -7
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
-
import { type Runnable, type RunnableLike } from '@langchain/core/runnables';
|
|
3
|
-
import { type InteropZodType } from '@langchain/core/utils/types';
|
|
4
2
|
import { ChatGenerationChunk } from '@langchain/core/outputs';
|
|
5
|
-
import
|
|
3
|
+
import { type BaseMessage } from '@langchain/core/messages';
|
|
4
|
+
import type { OrchestrationMessageChunk } from './orchestration-message-chunk.js';
|
|
5
|
+
import type { BaseLanguageModelInput } from '@langchain/core/language_models/base';
|
|
6
|
+
import type { Runnable, RunnableLike } from '@langchain/core/runnables';
|
|
6
7
|
import type { ChatResult } from '@langchain/core/outputs';
|
|
7
8
|
import type { ResourceGroupConfig } from '@sap-ai-sdk/ai-api';
|
|
8
9
|
import type { CallbackManagerForLLMRun } from '@langchain/core/callbacks/manager';
|
|
9
|
-
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
|
|
10
|
-
import type { BaseMessage } from '@langchain/core/messages';
|
|
11
|
-
import type { OrchestrationMessageChunk } from './orchestration-message-chunk.js';
|
|
12
10
|
import type { OrchestrationCallOptions, LangChainOrchestrationModuleConfig, LangChainOrchestrationChatModelParams, ChatOrchestrationToolType } from './types.js';
|
|
11
|
+
import type { HttpDestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity';
|
|
13
12
|
/**
|
|
14
13
|
* The Orchestration client.
|
|
15
14
|
*/
|
|
@@ -30,15 +29,6 @@ export declare class OrchestrationClient extends BaseChatModel<OrchestrationCall
|
|
|
30
29
|
pipe<NewRunOutput>(coerceable: RunnableLike<OrchestrationMessageChunk, NewRunOutput>): Runnable<BaseLanguageModelInput, Exclude<NewRunOutput, Error>, OrchestrationCallOptions>;
|
|
31
30
|
_generate(messages: BaseMessage[], options: typeof this.ParsedCallOptions, runManager?: CallbackManagerForLLMRun): Promise<ChatResult>;
|
|
32
31
|
bindTools(tools: ChatOrchestrationToolType[], kwargs?: Partial<OrchestrationCallOptions> | undefined): Runnable<BaseLanguageModelInput, OrchestrationMessageChunk, OrchestrationCallOptions>;
|
|
33
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<false>): Runnable<BaseLanguageModelInput, RunOutput>;
|
|
34
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<true>): Runnable<BaseLanguageModelInput, {
|
|
35
|
-
raw: BaseMessage;
|
|
36
|
-
parsed: RunOutput;
|
|
37
|
-
}>;
|
|
38
|
-
withStructuredOutput<RunOutput extends Record<string, any> = Record<string, any>>(outputSchema: InteropZodType<RunOutput> | Record<string, any>, config?: StructuredOutputMethodOptions<boolean>): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
|
|
39
|
-
raw: BaseMessage;
|
|
40
|
-
parsed: RunOutput;
|
|
41
|
-
}>;
|
|
42
32
|
/**
|
|
43
33
|
* Stream response chunks from the Orchestration client.
|
|
44
34
|
* @param messages - The messages to send to the model.
|
|
@@ -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.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AY,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;IAoDb,SAAS,CAChB,KAAK,EAAE,yBAAyB,EAAE,EAClC,MAAM,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,SAAS,GACrD,QAAQ,CACT,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,CACzB;IAWD;;;;;;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;IAuFtC,OAAO,CAAC,wBAAwB;CA0CjC"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { BaseChatModel } from '@langchain/core/language_models/chat_models';
|
|
2
|
-
import { JsonOutputKeyToolsParser } from '@langchain/core/output_parsers/openai_tools';
|
|
3
|
-
import { JsonOutputParser, StructuredOutputParser } from '@langchain/core/output_parsers';
|
|
4
|
-
import { RunnablePassthrough, RunnableSequence } from '@langchain/core/runnables';
|
|
5
|
-
import { toJsonSchema } from '@langchain/core/utils/json_schema';
|
|
6
|
-
import { getSchemaDescription, isInteropZodSchema } from '@langchain/core/utils/types';
|
|
7
2
|
import { OrchestrationClient as OrchestrationClientBase } from '@sap-ai-sdk/orchestration';
|
|
8
3
|
import { ChatGenerationChunk } from '@langchain/core/outputs';
|
|
9
4
|
import { isTemplateRef, mapLangChainMessagesToOrchestrationMessages, mapOutputToChatResult, mapToolToChatCompletionTool, mapOrchestrationChunkToLangChainMessageChunk } from './util.js';
|
|
@@ -102,89 +97,6 @@ export class OrchestrationClient extends BaseChatModel {
|
|
|
102
97
|
...kwargs
|
|
103
98
|
});
|
|
104
99
|
}
|
|
105
|
-
withStructuredOutput(outputSchema, config) {
|
|
106
|
-
// Extract config options
|
|
107
|
-
const method = (config?.method ?? 'jsonSchema');
|
|
108
|
-
const name = config?.name ?? 'extract';
|
|
109
|
-
const description = getSchemaDescription(outputSchema);
|
|
110
|
-
const strict = config?.strict;
|
|
111
|
-
const includeRaw = config?.includeRaw;
|
|
112
|
-
let llm;
|
|
113
|
-
let outputParser;
|
|
114
|
-
// jsonSchema method: Use orchestration's native responseFormat
|
|
115
|
-
// Convert schema to JSON Schema format
|
|
116
|
-
const jsonSchema = toJsonSchema(outputSchema);
|
|
117
|
-
// Delegate to BaseChatModel for function calling method
|
|
118
|
-
if (method === 'functionCalling') {
|
|
119
|
-
outputParser = new JsonOutputKeyToolsParser({
|
|
120
|
-
returnSingle: true,
|
|
121
|
-
keyName: name,
|
|
122
|
-
...(isInteropZodSchema(outputSchema) && {
|
|
123
|
-
zodSchema: outputSchema
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
llm = this.withConfig({
|
|
127
|
-
tools: [
|
|
128
|
-
{
|
|
129
|
-
type: 'function',
|
|
130
|
-
function: {
|
|
131
|
-
name,
|
|
132
|
-
description,
|
|
133
|
-
parameters: jsonSchema,
|
|
134
|
-
...(strict !== undefined && { strict })
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
// TODO: Set `tool_choice` if it becomes supported in Orchestration
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
else if (method === 'jsonMode') {
|
|
142
|
-
if (strict !== undefined) {
|
|
143
|
-
throw new Error('The "strict" option is not supported with the "jsonMode" structured output method. Please use "jsonSchema" or "functionCalling" methods for strict output instead.');
|
|
144
|
-
}
|
|
145
|
-
outputParser = isInteropZodSchema(outputSchema)
|
|
146
|
-
? StructuredOutputParser.fromZodSchema(outputSchema)
|
|
147
|
-
: new JsonOutputParser();
|
|
148
|
-
llm = this.withConfig({
|
|
149
|
-
responseFormat: {
|
|
150
|
-
type: 'json_object'
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else if (method === 'jsonSchema') {
|
|
155
|
-
outputParser = isInteropZodSchema(outputSchema)
|
|
156
|
-
? StructuredOutputParser.fromZodSchema(outputSchema)
|
|
157
|
-
: new JsonOutputParser();
|
|
158
|
-
llm = this.withConfig({
|
|
159
|
-
responseFormat: {
|
|
160
|
-
type: 'json_schema',
|
|
161
|
-
json_schema: {
|
|
162
|
-
name,
|
|
163
|
-
description,
|
|
164
|
-
schema: jsonSchema,
|
|
165
|
-
...(strict !== undefined && { strict })
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
method;
|
|
172
|
-
throw new Error(`Unsupported structured output method: ${method}. Supported methods are 'jsonSchema', 'functionCalling', and 'jsonMode'.`);
|
|
173
|
-
}
|
|
174
|
-
if (!includeRaw) {
|
|
175
|
-
return llm.pipe(outputParser);
|
|
176
|
-
}
|
|
177
|
-
const parserAssign = RunnablePassthrough.assign({
|
|
178
|
-
parsed: (input, parserConfig) => outputParser.invoke(input.raw, parserConfig)
|
|
179
|
-
});
|
|
180
|
-
const parserNone = RunnablePassthrough.assign({
|
|
181
|
-
parsed: () => null
|
|
182
|
-
});
|
|
183
|
-
const parsedWithFallback = parserAssign.withFallbacks({
|
|
184
|
-
fallbacks: [parserNone]
|
|
185
|
-
});
|
|
186
|
-
return RunnableSequence.from([{ raw: llm }, parsedWithFallback]);
|
|
187
|
-
}
|
|
188
100
|
/**
|
|
189
101
|
* Stream response chunks from the Orchestration client.
|
|
190
102
|
* @param messages - The messages to send to the model.
|
|
@@ -246,7 +158,7 @@ export class OrchestrationClient extends BaseChatModel {
|
|
|
246
158
|
}
|
|
247
159
|
}
|
|
248
160
|
mergeOrchestrationConfig(options) {
|
|
249
|
-
const { tools = [], stop = []
|
|
161
|
+
const { tools = [], stop = [] } = options;
|
|
250
162
|
const config = {
|
|
251
163
|
...this.orchestrationConfig,
|
|
252
164
|
promptTemplating: {
|
|
@@ -280,23 +192,6 @@ export class OrchestrationClient extends BaseChatModel {
|
|
|
280
192
|
];
|
|
281
193
|
}
|
|
282
194
|
}
|
|
283
|
-
// Handle responseFormat for structured output
|
|
284
|
-
if (responseFormat) {
|
|
285
|
-
// Ensure prompt object exists
|
|
286
|
-
if (!config.promptTemplating.prompt) {
|
|
287
|
-
config.promptTemplating.prompt = {};
|
|
288
|
-
}
|
|
289
|
-
// Check if prompt is a TemplateRef
|
|
290
|
-
if (typeof config.promptTemplating.prompt === 'object' &&
|
|
291
|
-
isTemplateRef(config.promptTemplating.prompt)) {
|
|
292
|
-
throw new Error('Cannot use withStructuredOutput with TemplateRef. ' +
|
|
293
|
-
'Structured output requires inline template definition to set responseFormat.');
|
|
294
|
-
}
|
|
295
|
-
// Add responseFormat to prompt
|
|
296
|
-
if (typeof config.promptTemplating.prompt === 'object') {
|
|
297
|
-
config.promptTemplating.prompt.response_format = responseFormat;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
195
|
return config;
|
|
301
196
|
}
|
|
302
197
|
}
|
|
@@ -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,
|
|
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,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EACL,aAAa,EACb,2CAA2C,EAC3C,qBAAqB,EACrB,2BA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,mBAAmB,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM;oCACxD,EAAE,IAAI,IAAI,EAAE,CAAC;gCACf,GAAG,IAAI;6BACR;yBACF,CAAC;qBACH;iBACF;aACF;SACF,CAAC;QAEF,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;YACjB,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;gBACpC,MAAM,CAAC,gBAAgB,CAAC,MAAM,GAAG,EAAE,CAAC;YACtC,CAAC;YACD,IACE,OAAO,MAAM,CAAC,gBAAgB,CAAC,MAAM,KAAK,QAAQ;gBAClD,CAAC,aAAa,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAC9C,CAAC;gBACD,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,GAAG;oBACrC,8DAA8D;oBAC9D,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC/C,uEAAuE;oBACvE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC;iBAClD,CAAC;YACJ,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { OrchestrationModuleConfig as OrchestrationModuleConfigWithStringTemplating, PromptTemplate, PromptTemplatingModule, StreamOptions } from '@sap-ai-sdk/orchestration';
|
|
2
|
-
import type { ChatCompletionTool,
|
|
2
|
+
import type { ChatCompletionTool, TemplateRef } from '@sap-ai-sdk/orchestration/internal.js';
|
|
3
3
|
import type { Xor } from '@sap-cloud-sdk/util';
|
|
4
4
|
import type { BaseChatModelCallOptions, BaseChatModelParams, BindToolsInput } from '@langchain/core/language_models/chat_models';
|
|
5
5
|
import type { CustomRequestConfig } from '@sap-ai-sdk/core';
|
|
@@ -28,7 +28,6 @@ export type OrchestrationCallOptions = Pick<BaseChatModelCallOptions, 'stop' | '
|
|
|
28
28
|
promptIndex?: number;
|
|
29
29
|
placeholderValues?: Record<string, string>;
|
|
30
30
|
streamOptions?: StreamOptions;
|
|
31
|
-
responseFormat?: ResponseFormatText | ResponseFormatJsonObject | ResponseFormatJsonSchema;
|
|
32
31
|
};
|
|
33
32
|
/**
|
|
34
33
|
* Orchestration module configuration for LangChain.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,IAAI,6CAA6C,EAC1E,cAAc,EACd,sBAAsB,EACtB,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,kBAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/orchestration/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,IAAI,6CAA6C,EAC1E,cAAc,EACd,sBAAsB,EACtB,aAAa,EACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACZ,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,KAAK,EACV,wBAAwB,EACxB,mBAAmB,EACnB,cAAc,EACf,MAAM,6CAA6C,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,kBAAkB,GAAG,cAAc,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,qCAAqC,GAAG,mBAAmB,GAAG;IACxE;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;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,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,yBAAyB,EAAE,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,IAAI,CACnD,6CAA6C,EAC7C,kBAAkB,CACnB,GAAG;IACF,gBAAgB,EAAE,IAAI,CAAC,sBAAsB,EAAE,QAAQ,CAAC,GAAG;QACzD,MAAM,CAAC,EAAE,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;KAC3C,CAAC;CACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ai-sdk/langchain",
|
|
3
|
-
"version": "2.5.1-
|
|
3
|
+
"version": "2.5.1-20260122013429.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -27,14 +27,13 @@
|
|
|
27
27
|
"@sap-cloud-sdk/connectivity": "^4.3.1",
|
|
28
28
|
"@sap-cloud-sdk/util": "^4.3.1",
|
|
29
29
|
"uuid": "^13.0.0",
|
|
30
|
-
"@sap-ai-sdk/ai-api": "^2.5.1-
|
|
31
|
-
"@sap-ai-sdk/core": "^2.5.1-
|
|
32
|
-
"@sap-ai-sdk/foundation-models": "^2.5.1-
|
|
33
|
-
"@sap-ai-sdk/orchestration": "^2.5.1-
|
|
30
|
+
"@sap-ai-sdk/ai-api": "^2.5.1-20260122013429.0",
|
|
31
|
+
"@sap-ai-sdk/core": "^2.5.1-20260122013429.0",
|
|
32
|
+
"@sap-ai-sdk/foundation-models": "^2.5.1-20260122013429.0",
|
|
33
|
+
"@sap-ai-sdk/orchestration": "^2.5.1-20260122013429.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@langchain/langgraph": "^1.0.7"
|
|
37
|
-
"zod": "^4.3.5"
|
|
36
|
+
"@langchain/langgraph": "^1.0.7"
|
|
38
37
|
},
|
|
39
38
|
"peerDependencies": {
|
|
40
39
|
"@langchain/core": "=1.1.8"
|