From 29ba6c19fe15d8b32fbbba799725e4d14442eff5 Mon Sep 17 00:00:00 2001 From: Vladimir Aseev Date: Wed, 9 Sep 2026 15:54:55 +0200 Subject: [PATCH] remove irrelevant for demo functionality from sample app gui, restyle --- .../src/main/resources/static/index.html | 2472 +++++------------ .../src/main/resources/static/pcm-audio.js | 2 +- 2 files changed, 771 insertions(+), 1703 deletions(-) diff --git a/sample-code/spring-app/src/main/resources/static/index.html b/sample-code/spring-app/src/main/resources/static/index.html index e1e45b008..363748311 100644 --- a/sample-code/spring-app/src/main/resources/static/index.html +++ b/sample-code/spring-app/src/main/resources/static/index.html @@ -1,1717 +1,785 @@ - - - Java AI SDK Application - - + + + SAP AI SDK — Realtime API + + + + - -
-
-
- AI SDK Logo -

Java AI SDK Application

+ +
+
+ + SAP AI SDK + | + Realtime API +
+ +
+ + +
+ + +
+
+ Module 01 +

Text-to-Speech

+
+

Synthesize speech from text over a Realtime WebSocket connection.

+ +
+
+ >_ +
-
-
-
-
-

🧰 AI Core

- The AI Core API provides tools to manage the lifecycle of your own AI - scenarios, including artifacts, pipeline execution, and scalable deployments - for training and inference. - For more information, check the AI Core documentation. -
-
-
Java Specific Deployments
-
    -
  • -
    - -
    - Create and delete a deployment with the Java specific - configuration ID. -
    -
    -
  • -
  • -
    - -
    - Stop all deployments with the Java specific configuration - ID. Only RUNNING - deployments can be STOPPED. -
    -
    -
  • -
  • -
    - -
    - Delete all deployments with the Java specific configuration - ID. Only UNKNOWN and - STOPPED deployments can be DELETED -
    -
    -
  • -
  • -
    - -
    - Get all deployments with the Java specific configuration ID. -
    -
    -
  • -
-
-
All Deployments
-
    -
  • -
    - -
    - Get all deployments, including non-Java specific - deployments. -
    -
    -
  • -
-
-
Scenarios
-
    -
  • -
    - -
    - Get the list of available scenarios. -
    -
    -
  • -
  • -
    - -
    - Get the list of available models. -
    -
    -
  • -
-
-
Configurations
-
    -
  • -
    - -
    - Get the list of configurations. -
    -
    -
  • -
-
-
-
- -
-
-
-
- Orchestration Logo -

Orchestration

-
- The Orchestration API offers functionality for enhancing your LLM calls with - Templating, - Filtering, Data Masking, Grounding and more. - For more information, check the Orchestration documentation -
-
-
-
Chat completion
-
    -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with a simple prompt. -
    -
    -
  • -
  • -
    - -
    - Asynchronous stream of an LLM chat request. -
    -
    -
  • -
  • -
    - -
    - Chat request against a reasoning-capable model. Returns - both the final answer and its reasoning. -
    -
    -
  • -
  • -
    - -
    - Streaming variant that both answer and reasoning chunks. -
    -
    -
  • -
  • -
    - -
    - Two-turn conversation demonstrating re-submission of - reasoning_content in messages_history. -
    -
    -
  • -
  • -
    - -
    - Chat request with a list of LLM modules to call. If the - first fails (which will happen here), the next module is - called. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with a template. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - using message history. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with image as input. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with multiple texts. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with file input from a URL. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with file input from a local path. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with base64-encoded file input. -
    -
    -
  • - -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with citations from Perplexity Sonar. -
    -
    -
  • -
-
-
-
-
Filtering and Masking
-
-
    -
  • -
    - -
    - Apply lenient input filtering for a request to - orchestration. -
    -
    -
  • -
  • -
    - -
    - Apply lenient output filtering for a request to - orchestration. -
    -
    -
  • -
  • -
    - -
    - Apply lenient input filtering for a request to - orchestration. -
    -
    -
  • -
  • -
    - -
    - Let the orchestration service evaluate the feedback on - the AI SDK provided by a - hypothetical - user. Anonymize any names given as they are not relevant - for judging the - sentiment of the - feedback. -
    -
    -
  • -
  • -
    - -
    - Let the LLM respond with a masked repeated phrase of - patient IDs. -
    -
    -
  • -
  • -
    - -
    - Let the orchestration service a response to a - hypothetical user who provided - feedback on the AI - SDK. Pseudonymize the user's name and location to - protect their privacy. -
    -
    -
  • -
-
-
-
-
Grounding
-
    -
  • -
    - -
    - Using grounding to provide additional context to the AI - model. -
    -
    -
  • -
  • -
    - -
    - The request to the grounding service will be masked. -
    -
    -
  • -
  • -
    - -
    - Using grounding via a sharepoint repository to provide - additional context to the AI model. -
    -
    -
  • -
  • -
    - -
    - Using grounding via *help.sap.com* to provide additional - SAP-specific context to the AI model. -
    -
    -
  • -
