@@ -79,10 +79,13 @@ public record UnifiedCompletionRequest(
7979 */
8080 private static final String MAX_TOKENS_PARAM = "max_tokens_field" ;
8181 /**
82- * Some providers don't support the stream_options field.
83- * This parameter is used to skip the stream_options field in the JSON output.
82+ * Indicates whether to include the `stream_options` field in the JSON output.
83+ * Some providers do not support this field. In such cases, this parameter should be set to "false",
84+ * and the `stream_options` field will be excluded from the output.
85+ * For providers that do support stream options, this parameter is left unset (default behavior),
86+ * which implicitly includes the `stream_options` field in the output.
8487 */
85- public static final String SKIP_STREAM_OPTIONS_PARAM = "skip_stream_options " ;
88+ public static final String INCLUDE_STREAM_OPTIONS_PARAM = "include_stream_options " ;
8689
8790 /**
8891 * Creates a {@link org.elasticsearch.xcontent.ToXContent.Params} that causes ToXContent to include the key values:
@@ -100,14 +103,14 @@ public static Params withMaxTokens(String modelId, Params params) {
100103 * Creates a {@link org.elasticsearch.xcontent.ToXContent.Params} that causes ToXContent to include the key values:
101104 * - Key: {@link #MODEL_FIELD}, Value: modelId
102105 * - Key: {@link #MAX_TOKENS_FIELD}, Value: {@link #MAX_TOKENS_FIELD}
103- * - Key: {@link #SKIP_STREAM_OPTIONS_PARAM }, Value: "true "
106+ * - Key: {@link #INCLUDE_STREAM_OPTIONS_PARAM }, Value: "false "
104107 */
105108 public static Params withMaxTokensAndSkipStreamOptionsField (String modelId , Params params ) {
106109 return new DelegatingMapParams (
107110 Map .ofEntries (
108111 Map .entry (MODEL_ID_PARAM , modelId ),
109112 Map .entry (MAX_TOKENS_PARAM , MAX_TOKENS_FIELD ),
110- Map .entry (SKIP_STREAM_OPTIONS_PARAM , Boolean .TRUE .toString ())
113+ Map .entry (INCLUDE_STREAM_OPTIONS_PARAM , Boolean .FALSE .toString ())
111114 ),
112115 params
113116 );
0 commit comments