Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3c85408
add getAllMessages() and sample code
shibeshduw Feb 12, 2025
8cc4c80
remove role check
shibeshduw Feb 13, 2025
0f9b0d4
Merge branch 'main' into orchestration-chat-ux
shibeshduw Feb 13, 2025
da97c53
fix: Changes from lint
Feb 13, 2025
3f1ba87
Merge remote-tracking branch 'origin/main' into orchestration-chat-ux
shibeshduw Feb 18, 2025
8961dab
refactor and documentation
shibeshduw Feb 18, 2025
6f32df9
remove handleSingleChatMessage
shibeshduw Feb 18, 2025
5351d7a
Merge branch 'main' into orchestration-chat-ux
shibeshduw Apr 23, 2025
24f1c61
typo
shibeshduw Apr 23, 2025
04c6b92
remove transformation
shibeshduw Apr 24, 2025
9a90542
spec update from orchestration/main
shibeshduw Apr 25, 2025
fc6ff91
small adjustment
shibeshduw Apr 25, 2025
1626d9f
fix test
shibeshduw Apr 25, 2025
0f34b38
adjust sample
shibeshduw Apr 25, 2025
bbecba0
Merge remote-tracking branch 'origin/main' into orchestration-chat-ux
shibeshduw Apr 25, 2025
85660fb
wip
shibeshduw Apr 25, 2025
fc70bd6
fix: Changes from lint
Apr 25, 2025
977a5a0
update readme
shibeshduw Apr 29, 2025
de04855
unit test for convenience
shibeshduw Apr 30, 2025
bf39470
Merge remote-tracking branch 'origin/main' into orchestration-chat-ux
shibeshduw Apr 30, 2025
8520d10
link issue
shibeshduw May 6, 2025
67197de
Merge remote-tracking branch 'origin/main' into orchestration-chat-ux
shibeshduw May 6, 2025
3a5de95
typo
shibeshduw May 6, 2025
b6c8b1e
changeset
shibeshduw May 6, 2025
46ce29d
Update .changeset/fuzzy-kids-divide.md
shibeshduw May 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright (c) 2025 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 { ChatMessageContent } from './chat-message-content.js';
import type { MessageToolCalls } from './message-tool-calls.js';
/**
* Representation of the 'AssistantChatMessage' schema.
*/
export type AssistantChatMessage = {
role: 'assistant';
content?: ChatMessageContent;
refusal?: string;
tool_calls?: MessageToolCalls;
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { TextContent } from './text-content.js';
import type { ImageContent } from './image-content.js';
/**
* Representation of the 'MultiChatMessageContent' schema.
* Representation of the 'ChatMessageContent' schema.
*/
export type MultiChatMessageContent = TextContent | ImageContent;
export type ChatMessageContent = string | TextContent[];
14 changes: 11 additions & 3 deletions packages/orchestration/src/client/api/schema/chat-message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,17 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { SingleChatMessage } from './single-chat-message.js';
import type { MultiChatMessage } from './multi-chat-message.js';
import type { SystemChatMessage } from './system-chat-message.js';
import type { UserChatMessage } from './user-chat-message.js';
import type { AssistantChatMessage } from './assistant-chat-message.js';
import type { ToolChatMessage } from './tool-chat-message.js';
import type { DeveloperChatMessage } from './developer-chat-message.js';
/**
* Representation of the 'ChatMessage' schema.
*/
export type ChatMessage = SingleChatMessage | MultiChatMessage;
export type ChatMessage =
| SystemChatMessage
| UserChatMessage
| AssistantChatMessage
| ToolChatMessage
| DeveloperChatMessage;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2025 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 { ChatMessageContent } from './chat-message-content.js';
/**
* Representation of the 'DeveloperChatMessage' schema.
*/
export type DeveloperChatMessage = {
role: 'developer';
content: ChatMessageContent;
};
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,15 @@ export type GlobalStreamOptions = {
* Minimum: 1.
*/
chunk_size?: number;
/**
* List of delimiters to split the input text into chunks.Please note, this is a required parameter when `input_translation_module_config` or `output_translation_module_config` are configured.
* @example [
* "\n",
* ".",
* "?",
* "!"
* ]
* Min Items: 1.
*/
delimiters?: string[];
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/

/**
* Representation of the 'SingleChatMessage' schema.
* Representation of the 'ImageContentUrl' schema.
*/
export type SingleChatMessage = {
export type ImageContentUrl = {
url: string;
/**
* @example "user"
* Default: "auto".
*/
role: string;
content: string;
detail?: string;
};
19 changes: 0 additions & 19 deletions packages/orchestration/src/client/api/schema/image-content.ts

This file was deleted.

22 changes: 15 additions & 7 deletions packages/orchestration/src/client/api/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
export * from './completion-post-request.js';
export * from './chat-message.js';
export * from './chat-messages.js';
export * from './templating-chat-message.js';
export * from './single-chat-message.js';
export * from './chat-message.js';
export * from './system-chat-message.js';
export * from './chat-message-content.js';
export * from './assistant-chat-message.js';
export * from './user-chat-message.js';
export * from './user-chat-message-content.js';
export * from './user-chat-message-content-item.js';
export * from './image-content-url.js';
export * from './tool-chat-message.js';
export * from './developer-chat-message.js';
export * from './response-chat-message.js';
export * from './response-message-tool-calls.js';
export * from './response-message-tool-call.js';
export * from './multi-chat-message.js';
export * from './multi-chat-message-content.js';
export * from './message-tool-calls.js';
export * from './message-tool-call.js';
export * from './text-content.js';
export * from './image-content.js';
export * from './chat-delta.js';
export * from './tool-call-chunk.js';
export * from './completion-post-response.js';
Expand Down Expand Up @@ -66,4 +71,7 @@ export * from './data-repository-type.js';
export * from './key-value-list-pair.js';
export * from './search-document-key-value-list-pair.js';
export * from './search-select-option-enum.js';
export * from './input-translation-module-config.js';
export * from './output-translation-module-config.js';
export * from './sap-document-translation.js';
export * from './error-response.js';
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 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 { SAPDocumentTranslation } from './sap-document-translation.js';
/**
* Representation of the 'InputTranslationModuleConfig' schema.
*/
export type InputTranslationModuleConfig = SAPDocumentTranslation;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export type LlmModuleConfig = {
* "temperature": 0.1,
* "frequency_penalty": 0,
* "presence_penalty": 0,
* "n": 2
* "n": 2,
* "stream_options": {
* "include_usage": true
* }
* }
*/
model_params?: Record<string, any>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/

/**
* Representation of the 'ResponseMessageToolCall' schema.
* Representation of the 'MessageToolCall' schema.
*/
export type ResponseMessageToolCall = {
export type MessageToolCall = {
/**
* The ID of the tool call.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { ResponseMessageToolCall } from './response-message-tool-call.js';
import type { MessageToolCall } from './message-tool-call.js';
/**
* The tool calls generated by the model, such as function calls.
*/
export type ResponseMessageToolCalls = ResponseMessageToolCall[];
export type MessageToolCalls = MessageToolCall[];
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import type { TemplatingModuleConfig } from './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 { InputTranslationModuleConfig } from './input-translation-module-config.js';
import type { OutputTranslationModuleConfig } from './output-translation-module-config.js';
/**
* Representation of the 'ModuleConfigs' schema.
*/
Expand All @@ -17,4 +19,6 @@ export type ModuleConfigs = {
filtering_module_config?: FilteringModuleConfig;
masking_module_config?: MaskingModuleConfig;
grounding_module_config?: GroundingModuleConfig;
input_translation_module_config?: InputTranslationModuleConfig;
output_translation_module_config?: OutputTranslationModuleConfig;
};
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ import type { LlmChoiceStreaming } from './llm-choice-streaming.js';
export type ModuleResults = {
grounding?: GenericModuleResult;
templating?: TemplatingChatMessage;
input_translation?: GenericModuleResult;
input_masking?: GenericModuleResult;
input_filtering?: GenericModuleResult;
llm?: LlmModuleResult;
output_filtering?: GenericModuleResult;
output_unmasking?: (LlmChoice | LlmChoiceStreaming)[];
output_translation?: GenericModuleResult;
};
16 changes: 0 additions & 16 deletions packages/orchestration/src/client/api/schema/multi-chat-message.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 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 { SAPDocumentTranslation } from './sap-document-translation.js';
/**
* Representation of the 'OutputTranslationModuleConfig' schema.
*/
export type OutputTranslationModuleConfig = SAPDocumentTranslation;
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
*
* This is a generated file powered by the SAP Cloud SDK for JavaScript.
*/
import type { SingleChatMessage } from './single-chat-message.js';
import type { ResponseMessageToolCalls } from './response-message-tool-calls.js';
import type { MessageToolCalls } from './message-tool-calls.js';
/**
* Representation of the 'ResponseChatMessage' schema.
*/
export type ResponseChatMessage = SingleChatMessage & {
/**
* @example "I'm sorry, I can't answer that question."
*/
export type ResponseChatMessage = {
role?: 'assistant';
content?: string;
refusal?: string;
tool_calls?: ResponseMessageToolCalls;
tool_calls?: MessageToolCalls;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2025 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 'SAPDocumentTranslation' schema.
*/
export type SAPDocumentTranslation = {
/**
* Type of document translation provider
* @example "sap_document_translation"
*/
type: 'sap_document_translation';
/**
* Configuration for `sap_document_translation` translation provider.
*/
config: {
/**
* Language of the text to be translated.
* @example "de-DE"
*/
source_language?: string;
/**
* Language to which the text should be translated.
* @example "en-US"
*/
target_language: string;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2025 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 { ChatMessageContent } from './chat-message-content.js';
/**
* Representation of the 'SystemChatMessage' schema.
*/
export type SystemChatMessage = {
role: 'system';
content: ChatMessageContent;
};
17 changes: 17 additions & 0 deletions packages/orchestration/src/client/api/schema/tool-chat-message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* Copyright (c) 2025 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 { ChatMessageContent } from './chat-message-content.js';
/**
* Representation of the 'ToolChatMessage' schema.
*/
export type ToolChatMessage = {
/**
* @example "tool"
*/
role: 'tool';
tool_call_id: string;
content: ChatMessageContent;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2025 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 { ImageContentUrl } from './image-content-url.js';
/**
* Representation of the 'UserChatMessageContentItem' schema.
*/
export type UserChatMessageContentItem = {
type: 'text' | 'image_url';
text?: string;
image_url?: ImageContentUrl;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2025 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 { UserChatMessageContentItem } from './user-chat-message-content-item.js';
/**
* Representation of the 'UserChatMessageContent' schema.
*/
export type UserChatMessageContent = string | UserChatMessageContentItem[];
13 changes: 13 additions & 0 deletions packages/orchestration/src/client/api/schema/user-chat-message.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2025 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 { UserChatMessageContent } from './user-chat-message-content.js';
/**
* Representation of the 'UserChatMessage' schema.
*/
export type UserChatMessage = {
content: UserChatMessageContent;
role: 'user';
};
Loading
Loading