-
-
-
-
Response format
-
    -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - where the output will adhere to a given JSON schema. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - where the output will consist of valid JSON. -
    -
    -
  • -
-
-
-
-
Template and Config - Reference
-
-
    -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - in tenant scope - using a template from the prompt registry identified by - ID. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - in resource group - scope - using a template from the prompt registry identified by - ID. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - in tenant scope - using a template from the prompt registry identified by - Scenario, name, and version. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - in resource group - scope - using a template from the prompt registry identified by - Scenario, name, and version. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - using a local template file. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM using an Orchestration config - stored in prompt registry. -
    -
    -
  • -
-
-
-
-
Translation
-
-
    -
  • -
    - -
    - French question translated to English, sent to LLM, then - translated to German. -
    -
    -
  • -
-
-
-
-
Embedding
-
-
    -
  • -
    - -
    - Get the embedding of a text after masking using the - Orchestration - service. -
    -
    -
  • -
-
-
-
-
- -
-
-
-

🧑‍🔬 Foundation Models

- The Foundation Models API offers functionality for directly calling a - foundation model and using - the features provided by its own API. - For more information, check the Foundation Models documentation. -
-
-
- OpenAI Logo -
OpenAI
-
-
-
Chat completion
-
    -
  • -
    - -
    - Chat request to OpenAI. -
    -
    -
  • -
  • -
    - -
    - Asynchronous stream of an OpenAI chat request. -
    -
    -
  • -
  • -
    - -
    - Asynchronous stream of an OpenAI chat request and - provision - of complete - response. -
    -
    -
  • -
  • -
    - -
    - Chat request to OpenAI with an executed tool call. -
    -
    -
  • -
  • -
    - -
    - Chat request to OpenAI with an image. -
    -
    -
  • -
  • -
    - -
    - Get the embedding of a text. -
    -
    -
  • -
  • -
    - -
    - Chat request to OpenAI filtering by resource group. -
    -
    -
  • -
-
-
-
-
Responses
-
    -
  • -
    - -
    - Create a response using Responses API -
    -
    -
  • -
  • -
    - -
    - Create a streaming response using Responses API -
    -
    -
  • -
  • -
    - -
    - Create a persistent response and return its ID. -
    -
    -
  • -
  • -
    - -
    - Create a background (async) persistent response. -
    -
    -
  • -
  • -
    - -
    - Retrieve a stored response by ID. -
    -
    -
  • -
  • -
    - -
    - Cancel a background response by ID. -
    -
    -
  • -
  • -
    - -
    - Delete a stored response by ID. -
    -
    -
  • -
-
-
-
-
- SAP Logo -
SAP RPT
-
-
    -
  • -
    - -
    - Predict request to SAP RPT. -
    -
    -
  • -
  • -
    - -
    - Predict request to SAP RPT with Parquet file input. -
    -
    -
  • -
-
-
-
- -
-
-
-
- Spring Logo -

Spring AI

-
- Our clients are integrated within the Spring AI framework -
-
-
- Orchestration Logo -
Orchestration Integration
-
-
    -
  • -
    - -
    - Embedding request to an embedding model through the - Orchestration service - with a simple prompt. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with a simple prompt. -
    -
    -
  • -
  • -
    - -
    - Asynchronous stream of an LLM chat request through the - Orchestration service. -
    -
    -
  • -
  • -
    - -
    - Chat request to an LLM through the Orchestration service - with a Spring AI - template. -
    -
    -
  • -
  • -
    - -
    - Let the orchestration service evaluate the feedback on the - AI SDK provided by a hypothetical user. Anonymize any names - given as they are not relevant for judging the sentiment of - the feedback. -
    -
    -
  • -
  • -
    - -
    - Apply strict input filtering for a request to orchestration - using the SpringAI integration. -
    -
    -
  • -
  • -
    - -
    - Apply strict output filtering for a request to orchestration - using the SpringAI integration. -
    -
    -
  • -
  • -
    - -
    - Register a function that will be called when the user asks - for the weather. -
    -
    -
  • -
  • -
    - -
    - Use an MCP file system server as tool to answer questions - about the SDK itself. - ⚠️ Only works if the server is started with the "mcp" Spring - profile ⚠️. -
    -
    -
  • -
  • -
    - -
    - The user firsts asks the capital of France, then the typical - for there, chat memory will remember that the user is - inquiring about France. -
    -
    -
  • -
-
-
-
-
🤖 Agentic Workflows
-
-
    -
  • -
    - -
    - Make a call to a simple chain-like agentic workflow. -
    -
    -
  • -
