Skip to main content

io.enterpriseai.model.ChatChunk

Source: sdks/java/enterprise-ai-java/src/main/java/io/enterpriseai/model/ChatChunk.java. Back to the Java SDK reference index.

note

This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.

Model ChatChunk​

One streamed chat completion chunk.

Fields:

NameTypeRequiredDescription
rawJsonNodeyesRaw JSON body of the chunk, OpenAI compatible.

ChatChunk.delta​

String delta()

Delta text of the first choice, empty when absent.

This element takes no parameter.

Returns: String. The choices[0].delta.content text, or an empty string.

ChatChunk.finishReason​

String finishReason()

Finish reason of the first choice, present on the last chunk.

This element takes no parameter.

Returns: String. choices[0].finish_reason, such as stop, or null when absent.

ChatChunk.usage​

JsonNode usage()

Token usage carried by the chunk.

This element takes no parameter.

Returns: JsonNode. The usage node of the chunk, a MissingNode when absent.