From ba3494b0c962a13fa49cc388370a272c02446c3e Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Tue, 7 Apr 2026 18:59:31 +0200 Subject: [PATCH 1/6] documenting --- docs-java/orchestration/chat-completion.mdx | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index 52276d3a9..5e871fbfd 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -495,7 +495,7 @@ config = config.withStreamConfig( ## Using Images -It's possible to add images and multiple text inputs to a message. +It's possible to add images, pdf files,and multiple text inputs to a message. ### Add Images to a Message @@ -521,6 +521,26 @@ var newMessage = message.withImage("https://url.to/image.jpg", ImageItem.DetailL Note, that currently only user messages are supported for image attachments. +### Add PDF File Attachment to a Message + +A pdf file can be added to a message either via a file path or via a base64 encoded string as follows. + +#### Add PDF via File Path + +```java +var message = Message.user("What is the title of the topic discussed here?"); +var newMessage = message.withPdf("path/to/sample.pdf"); +``` + +#### Add PDF via Base64 Encoded String + +```java +var message = Message.user("What is the title of the topic discussed here?"); +var newMessage = message.withPdfBase64(base64Data, "sample.pdf"); +``` + +Note, that currently only user messages are supported for PDF file attachments. + ### Add Multiple Text Inputs to a Message It's also possible to add multiple text inputs to a message. From 4b27343d79930be2269c148319d06c3098516773 Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Tue, 7 Apr 2026 19:07:53 +0200 Subject: [PATCH 2/6] removing word pdf --- docs-java/orchestration/chat-completion.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index 5e871fbfd..e7b81bd5f 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -521,18 +521,18 @@ var newMessage = message.withImage("https://url.to/image.jpg", ImageItem.DetailL Note, that currently only user messages are supported for image attachments. -### Add PDF File Attachment to a Message +### Add File Attachment to a Message -A pdf file can be added to a message either via a file path or via a base64 encoded string as follows. +A file can be added to a message either via a file path or via a base64 encoded string as follows. -#### Add PDF via File Path +#### Add File Attachment via File Path ```java var message = Message.user("What is the title of the topic discussed here?"); var newMessage = message.withPdf("path/to/sample.pdf"); ``` -#### Add PDF via Base64 Encoded String +#### Add File Attachment via Base64 Encoded String ```java var message = Message.user("What is the title of the topic discussed here?"); From 52d0b32b1db9f518da9098c03b025d66079c14e3 Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Tue, 7 Apr 2026 19:11:20 +0200 Subject: [PATCH 3/6] revert --- docs-java/orchestration/chat-completion.mdx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index e7b81bd5f..69e7c53dc 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -495,7 +495,7 @@ config = config.withStreamConfig( ## Using Images -It's possible to add images, pdf files,and multiple text inputs to a message. +It's possible to add images, PDF files, and multiple text inputs to a message. ### Add Images to a Message @@ -521,18 +521,18 @@ var newMessage = message.withImage("https://url.to/image.jpg", ImageItem.DetailL Note, that currently only user messages are supported for image attachments. -### Add File Attachment to a Message +### Add PDF File Attachment to a Message -A file can be added to a message either via a file path or via a base64 encoded string as follows. +A pdf file can be added to a message either via a file path or via a base64 encoded string as follows. -#### Add File Attachment via File Path +#### Add PDF via File Path ```java var message = Message.user("What is the title of the topic discussed here?"); var newMessage = message.withPdf("path/to/sample.pdf"); ``` -#### Add File Attachment via Base64 Encoded String +#### Add PDF via Base64 Encoded String ```java var message = Message.user("What is the title of the topic discussed here?"); @@ -643,7 +643,7 @@ Please find [an example in our Spring Boot application](https://github.com/SAP/a Translate the input or output to [any supported language](https://help.sap.com/docs/translation-hub/sap-translation-hub/supported-languages?version=Cloud#translation-provider-sap-machine-translation). The following sample will translate the prompt into English, send it to the LLM, and then translate the output to German. -Source Language is identified on the whole user input. +The source language is identified from the whole user input. ```java var prompt = new OrchestrationPrompt("Quelle est la couleur de la tour Eiffel?"); From f52643a2c3b05f9ad87ee6f824b7d5a63f4a193c Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Tue, 7 Apr 2026 19:16:21 +0200 Subject: [PATCH 4/6] accept word pdf --- docs-java/orchestration/chat-completion.mdx | 2 +- styles/config/vocabularies/SAP/accept.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index 69e7c53dc..668c759af 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -523,7 +523,7 @@ Note, that currently only user messages are supported for image attachments. ### Add PDF File Attachment to a Message -A pdf file can be added to a message either via a file path or via a base64 encoded string as follows. +A PDF file can be added to a message either via a file path or via a base64 encoded string as follows. #### Add PDF via File Path diff --git a/styles/config/vocabularies/SAP/accept.txt b/styles/config/vocabularies/SAP/accept.txt index 5dc569e77..fd9433a7f 100644 --- a/styles/config/vocabularies/SAP/accept.txt +++ b/styles/config/vocabularies/SAP/accept.txt @@ -83,6 +83,7 @@ www semver XML MDX +PDF classpath [Ss]ervlet [Aa]ccessor From 300062feba5a1b451d988b1af4db9c23c3d4ef89 Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Wed, 15 Apr 2026 13:20:32 +0200 Subject: [PATCH 5/6] update after remote file attachment support --- docs-java/orchestration/chat-completion.mdx | 24 +++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index 668c759af..677d38c85 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -521,25 +521,35 @@ var newMessage = message.withImage("https://url.to/image.jpg", ImageItem.DetailL Note, that currently only user messages are supported for image attachments. -### Add PDF File Attachment to a Message +### Add File Attachment to a Message -A PDF file can be added to a message either via a file path or via a base64 encoded string as follows. +A file can be added to a message either via a file path or via a base64 encoded string as follows. +Only PDF files are currently supported for file attachments. -#### Add PDF via File Path +#### Add File via Local File Path ```java var message = Message.user("What is the title of the topic discussed here?"); -var newMessage = message.withPdf("path/to/sample.pdf"); +var newMessage = message.withFile("path/to/sample.pdf"); ``` -#### Add PDF via Base64 Encoded String +#### Add File via Remote File Path + +Filename is an optional parameter to the `withFileUrl` method shown below and could be set to null. + +```java +var message = Message.user("What is the title of the topic discussed here?"); +var newMessage = message.withFileUrl("https://somefile.pdf", "sample.pdf"); +``` + +#### Add File via Base64 Encoded String ```java var message = Message.user("What is the title of the topic discussed here?"); -var newMessage = message.withPdfBase64(base64Data, "sample.pdf"); +var newMessage = message.withFileBase64(base64Data, "sample.pdf"); ``` -Note, that currently only user messages are supported for PDF file attachments. +Note, that currently only user messages are supported for file attachments. ### Add Multiple Text Inputs to a Message From a314b46df1e9a546f30f2e2c222fa1ce40cc946d Mon Sep 17 00:00:00 2001 From: Nourhan Shata Date: Thu, 16 Apr 2026 14:14:18 +0200 Subject: [PATCH 6/6] fix compilation --- docs-java/orchestration/chat-completion.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs-java/orchestration/chat-completion.mdx b/docs-java/orchestration/chat-completion.mdx index 677d38c85..7f7edc062 100644 --- a/docs-java/orchestration/chat-completion.mdx +++ b/docs-java/orchestration/chat-completion.mdx @@ -495,7 +495,7 @@ config = config.withStreamConfig( ## Using Images -It's possible to add images, PDF files, and multiple text inputs to a message. +It's possible to add images, files, and multiple text inputs to a message. ### Add Images to a Message @@ -530,7 +530,7 @@ Only PDF files are currently supported for file attachments. ```java var message = Message.user("What is the title of the topic discussed here?"); -var newMessage = message.withFile("path/to/sample.pdf"); +var newMessage = message.withFile(Path.of("path/to/sample.pdf")); ``` #### Add File via Remote File Path