-
-
-
- OpenAI Logo -
OpenAI
-
-
    -
  • -
    - -
    - Get the embedding for a given string using OpenAI. -
    -
    -
  • -
  • -
    - -
    - Chat Request with a simple prompt using OpenAI. -
    -
    -
  • -
  • -
    - -
    - Asynchronous stream of a request using OpenAI. -
    -
    -
  • -
  • -
    - -
    - Register a function that will be called when the user asks - for the weather using - OpenAI. -
    -
    -
  • -
  • -
    - -
    - The user firsts asks the capital of France, then the typical - for there, chat memory will remember that the user is - inquiring about France using OpenAI. -
    -
    -
  • -
-
-
-
- -
-
-
-
- Grounding Logo -

Document Grounding

-
- The Document Grounding API offers additional context for enhancing your - Orchestration LLM calls. - For more information, check the Wiki -
-
-
    -
  • -
    - - -
    - List all active pipelines in the document grounding module. - They can be used to index document storages like Sharepoint - pages or SFTP servers. -
    -
    -
  • -
  • -
    - -
    - Show all available document collections. -
    -
    -
  • -
  • -
    - -
    - Search in current document collections for a prompt. -
    -
    -
  • -
-
-
-
- -
-
-
-

📚 Prompt Registry

- Manage the life cycle of your prompts, from design to runtime. - Can be used in combination with Orchestration. - For more information, check the Prompt Registry documentation. -
-
-
    -
  • -
    - -
    - List of all templates -
    -
    -
  • -
  • -
    - -
    - Create a template in the prompt registry. -
    -
    -
  • -
  • -
    - -
    - Create a template in the prompt registry then update it. -
    -
    -
  • -
  • -
    - -
    - Get the history of a template for a specific version only. -
    -
    -
  • -
  • -
    - -
    - Import a template from a YAML file. -
    -
    -
  • -
  • -
    - -
    - Substitute the user input param -
    -
    -
  • -
  • -
    - -
    - Delete all Java templates in the prompt registry. -
    -
    -
  • -
  • -
    - -
    - Get a SpringAI list of messages from a Prompt Registry - Response. -
    -
    -
  • -
  • -
    - -
    - List all Orchestration Configs. -
    -
    -
  • -
-
-
-
- -
-
-
-
-

📂 Batch API

-
- Batch API calls together to reduce the number of HTTP connections your - client has to make. - For more information, check the Batch API Documentation -
-
-
    -
  • -
    - -
    - Upload the input and create a new batch job. -
    -
    -
  • -
-
    -
  • -
    - -
    - List all batch jobs. -
    -
    -
  • -
-
    -
  • -
    - -
    - Get a batch job for an id. -
    -
    -
  • -
-
    -
  • -
    - -
    - Delete a batch job for an id. -
    -
    -
  • -
-
    -
  • -
    - -
    - Read the content of a batch output in the S3 bucket. -
    -
    -
  • -
-
    -
  • -
    - -
    - Upload the input.jsonl file to the S3 bucket. -
    -
    -
  • -
-
-
-
- -
-
-
-
-

⏰ Realtime API

-
- Realtime API allows for various real time interactions Voice agents and speech generation scenarios are - currently supported. -
- In these examples, web socket sessions are created and used - to send text/audio to the local server and receive audio back. -
-
- - -
-
-
    -
  • -
    - -
    - Send text to the Realtime API and receive a PCM audio file - back. -
    -
    -
  • -
-
    -
  • -
    - -
    - Send audio to the Realtime API and receive a PCM audio file - back. -
    -
    -
  • -
-
    -
  • -
    -
    Text to speech
    - disabled -
    - - - -
    -
    Translate input text into output - sound (speech). -
    -
    - - -
  • -
  • -
    -
    Speech to speech
    - socket: disconnected
    - microphone: disabled -
    - -
    -
    Speak with an AI assistant.
    -
    - -
  • -
-
-
-
+ + + +
+
+ Status + ready +
-
-
-
- - - - + - +
+ + +
+
+ Module 02 +

Speech-to-Speech

+
+

Live bidirectional voice conversation with the AI assistant.

+ +
+
+ + + + + + +
-
- ❓ -
- Welcome to the Java AI SDK Application. In this Demo and End-to-End Test App you can - test several endpoints of our API. For more information, check our GitHub repository - linked at the bottom. -
+ +
+
+ Socket + disconnected +
+
+ Mic + disabled +
- - +
+
+ +
+ + + + + + + + + + + + + + + diff --git a/sample-code/spring-app/src/main/resources/static/pcm-audio.js b/sample-code/spring-app/src/main/resources/static/pcm-audio.js index fa31e2a5b..6845abeba 100644 --- a/sample-code/spring-app/src/main/resources/static/pcm-audio.js +++ b/sample-code/spring-app/src/main/resources/static/pcm-audio.js @@ -6,7 +6,7 @@ function createAudioContext() { function setStatus(element, text, active) { element.textContent = text; - element.style.color = active ? '#198754' : '#6c757d'; + element.style.color = active ? '#00d4ff' : '#3a4a58'; } function playPcmAudio(audioContext, arrayBuffer, state) {