Package com.sap.ai.sdk.orchestration
Class OrchestrationClient.ChatCompletionExecutor
java.lang.Object
com.sap.ai.sdk.orchestration.OrchestrationClient.ChatCompletionExecutor
- Enclosing class:
OrchestrationClient
Client to execute a configured chat completion with a regular or streaming response.
-
Method Summary
Modifier and TypeMethodDescriptionexecute()Generate a completion for the given prompt.Generate a completion for the given prompt.Generate a completion with detailed streaming deltas, including metadata.
-
Method Details
-
execute
Generate a completion for the given prompt.- Returns:
- the completion output
- Throws:
OrchestrationClientException- if the request fails.
-
executeStream
Generate a completion for the given prompt.- Returns:
- a stream of message deltas
- Throws:
OrchestrationClientException- if the request fails or if the finish reason is content_filter- Since:
- 1.1.0
-
executeStreamDeltas
@Nonnull public Stream<OrchestrationChatCompletionDelta> executeStreamDeltas() throws OrchestrationClientExceptionGenerate a completion with detailed streaming deltas, including metadata.Streaming is enabled on a copy of the configured request. The caller must close the returned stream. Content-filter finish reasons are available in the deltas rather than converted to exceptions.
- Returns:
- a stream of chat completion deltas.
- Throws:
OrchestrationClientException- if the request fails.
-