From 4f1f78afcb4b9e2da2b876cdb575e756a83cdaa6 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Wed, 25 Mar 2026 09:09:42 +0000 Subject: [PATCH 1/6] Update orchestration based on main --- .../src/client/api/schema/dpi-config.ts | 4 + .../api/schema/embedding-base-64-string.ts | 10 + .../api/schema/embedding-float-array.ts | 10 + .../api/schema/embedding-multi-format.ts | 35 +++ .../src/client/api/schema/embedding.ts | 9 +- .../src/client/api/schema/embeddings-input.ts | 10 +- .../api/schema/embeddings-model-details.ts | 2 +- .../api/schema/embeddings-model-params.ts | 6 +- .../src/client/api/schema/encoding-format.ts | 16 ++ .../src/client/api/schema/index.ts | 4 + .../client/api/schema/llm-model-details.ts | 2 +- .../api/schema/masking-module-config.ts | 2 +- packages/orchestration/src/spec/api.yaml | 225 +++++++++++++++++- 13 files changed, 314 insertions(+), 21 deletions(-) create mode 100644 packages/orchestration/src/client/api/schema/embedding-base-64-string.ts create mode 100644 packages/orchestration/src/client/api/schema/embedding-float-array.ts create mode 100644 packages/orchestration/src/client/api/schema/embedding-multi-format.ts create mode 100644 packages/orchestration/src/client/api/schema/encoding-format.ts diff --git a/packages/orchestration/src/client/api/schema/dpi-config.ts b/packages/orchestration/src/client/api/schema/dpi-config.ts index afc07d364..45e43fa2c 100644 --- a/packages/orchestration/src/client/api/schema/dpi-config.ts +++ b/packages/orchestration/src/client/api/schema/dpi-config.ts @@ -35,4 +35,8 @@ export type DpiConfig = { */ enabled?: boolean; }; + /** + * Type of masking method to be used for file inputs. Required if file inputs are provided. + */ + mask_file_input_method?: 'anonymization' | 'skip'; }; diff --git a/packages/orchestration/src/client/api/schema/embedding-base-64-string.ts b/packages/orchestration/src/client/api/schema/embedding-base-64-string.ts new file mode 100644 index 000000000..8078f7268 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/embedding-base-64-string.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * A single base64 string representing the embedding. + */ +export type EmbeddingBase64String = string; diff --git a/packages/orchestration/src/client/api/schema/embedding-float-array.ts b/packages/orchestration/src/client/api/schema/embedding-float-array.ts new file mode 100644 index 000000000..3b3eafac6 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/embedding-float-array.ts @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * An array of floating point numbers representing the embedding. + */ +export type EmbeddingFloatArray = number[]; diff --git a/packages/orchestration/src/client/api/schema/embedding-multi-format.ts b/packages/orchestration/src/client/api/schema/embedding-multi-format.ts new file mode 100644 index 000000000..654fe46ed --- /dev/null +++ b/packages/orchestration/src/client/api/schema/embedding-multi-format.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * A dictionary mapping encoding format names to their embeddings. Used when multiple encoding formats are requested (Cohere-specific). + */ +export type EmbeddingMultiFormat = { + /** + * Float encoding format - array of floating point numbers + */ + float?: number[]; + /** + * Int8 encoding format - array of 8-bit integers + */ + int8?: number[]; + /** + * Uint8 encoding format - array of unsigned 8-bit integers + */ + uint8?: number[]; + /** + * Base64 encoding format - base64 encoded string + */ + base64?: string; + /** + * Binary encoding format - array of integers + */ + binary?: number[]; + /** + * Ubinary encoding format - array of unsigned integers + */ + ubinary?: number[]; +}; diff --git a/packages/orchestration/src/client/api/schema/embedding.ts b/packages/orchestration/src/client/api/schema/embedding.ts index e0eea646f..9f2c000bf 100644 --- a/packages/orchestration/src/client/api/schema/embedding.ts +++ b/packages/orchestration/src/client/api/schema/embedding.ts @@ -3,8 +3,13 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ - +import type { EmbeddingFloatArray } from './embedding-float-array.js'; +import type { EmbeddingBase64String } from './embedding-base-64-string.js'; +import type { EmbeddingMultiFormat } from './embedding-multi-format.js'; /** * Representation of the 'Embedding' schema. */ -export type Embedding = number[] | string; +export type Embedding = + | EmbeddingFloatArray + | EmbeddingBase64String + | EmbeddingMultiFormat; diff --git a/packages/orchestration/src/client/api/schema/embeddings-input.ts b/packages/orchestration/src/client/api/schema/embeddings-input.ts index d7c9202fd..b53ae3393 100644 --- a/packages/orchestration/src/client/api/schema/embeddings-input.ts +++ b/packages/orchestration/src/client/api/schema/embeddings-input.ts @@ -9,5 +9,13 @@ import type { EmbeddingsInputText } from './embeddings-input-text.js'; */ export type EmbeddingsInput = { text: EmbeddingsInputText; - type?: 'text' | 'document' | 'query'; + type?: + | 'text' + | 'document' + | 'query' + | 'search_document' + | 'search_query' + | 'classification' + | 'clustering' + | 'image'; }; diff --git a/packages/orchestration/src/client/api/schema/embeddings-model-details.ts b/packages/orchestration/src/client/api/schema/embeddings-model-details.ts index 8510d2989..7c4d93c4d 100644 --- a/packages/orchestration/src/client/api/schema/embeddings-model-details.ts +++ b/packages/orchestration/src/client/api/schema/embeddings-model-details.ts @@ -17,7 +17,7 @@ export type EmbeddingsModelDetails = { /** * Timeout for the Embeddings request in seconds. This parameter is currently ignored for Vertex AI models. * Default: 600. - * Maximum: 600. + * Maximum: 1200. * Minimum: 1. */ timeout?: number; diff --git a/packages/orchestration/src/client/api/schema/embeddings-model-params.ts b/packages/orchestration/src/client/api/schema/embeddings-model-params.ts index b1a8995b4..28fa50d42 100644 --- a/packages/orchestration/src/client/api/schema/embeddings-model-params.ts +++ b/packages/orchestration/src/client/api/schema/embeddings-model-params.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ - +import type { EncodingFormat } from './encoding-format.js'; /** * Additional parameters for generating input's embeddings. Default values are used for mandatory parameters. */ @@ -14,9 +14,9 @@ export type EmbeddingsModelParams = { */ dimensions?: number; /** - * OpenAI's spec allows for 'float' and 'base64' encoding formats. + * The format to return the embeddings in. Can be a single format or an array of formats. OpenAI's spec allows for 'float' and 'base64' encoding formats. * */ - encoding_format?: 'float' | 'base64' | 'binary'; + encoding_format?: EncodingFormat | EncodingFormat[]; normalize?: boolean; } & Record; diff --git a/packages/orchestration/src/client/api/schema/encoding-format.ts b/packages/orchestration/src/client/api/schema/encoding-format.ts new file mode 100644 index 000000000..a646f779f --- /dev/null +++ b/packages/orchestration/src/client/api/schema/encoding-format.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * Encoding format for embeddings. + */ +export type EncodingFormat = + | 'float' + | 'base64' + | 'binary' + | 'int8' + | 'uint8' + | 'ubinary'; diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index b654e436e..151ed56a5 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -11,11 +11,15 @@ export * from './embeddings-input-text.js'; export * from './embeddings-module-configs.js'; export * from './embeddings-model-config.js'; export * from './embeddings-model-details.js'; +export * from './encoding-format.js'; export * from './embeddings-model-params.js'; export * from './embeddings-post-response.js'; export * from './embeddings-response.js'; export * from './embeddings-usage.js'; export * from './embedding-result.js'; +export * from './embedding-float-array.js'; +export * from './embedding-base-64-string.js'; +export * from './embedding-multi-format.js'; export * from './embedding.js'; export * from './chat-messages.js'; export * from './templating-chat-message.js'; diff --git a/packages/orchestration/src/client/api/schema/llm-model-details.ts b/packages/orchestration/src/client/api/schema/llm-model-details.ts index 1df89bcb4..5d63ac17a 100644 --- a/packages/orchestration/src/client/api/schema/llm-model-details.ts +++ b/packages/orchestration/src/client/api/schema/llm-model-details.ts @@ -36,7 +36,7 @@ export type LLMModelDetails = { /** * Timeout for the LLM request in seconds. This parameter is currently ignored for Vertex AI models. * Default: 600. - * Maximum: 600. + * Maximum: 1200. * Minimum: 1. */ timeout?: number; diff --git a/packages/orchestration/src/client/api/schema/masking-module-config.ts b/packages/orchestration/src/client/api/schema/masking-module-config.ts index d3e56ef1f..c780decf9 100644 --- a/packages/orchestration/src/client/api/schema/masking-module-config.ts +++ b/packages/orchestration/src/client/api/schema/masking-module-config.ts @@ -17,7 +17,7 @@ export type MaskingModuleConfig = } | { /** - * List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` property instead. + * List of masking service providers. **DEPRECATED**: will be removed March 20, 2027. Use `providers` property instead. * @deprecated * Min Items: 1. */ diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index c21b9b471..19c7770fb 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -40,6 +40,9 @@ paths: summary: orchestrated completion inference description: Run an orchestrated completion inference request operationId: orchestration.v2.endpoints.create + parameters: + - $ref: '#/components/parameters/AIResourceGroup' + - $ref: '#/components/parameters/AIObjectStoreSecretName' requestBody: required: true content: @@ -82,12 +85,146 @@ paths: application/json: schema: $ref: '#/components/schemas/EmbeddingsPostResponse' + examples: + array_embeddings: + summary: Array format (single encoding_format) + description: Standard response format when a single encoding format is requested. Used by OpenAI, AWS Bedrock, VertexAI, Nvidia, and Cohere with single format. + value: + request_id: 'd4a67ea1-2bf9-4df7-8105-d48203ccff76' + final_result: + object: 'list' + data: + - object: 'embedding' + embedding: + - 0.015282119 + - 0.013516456 + - 0.002541946 + - -0.010837519 + index: 0 + - object: 'embedding' + embedding: + - 0.035031624 + - -0.0077586817 + - 0.018221147 + - 0.00446712 + index: 1 + model: 'text-embedding-ada-002' + usage: + prompt_tokens: 5 + total_tokens: 5 + base64_embeddings: + summary: Base64 string format (single encoding_format) + description: Response format when base64 encoding format is requested. The embedding is returned as a base64-encoded string. + value: + request_id: 'a1b2c3d4-e5f6-7890-abcd-ef1234567890' + final_result: + object: 'list' + data: + - object: 'embedding' + embedding: '2mF6PCB0XTzHliY72Y8xvOalM6uLmZjLyu7ze9==' + index: 0 + - object: 'embedding' + embedding: '8nB7QDB1YUzImiZ82Z9ywPbmN7vMnajMzv8zf+==' + index: 1 + model: 'text-embedding-3-large' + usage: + prompt_tokens: 5 + total_tokens: 5 + cohere_multi_type_embeddings: + summary: Dictionary format (multiple encoding_formats - Cohere only) + description: Response format when multiple encoding formats are requested (Cohere-specific feature). Each result contains a dictionary mapping format names to their respective embeddings. + value: + request_id: 'f5ba36c6-a687-4e0c-b7e4-26b623256baf' + final_result: + object: 'list' + data: + - object: 'embedding' + embedding: + float: + - 0.015282119 + - 0.013516456 + - 0.002541946 + - -0.010837519 + uint8: + - 142 + - 137 + - 124 + - 106 + index: 0 + - object: 'embedding' + embedding: + float: + - 0.035031624 + - -0.0077586817 + - 0.018221147 + - 0.00446712 + uint8: + - 151 + - 119 + - 133 + - 125 + index: 1 + model: 'cohere--single-serving-embed' + usage: + prompt_tokens: 12 + total_tokens: 12 + cohere_mixed_types_embeddings: + summary: Dictionary format with mixed types (Cohere only) + description: Response format when multiple encoding formats of different types are requested (e.g., float arrays and base64 strings). + value: + request_id: '11c785a2-09c7-4b12-b86e-3a3ff7ece72e' + final_result: + object: 'dict' + data: + - object: 'embedding' + embedding: + float: + - 0.015282119 + - 0.013516456 + - 0.002541946 + - -0.010837519 + base64: '2mF6PCB0XTzHliY72Y8xvOalM6uLmZjLyu7ze9==' + index: 0 + - object: 'embedding' + embedding: + float: + - 0.035031624 + - -0.0077586817 + - 0.018221147 + - 0.00446712 + base64: '8nB7QDB1YUzImiZ82Z9ywPbmN7vMnajMzv8zf+==' + index: 1 + model: 'cohere--single-serving-embed' + usage: + prompt_tokens: 12 + total_tokens: 12 '400': $ref: '#/components/responses/BadRequest' default: $ref: '#/components/responses/CommonError' components: + parameters: + AIResourceGroup: + in: header + name: AI-Resource-Group + description: 'Feedback specific - resource group of the feedback service object store secret.' + required: false + schema: + maxLength: 253 + minLength: 3 + pattern: ^[a-zA-Z0-9][a-zA-Z0-9.-]{1,251}[a-zA-Z0-9]$ + type: string + AIObjectStoreSecretName: + in: header + name: AI-Object-Store-Secret-Name + description: 'Feedback specific - name of the feedback service object store secret.' + required: false + schema: + maxLength: 233 + minLength: 1 + pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$ + type: string securitySchemes: Oauth2: type: oauth2 @@ -135,7 +272,17 @@ components: $ref: '#/components/schemas/EmbeddingsInputText' type: type: string - enum: ['text', 'document', 'query'] + enum: + [ + 'text', + 'document', + 'query', + 'search_document', + 'search_query', + 'classification', + 'clustering', + 'image' + ] EmbeddingsInputText: oneOf: - type: string @@ -186,13 +333,18 @@ components: type: integer default: 600 minimum: 1 - maximum: 600 + maximum: 1200 max_retries: description: Maximum number of retries for the Embeddings request. This parameter is currently ignored for Vertex AI models. type: integer default: 2 minimum: 0 maximum: 5 + EncodingFormat: + type: string + enum: [float, base64, binary, int8, uint8, ubinary] + description: Encoding format for embeddings. + EmbeddingsModelParams: type: object description: Additional parameters for generating input's embeddings. Default values are used for mandatory parameters. @@ -203,9 +355,14 @@ components: description: > The number of dimensions the resulting output embeddings should have. encoding_format: - type: string - enum: [float, base64, binary] + oneOf: + - $ref: '#/components/schemas/EncodingFormat' + - type: array + items: + $ref: '#/components/schemas/EncodingFormat' + minItems: 1 description: > + The format to return the embeddings in. Can be a single format or an array of formats. OpenAI's spec allows for 'float' and 'base64' encoding formats. normalize: type: boolean @@ -282,14 +439,52 @@ components: index: type: integer description: The index of the embedding in the list of embeddings. - Embedding: - oneOf: - - type: array + EmbeddingFloatArray: + type: array + items: + type: number + description: 'An array of floating point numbers representing the embedding. ' + EmbeddingBase64String: + type: string + description: 'A single base64 string representing the embedding.' + EmbeddingMultiFormat: + type: object + description: 'A dictionary mapping encoding format names to their embeddings. Used when multiple encoding formats are requested (Cohere-specific).' + additionalProperties: false + properties: + float: + type: array items: type: number - description: 'An array of numbers representing the embedding.' - - type: string - description: 'A single base64 string representing the embedding.' + description: 'Float encoding format - array of floating point numbers' + int8: + type: array + items: + type: integer + description: 'Int8 encoding format - array of 8-bit integers' + uint8: + type: array + items: + type: integer + description: 'Uint8 encoding format - array of unsigned 8-bit integers' + base64: + type: string + description: 'Base64 encoding format - base64 encoded string' + binary: + type: array + items: + type: integer + description: 'Binary encoding format - array of integers' + ubinary: + type: array + items: + type: integer + description: 'Ubinary encoding format - array of unsigned integers' + Embedding: + oneOf: + - $ref: '#/components/schemas/EmbeddingFloatArray' + - $ref: '#/components/schemas/EmbeddingBase64String' + - $ref: '#/components/schemas/EmbeddingMultiFormat' # Chat Completion Schemas ChatMessages: @@ -988,7 +1183,7 @@ components: type: integer default: 600 minimum: 1 - maximum: 600 + maximum: 1200 max_retries: description: Maximum number of retries for the LLM request. This parameter is currently ignored for Vertex AI models. type: integer @@ -1440,7 +1635,7 @@ components: properties: masking_providers: deprecated: true - description: 'List of masking service providers. **DEPRECATED**: will be removed Sept 15, 2026. Use `providers` property instead.' + description: 'List of masking service providers. **DEPRECATED**: will be removed March 20, 2027. Use `providers` property instead.' type: array minItems: 1 items: @@ -1492,6 +1687,12 @@ components: type: boolean default: false description: controls whether the input to the grounding module will be masked with the configuration supplied in the masking module + mask_file_input_method: + description: Type of masking method to be used for file inputs. Required if file inputs are provided. + type: string + enum: + - anonymization + - skip DPIEntityConfig: oneOf: From 698d38816218595783114e8c04295c00fa7e83f6 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Wed, 15 Apr 2026 08:18:40 +0000 Subject: [PATCH 2/6] Update orchestration based on main --- .../src/client/api/schema/cache-control.ts | 18 ++++++++ .../schema/cache-creation-token-details.ts | 19 +++++++++ .../client/api/schema/chat-completion-tool.ts | 2 + .../src/client/api/schema/index.ts | 2 + .../src/client/api/schema/text-content.ts | 3 +- .../src/client/api/schema/token-usage.ts | 8 +++- .../schema/user-chat-message-content-item.ts | 2 + packages/orchestration/src/spec/api.yaml | 41 +++++++++++++++++++ .../prompt-registry/prompt-templates-api.ts | 6 +-- 9 files changed, 96 insertions(+), 5 deletions(-) create mode 100644 packages/orchestration/src/client/api/schema/cache-control.ts create mode 100644 packages/orchestration/src/client/api/schema/cache-creation-token-details.ts diff --git a/packages/orchestration/src/client/api/schema/cache-control.ts b/packages/orchestration/src/client/api/schema/cache-control.ts new file mode 100644 index 000000000..a4b8c1766 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/cache-control.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * Cache control directive for Anthropic prompt caching. Only applicable to Anthropic Claude models. When set, marks the content block as a cache breakpoint. + * + */ +export type CacheControl = { + type: 'ephemeral'; + /** + * Time-to-live for the cache entry. Default is "5m" (5 minutes). "1h" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5). + * + */ + ttl?: '5m' | '1h'; +}; diff --git a/packages/orchestration/src/client/api/schema/cache-creation-token-details.ts b/packages/orchestration/src/client/api/schema/cache-creation-token-details.ts new file mode 100644 index 000000000..1a9e48203 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/cache-creation-token-details.ts @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * Breakdown of cache creation tokens by TTL (Anthropic only). + */ +export type CacheCreationTokenDetails = { + /** + * Tokens cached with 5-minute TTL. + */ + ephemeral_5m_input_tokens?: number; + /** + * Tokens cached with 1-hour TTL. + */ + ephemeral_1h_input_tokens?: number; +}; diff --git a/packages/orchestration/src/client/api/schema/chat-completion-tool.ts b/packages/orchestration/src/client/api/schema/chat-completion-tool.ts index 9b14236b6..9e661a19c 100644 --- a/packages/orchestration/src/client/api/schema/chat-completion-tool.ts +++ b/packages/orchestration/src/client/api/schema/chat-completion-tool.ts @@ -4,6 +4,7 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { FunctionObject } from './function-object.js'; +import type { CacheControl } from './cache-control.js'; /** * Representation of the 'ChatCompletionTool' schema. */ @@ -13,4 +14,5 @@ export type ChatCompletionTool = { */ type: 'function'; function: FunctionObject; + cache_control?: CacheControl; }; diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index 151ed56a5..964c6db36 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -38,6 +38,8 @@ export * from './response-chat-message.js'; export * from './message-tool-calls.js'; export * from './message-tool-call.js'; export * from './text-content.js'; +export * from './cache-control.js'; +export * from './cache-creation-token-details.js'; export * from './chat-delta.js'; export * from './tool-call-chunk.js'; export * from './completion-post-response.js'; diff --git a/packages/orchestration/src/client/api/schema/text-content.ts b/packages/orchestration/src/client/api/schema/text-content.ts index e44f57d63..1ea3f3c60 100644 --- a/packages/orchestration/src/client/api/schema/text-content.ts +++ b/packages/orchestration/src/client/api/schema/text-content.ts @@ -3,11 +3,12 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ - +import type { CacheControl } from './cache-control.js'; /** * Representation of the 'TextContent' schema. */ export type TextContent = { type: 'text'; text: string; + cache_control?: CacheControl; }; diff --git a/packages/orchestration/src/client/api/schema/token-usage.ts b/packages/orchestration/src/client/api/schema/token-usage.ts index e9b823e36..e1ef3f173 100644 --- a/packages/orchestration/src/client/api/schema/token-usage.ts +++ b/packages/orchestration/src/client/api/schema/token-usage.ts @@ -3,7 +3,7 @@ * * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ - +import type { CacheCreationTokenDetails } from './cache-creation-token-details.js'; /** * Usage of tokens in the response */ @@ -32,6 +32,12 @@ export type TokenUsage = { * Cached tokens present in the prompt. */ cached_tokens?: number; + /** + * Number of tokens written to the cache (Anthropic only). + * + */ + cache_creation_tokens?: number; + cache_creation_token_details?: CacheCreationTokenDetails; } & Record; /** * Breakdown of tokens used in a completion. diff --git a/packages/orchestration/src/client/api/schema/user-chat-message-content-item.ts b/packages/orchestration/src/client/api/schema/user-chat-message-content-item.ts index a4edcc117..adb9204ac 100644 --- a/packages/orchestration/src/client/api/schema/user-chat-message-content-item.ts +++ b/packages/orchestration/src/client/api/schema/user-chat-message-content-item.ts @@ -5,6 +5,7 @@ */ import type { ImageContentUrl } from './image-content-url.js'; import type { FileContent } from './file-content.js'; +import type { CacheControl } from './cache-control.js'; /** * Representation of the 'UserChatMessageContentItem' schema. */ @@ -13,4 +14,5 @@ export type UserChatMessageContentItem = { text?: string; image_url?: ImageContentUrl; file?: FileContent; + cache_control?: CacheControl; }; diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index 19c7770fb..e1022f765 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -575,6 +575,8 @@ components: $ref: '#/components/schemas/ImageContentUrl' file: $ref: '#/components/schemas/FileContent' + cache_control: + $ref: '#/components/schemas/CacheControl' required: - type ImageContentUrl: @@ -702,6 +704,37 @@ components: enum: ['text'] text: type: string + cache_control: + $ref: '#/components/schemas/CacheControl' + CacheControl: + type: object + description: > + Cache control directive for Anthropic prompt caching. Only applicable to + Anthropic Claude models. When set, marks the content block as a cache breakpoint. + additionalProperties: false + required: + - type + properties: + type: + type: string + enum: ['ephemeral'] + ttl: + type: string + description: > + Time-to-live for the cache entry. Default is "5m" (5 minutes). + "1h" (1 hour) is supported on select models (e.g. Claude Opus 4.5, Haiku 4.5, Sonnet 4.5). + enum: ['5m', '1h'] + CacheCreationTokenDetails: + type: object + description: Breakdown of cache creation tokens by TTL (Anthropic only). + additionalProperties: false + properties: + ephemeral_5m_input_tokens: + type: integer + description: Tokens cached with 5-minute TTL. + ephemeral_1h_input_tokens: + type: integer + description: Tokens cached with 1-hour TTL. ChatDelta: type: object required: @@ -1106,6 +1139,12 @@ components: cached_tokens: type: integer description: Cached tokens present in the prompt. + cache_creation_tokens: + type: integer + description: > + Number of tokens written to the cache (Anthropic only). + cache_creation_token_details: + $ref: '#/components/schemas/CacheCreationTokenDetails' completion_tokens_details: type: object description: Breakdown of tokens used in a completion. @@ -1314,6 +1353,8 @@ components: description: The type of the tool. Currently, only `function` is supported. function: $ref: '#/components/schemas/FunctionObject' + cache_control: + $ref: '#/components/schemas/CacheControl' required: - type - function diff --git a/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts b/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts index 1505401df..e3a8d92a3 100644 --- a/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts +++ b/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts @@ -77,19 +77,19 @@ export const PromptTemplatesApi = { * @param scenario - Path parameter. * @param version - Path parameter. * @param name - Path parameter. - * @param headerParameters - Object containing the following keys: AI-Resource-Group, AI-Resource-Group-Scope. * @param queryParameters - Object containing the following keys: includeSpec. + * @param headerParameters - Object containing the following keys: AI-Resource-Group, AI-Resource-Group-Scope. * @returns The request builder, use the `execute()` method to trigger the request. */ listPromptTemplateHistory: ( scenario: string, version: string, name: string, + queryParameters?: { includeSpec?: boolean }, headerParameters?: { 'AI-Resource-Group'?: string; 'AI-Resource-Group-Scope'?: 'true' | 'True' | 'false' | 'False'; - }, - queryParameters?: { includeSpec?: boolean } + } ) => new OpenApiRequestBuilder( 'get', From 6c73e5ceb567b18872d6311efd1a8727f7fc2b85 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Wed, 3 Jun 2026 16:23:22 +0000 Subject: [PATCH 3/6] Update orchestration based on main --- packages/document-grounding/src/client/api/retrieval-api.ts | 6 +++--- .../src/client/api/schema/generic-module-result.ts | 2 +- .../client/api/schema/prompt-templating-module-config.ts | 4 ++-- packages/orchestration/src/spec/api.yaml | 4 ++-- .../src/client/prompt-registry/prompt-templates-api.ts | 1 - 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/document-grounding/src/client/api/retrieval-api.ts b/packages/document-grounding/src/client/api/retrieval-api.ts index 28734db9c..034d0d9d4 100644 --- a/packages/document-grounding/src/client/api/retrieval-api.ts +++ b/packages/document-grounding/src/client/api/retrieval-api.ts @@ -38,14 +38,14 @@ export const RetrievalApi = { /** * List data repository by id * @param repositoryId - Repository ID - * @param headerParameters - Object containing the following keys: AI-Resource-Group. * @param queryParameters - Object containing the following keys: remoteName. + * @param headerParameters - Object containing the following keys: AI-Resource-Group. * @returns The request builder, use the `execute()` method to trigger the request. */ getDataRepositoryById: ( repositoryId: string, - headerParameters: { 'AI-Resource-Group': string }, - queryParameters: { remoteName?: string } + queryParameters: { remoteName?: string }, + headerParameters: { 'AI-Resource-Group': string } ) => new OpenApiRequestBuilder( 'get', diff --git a/packages/orchestration/src/client/api/schema/generic-module-result.ts b/packages/orchestration/src/client/api/schema/generic-module-result.ts index 4b927e776..bbd0bbf81 100644 --- a/packages/orchestration/src/client/api/schema/generic-module-result.ts +++ b/packages/orchestration/src/client/api/schema/generic-module-result.ts @@ -10,7 +10,7 @@ export type GenericModuleResult = { /** * Some message created from the module - * @example "Input to LLM is masked successfully." + * @example "Masking module executed successfully on LLM input." */ message: string; /** diff --git a/packages/orchestration/src/client/api/schema/prompt-templating-module-config.ts b/packages/orchestration/src/client/api/schema/prompt-templating-module-config.ts index ee418b974..05c46c926 100644 --- a/packages/orchestration/src/client/api/schema/prompt-templating-module-config.ts +++ b/packages/orchestration/src/client/api/schema/prompt-templating-module-config.ts @@ -11,9 +11,9 @@ import type { LLMModelDetails } from './llm-model-details.js'; */ export type PromptTemplatingModuleConfig = { /** - * The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. + * The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. If omitted, messages_history must be provided in the request body. * */ - prompt: Template | TemplateRef; + prompt?: Template | TemplateRef; model: LLMModelDetails; }; diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index e1022f765..e42f8428d 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -936,7 +936,7 @@ components: message: type: string description: Some message created from the module - example: Input to LLM is masked successfully. + example: Masking module executed successfully on LLM input. data: type: object description: Additional data object from the module @@ -1177,13 +1177,13 @@ components: PromptTemplatingModuleConfig: type: object required: - - prompt - model additionalProperties: false properties: prompt: description: > The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. + If omitted, messages_history must be provided in the request body. oneOf: - $ref: '#/components/schemas/Template' - $ref: '#/components/schemas/TemplateRef' diff --git a/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts b/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts index 31bc12b99..1d59c964f 100644 --- a/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts +++ b/packages/prompt-registry/src/client/prompt-registry/prompt-templates-api.ts @@ -84,7 +84,6 @@ export const PromptTemplatesApi = { scenario: string, version: string, name: string, - queryParameters?: { includeSpec?: boolean }, headerParameters?: { 'AI-Resource-Group'?: string; 'AI-Resource-Group-Scope'?: 'true' | 'True' | 'false' | 'False'; From ab742f14b2bdde4182cef079aa8f5e4e93c658ae Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Mon, 8 Jun 2026 12:49:29 +0000 Subject: [PATCH 4/6] Update orchestration based on main --- .../completion-request-configuration-reference-by-id.ts | 2 ++ ...equest-configuration-reference-by-name-scenario-version.ts | 2 ++ packages/orchestration/src/spec/api.yaml | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts index bba5a44ce..cdc5e0f8d 100644 --- a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts +++ b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts @@ -4,12 +4,14 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { CompletionRequestConfigurationReferenceByIdConfigRef } from './completion-request-configuration-reference-by-id-config-ref.js'; +import type { OrchestrationConfig } from './orchestration-config.js'; import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'CompletionRequestConfigurationReferenceById' schema. */ export type CompletionRequestConfigurationReferenceById = { config_ref: CompletionRequestConfigurationReferenceByIdConfigRef; + config?: OrchestrationConfig; /** * @example { * "groundingInput": "What is SAP Joule?", diff --git a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts index 1d931d600..1eb8e2624 100644 --- a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts +++ b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts @@ -4,12 +4,14 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef } from './completion-request-configuration-reference-by-name-scenario-version-config-ref.js'; +import type { OrchestrationConfig } from './orchestration-config.js'; import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'CompletionRequestConfigurationReferenceByNameScenarioVersion' schema. */ export type CompletionRequestConfigurationReferenceByNameScenarioVersion = { config_ref: CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef; + config?: OrchestrationConfig; /** * @example { * "groundingInput": "What is SAP Joule?", diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index e42f8428d..29fdcd0f3 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -2293,6 +2293,8 @@ components: properties: config_ref: $ref: '#/components/schemas/CompletionRequestConfigurationReferenceByIdConfigRef' + config: + $ref: '#/components/schemas/OrchestrationConfig' placeholder_values: type: object example: @@ -2324,6 +2326,8 @@ components: properties: config_ref: $ref: '#/components/schemas/CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef' + config: + $ref: '#/components/schemas/OrchestrationConfig' placeholder_values: type: object example: From e048e1f76b7f768abe45bd7c7e0680b83aa6b21a Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Fri, 12 Jun 2026 07:45:19 +0000 Subject: [PATCH 5/6] Update orchestration based on main --- ...n-request-configuration-reference-by-id.ts | 4 +- ...tion-reference-by-name-scenario-version.ts | 4 +- .../src/client/api/schema/index.ts | 3 ++ .../api/schema/partial-module-configs.ts | 21 ++++++++ .../schema/partial-orchestration-config.ts | 15 ++++++ ...partial-prompt-templating-module-config.ts | 20 ++++++++ packages/orchestration/src/spec/api.yaml | 50 ++++++++++++++++++- 7 files changed, 111 insertions(+), 6 deletions(-) create mode 100644 packages/orchestration/src/client/api/schema/partial-module-configs.ts create mode 100644 packages/orchestration/src/client/api/schema/partial-orchestration-config.ts create mode 100644 packages/orchestration/src/client/api/schema/partial-prompt-templating-module-config.ts diff --git a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts index cdc5e0f8d..eaa45d0a4 100644 --- a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts +++ b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-id.ts @@ -4,14 +4,14 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { CompletionRequestConfigurationReferenceByIdConfigRef } from './completion-request-configuration-reference-by-id-config-ref.js'; -import type { OrchestrationConfig } from './orchestration-config.js'; +import type { PartialOrchestrationConfig } from './partial-orchestration-config.js'; import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'CompletionRequestConfigurationReferenceById' schema. */ export type CompletionRequestConfigurationReferenceById = { config_ref: CompletionRequestConfigurationReferenceByIdConfigRef; - config?: OrchestrationConfig; + config?: PartialOrchestrationConfig; /** * @example { * "groundingInput": "What is SAP Joule?", diff --git a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts index 1eb8e2624..d2d6c98c4 100644 --- a/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts +++ b/packages/orchestration/src/client/api/schema/completion-request-configuration-reference-by-name-scenario-version.ts @@ -4,14 +4,14 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef } from './completion-request-configuration-reference-by-name-scenario-version-config-ref.js'; -import type { OrchestrationConfig } from './orchestration-config.js'; +import type { PartialOrchestrationConfig } from './partial-orchestration-config.js'; import type { ChatMessages } from './chat-messages.js'; /** * Representation of the 'CompletionRequestConfigurationReferenceByNameScenarioVersion' schema. */ export type CompletionRequestConfigurationReferenceByNameScenarioVersion = { config_ref: CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef; - config?: OrchestrationConfig; + config?: PartialOrchestrationConfig; /** * @example { * "groundingInput": "What is SAP Joule?", diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index 964c6db36..e300fb1e4 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -45,7 +45,9 @@ export * from './tool-call-chunk.js'; export * from './completion-post-response.js'; export * from './completion-post-response-streaming.js'; export * from './orchestration-config.js'; +export * from './partial-orchestration-config.js'; export * from './module-configs.js'; +export * from './partial-module-configs.js'; export * from './module-configs-list.js'; export * from './module-results-base.js'; export * from './module-results.js'; @@ -60,6 +62,7 @@ export * from './llm-choice.js'; export * from './llm-choice-streaming.js'; export * from './token-usage.js'; export * from './prompt-templating-module-config.js'; +export * from './partial-prompt-templating-module-config.js'; export * from './llm-model-details.js'; export * from './template.js'; export * from './response-format-text.js'; diff --git a/packages/orchestration/src/client/api/schema/partial-module-configs.ts b/packages/orchestration/src/client/api/schema/partial-module-configs.ts new file mode 100644 index 000000000..25102bd37 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/partial-module-configs.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ +import type { PartialPromptTemplatingModuleConfig } from './partial-prompt-templating-module-config.js'; +import type { FilteringModuleConfig } from './filtering-module-config.js'; +import type { MaskingModuleConfig } from './masking-module-config.js'; +import type { GroundingModuleConfig } from './grounding-module-config.js'; +import type { TranslationModuleConfig } from './translation-module-config.js'; +/** + * Partial module configuration for use with config_ref overrides. All fields are optional so that only the modules that should be overridden need to be specified. The remaining configuration is taken from the referenced orchestration config. + * + */ +export type PartialModuleConfigs = { + prompt_templating?: PartialPromptTemplatingModuleConfig; + filtering?: FilteringModuleConfig; + masking?: MaskingModuleConfig; + grounding?: GroundingModuleConfig; + translation?: TranslationModuleConfig; +}; diff --git a/packages/orchestration/src/client/api/schema/partial-orchestration-config.ts b/packages/orchestration/src/client/api/schema/partial-orchestration-config.ts new file mode 100644 index 000000000..4d9f03168 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/partial-orchestration-config.ts @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ +import type { PartialModuleConfigs } from './partial-module-configs.js'; +import type { GlobalStreamOptions } from './global-stream-options.js'; +/** + * Partial orchestration configuration for use with config_ref overrides. All fields are optional so that only the parts that should be overridden need to be specified. The remaining configuration is taken from the referenced orchestration config. + * + */ +export type PartialOrchestrationConfig = { + modules?: PartialModuleConfigs; + stream?: GlobalStreamOptions; +}; diff --git a/packages/orchestration/src/client/api/schema/partial-prompt-templating-module-config.ts b/packages/orchestration/src/client/api/schema/partial-prompt-templating-module-config.ts new file mode 100644 index 000000000..2a47a45a5 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/partial-prompt-templating-module-config.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ +import type { Template } from './template.js'; +import type { TemplateRef } from './template-ref.js'; +import type { LLMModelDetails } from './llm-model-details.js'; +/** + * Partial prompt templating configuration for use with config_ref overrides. model is optional so that only the prompt can be overridden without repeating the model config. + * + */ +export type PartialPromptTemplatingModuleConfig = { + /** + * The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. If omitted, messages_history must be provided in the request body. + * + */ + prompt?: Template | TemplateRef; + model?: LLMModelDetails; +}; diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index 29fdcd0f3..5b4957c7f 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -832,6 +832,18 @@ components: - $ref: '#/components/schemas/ModuleConfigsList' stream: $ref: '#/components/schemas/GlobalStreamOptions' + PartialOrchestrationConfig: + description: > + Partial orchestration configuration for use with config_ref overrides. All fields are + optional so that only the parts that should be overridden need to be specified. The + remaining configuration is taken from the referenced orchestration config. + type: object + additionalProperties: false + properties: + modules: + $ref: '#/components/schemas/PartialModuleConfigs' + stream: + $ref: '#/components/schemas/GlobalStreamOptions' ModuleConfigs: type: object required: @@ -848,6 +860,24 @@ components: $ref: '#/components/schemas/GroundingModuleConfig' translation: $ref: '#/components/schemas/TranslationModuleConfig' + PartialModuleConfigs: + description: > + Partial module configuration for use with config_ref overrides. All fields are optional + so that only the modules that should be overridden need to be specified. The remaining + configuration is taken from the referenced orchestration config. + type: object + additionalProperties: false + properties: + prompt_templating: + $ref: '#/components/schemas/PartialPromptTemplatingModuleConfig' + filtering: + $ref: '#/components/schemas/FilteringModuleConfig' + masking: + $ref: '#/components/schemas/MaskingModuleConfig' + grounding: + $ref: '#/components/schemas/GroundingModuleConfig' + translation: + $ref: '#/components/schemas/TranslationModuleConfig' ModuleConfigsList: type: array items: @@ -1189,6 +1219,22 @@ components: - $ref: '#/components/schemas/TemplateRef' model: $ref: '#/components/schemas/LLMModelDetails' + PartialPromptTemplatingModuleConfig: + description: > + Partial prompt templating configuration for use with config_ref overrides. model is + optional so that only the prompt can be overridden without repeating the model config. + type: object + additionalProperties: false + properties: + prompt: + description: > + The prompt template to be used. Can be either a user defined template or a reference to a template in the prompt registry. + If omitted, messages_history must be provided in the request body. + oneOf: + - $ref: '#/components/schemas/Template' + - $ref: '#/components/schemas/TemplateRef' + model: + $ref: '#/components/schemas/LLMModelDetails' LLMModelDetails: type: object description: > @@ -2294,7 +2340,7 @@ components: config_ref: $ref: '#/components/schemas/CompletionRequestConfigurationReferenceByIdConfigRef' config: - $ref: '#/components/schemas/OrchestrationConfig' + $ref: '#/components/schemas/PartialOrchestrationConfig' placeholder_values: type: object example: @@ -2327,7 +2373,7 @@ components: config_ref: $ref: '#/components/schemas/CompletionRequestConfigurationReferenceByNameScenarioVersionConfigRef' config: - $ref: '#/components/schemas/OrchestrationConfig' + $ref: '#/components/schemas/PartialOrchestrationConfig' placeholder_values: type: object example: From 16bc78e344342ce2dd7496cb14ddbc0341c32cd5 Mon Sep 17 00:00:00 2001 From: SAP Cloud SDK Bot Date: Tue, 16 Jun 2026 12:08:31 +0000 Subject: [PATCH 6/6] Update orchestration based on main --- .../api/schema/assistant-chat-message.ts | 6 ++++ .../src/client/api/schema/chat-delta.ts | 6 ++++ .../src/client/api/schema/index.ts | 1 + .../src/client/api/schema/reasoning-block.ts | 13 +++++++++ .../api/schema/response-chat-message.ts | 6 ++++ packages/orchestration/src/spec/api.yaml | 29 +++++++++++++++++++ 6 files changed, 61 insertions(+) create mode 100644 packages/orchestration/src/client/api/schema/reasoning-block.ts diff --git a/packages/orchestration/src/client/api/schema/assistant-chat-message.ts b/packages/orchestration/src/client/api/schema/assistant-chat-message.ts index 1e355e566..3dcd8608c 100644 --- a/packages/orchestration/src/client/api/schema/assistant-chat-message.ts +++ b/packages/orchestration/src/client/api/schema/assistant-chat-message.ts @@ -5,6 +5,7 @@ */ import type { ChatMessageContent } from './chat-message-content.js'; import type { MessageToolCalls } from './message-tool-calls.js'; +import type { ReasoningBlock } from './reasoning-block.js'; /** * Representation of the 'AssistantChatMessage' schema. */ @@ -13,4 +14,9 @@ export type AssistantChatMessage = { content?: ChatMessageContent; refusal?: string; tool_calls?: MessageToolCalls; + /** + * Reasoning or thinking content from the model's previous turn. + * + */ + reasoning_content?: ReasoningBlock[]; }; diff --git a/packages/orchestration/src/client/api/schema/chat-delta.ts b/packages/orchestration/src/client/api/schema/chat-delta.ts index 07909666b..739af8cc3 100644 --- a/packages/orchestration/src/client/api/schema/chat-delta.ts +++ b/packages/orchestration/src/client/api/schema/chat-delta.ts @@ -4,6 +4,7 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { ToolCallChunk } from './tool-call-chunk.js'; +import type { ReasoningBlock } from './reasoning-block.js'; /** * Representation of the 'ChatDelta' schema. */ @@ -15,4 +16,9 @@ export type ChatDelta = { */ refusal?: string; tool_calls?: ToolCallChunk[]; + /** + * Reasoning or thinking content generated by the model before the final response. + * + */ + reasoning_content?: ReasoningBlock[]; } & Record; diff --git a/packages/orchestration/src/client/api/schema/index.ts b/packages/orchestration/src/client/api/schema/index.ts index e300fb1e4..09909be70 100644 --- a/packages/orchestration/src/client/api/schema/index.ts +++ b/packages/orchestration/src/client/api/schema/index.ts @@ -123,3 +123,4 @@ export * from './completion-request-configuration-reference-by-id.js'; export * from './completion-request-configuration-reference-by-id-config-ref.js'; export * from './completion-request-configuration-reference-by-name-scenario-version.js'; export * from './completion-request-configuration-reference-by-name-scenario-version-config-ref.js'; +export * from './reasoning-block.js'; diff --git a/packages/orchestration/src/client/api/schema/reasoning-block.ts b/packages/orchestration/src/client/api/schema/reasoning-block.ts new file mode 100644 index 000000000..c0e87dae8 --- /dev/null +++ b/packages/orchestration/src/client/api/schema/reasoning-block.ts @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. + * + * This is a generated file powered by the SAP Cloud SDK for JavaScript. + */ + +/** + * Representation of the 'ReasoningBlock' schema. + */ +export type ReasoningBlock = { + content?: string; + signature?: string; +}; diff --git a/packages/orchestration/src/client/api/schema/response-chat-message.ts b/packages/orchestration/src/client/api/schema/response-chat-message.ts index 80409e9af..aa452abc2 100644 --- a/packages/orchestration/src/client/api/schema/response-chat-message.ts +++ b/packages/orchestration/src/client/api/schema/response-chat-message.ts @@ -4,6 +4,7 @@ * This is a generated file powered by the SAP Cloud SDK for JavaScript. */ import type { MessageToolCalls } from './message-tool-calls.js'; +import type { ReasoningBlock } from './reasoning-block.js'; /** * Representation of the 'ResponseChatMessage' schema. */ @@ -12,4 +13,9 @@ export type ResponseChatMessage = { content?: string; refusal?: string; tool_calls?: MessageToolCalls; + /** + * Reasoning or thinking content generated by the model before the final response. + * + */ + reasoning_content?: ReasoningBlock[]; }; diff --git a/packages/orchestration/src/spec/api.yaml b/packages/orchestration/src/spec/api.yaml index 5b4957c7f..28a424832 100644 --- a/packages/orchestration/src/spec/api.yaml +++ b/packages/orchestration/src/spec/api.yaml @@ -537,6 +537,12 @@ components: type: string tool_calls: $ref: '#/components/schemas/MessageToolCalls' + reasoning_content: + type: array + items: + $ref: '#/components/schemas/ReasoningBlock' + description: > + Reasoning or thinking content from the model's previous turn. required: - role UserChatMessage: @@ -650,6 +656,12 @@ components: type: string tool_calls: $ref: '#/components/schemas/MessageToolCalls' + reasoning_content: + type: array + items: + $ref: '#/components/schemas/ReasoningBlock' + description: > + Reasoning or thinking content generated by the model before the final response. required: - role # below tool message definitions are copied from openai spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L11007 @@ -752,6 +764,12 @@ components: type: array items: $ref: '#/components/schemas/ToolCallChunk' + reasoning_content: + type: array + items: + $ref: '#/components/schemas/ReasoningBlock' + description: > + Reasoning or thinking content generated by the model before the final response. # taken from: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L10979C27-L10979C40 ToolCallChunk: type: object @@ -2401,6 +2419,17 @@ components: version: type: string + ReasoningBlock: + type: object + additionalProperties: false + properties: + content: + type: string + default: '' + signature: + type: string + default: '' + responses: BadRequest: description: Bad Request