Class ResponseCompactParams
-
- All Implemented Interfaces:
-
com.openai.core.Params
public final class ResponseCompactParams implements Params
Compact a conversation. Returns a compacted response object.
Learn when and how to compact long-running conversations in the conversation state guide. For ZDR-compatible compaction details, see Compaction (advanced).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classResponseCompactParams.BuilderA builder for ResponseCompactParams.
public final classResponseCompactParams.Bodypublic final classResponseCompactParams.ModelModel ID used to generate the response, like
gpt-5oro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.public final classResponseCompactParams.InputText, image, or file inputs to the model, used to generate a response
public final classResponseCompactParams.PromptCacheRetentionHow long to retain a prompt cache entry created by this request.
public final classResponseCompactParams.ServiceTierThe service tier to use for this request.
-
Method Summary
Modifier and Type Method Description final Optional<ResponseCompactParams.Model>model()Model ID used to generate the response, like gpt-5oro3.final Optional<ResponseCompactParams.Input>input()Text, image, or file inputs to the model, used to generate a response final Optional<String>instructions()A system (or developer) message inserted into the model's context. final Optional<String>previousResponseId()The unique ID of the previous response to the model. final Optional<String>promptCacheKey()A key to use when reading from or writing to the prompt cache. final Optional<ResponseCompactParams.PromptCacheRetention>promptCacheRetention()How long to retain a prompt cache entry created by this request. final Optional<ResponseCompactParams.ServiceTier>serviceTier()The service tier to use for this request. final JsonField<ResponseCompactParams.Model>_model()Returns the raw JSON value of model. final JsonField<ResponseCompactParams.Input>_input()Returns the raw JSON value of input. final JsonField<String>_instructions()Returns the raw JSON value of instructions. final JsonField<String>_previousResponseId()Returns the raw JSON value of previousResponseId. final JsonField<String>_promptCacheKey()Returns the raw JSON value of promptCacheKey. final JsonField<ResponseCompactParams.PromptCacheRetention>_promptCacheRetention()Returns the raw JSON value of promptCacheRetention. final JsonField<ResponseCompactParams.ServiceTier>_serviceTier()Returns the raw JSON value of serviceTier. final Map<String, JsonValue>_additionalBodyProperties()final Headers_additionalHeaders()Additional headers to send with the request. final QueryParams_additionalQueryParams()Additional query param to send with the request. final ResponseCompactParams.BuildertoBuilder()final ResponseCompactParams.Body_body()Headers_headers()The full set of headers in the parameters, including both fixed and additional headers. QueryParams_queryParams()The full set of query params in the parameters, including both fixed and additional query params. Booleanequals(Object other)IntegerhashCode()StringtoString()final static ResponseCompactParams.Builderbuilder()Returns a mutable builder for constructing an instance of ResponseCompactParams. -
-
Method Detail
-
model
final Optional<ResponseCompactParams.Model> model()
Model ID used to generate the response, like
gpt-5oro3. OpenAI offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the model guide to browse and compare available models.
-
input
final Optional<ResponseCompactParams.Input> input()
Text, image, or file inputs to the model, used to generate a response
-
instructions
final Optional<String> instructions()
A system (or developer) message inserted into the model's context. When used along with
previous_response_id, the instructions from a previous response will not be carried over to the next response. This makes it simple to swap out system (or developer) messages in new responses.
-
previousResponseId
final Optional<String> previousResponseId()
The unique ID of the previous response to the model. Use this to create multi-turn conversations. Learn more about conversation state. Cannot be used in conjunction with
conversation.
-
promptCacheKey
final Optional<String> promptCacheKey()
A key to use when reading from or writing to the prompt cache.
-
promptCacheRetention
final Optional<ResponseCompactParams.PromptCacheRetention> promptCacheRetention()
How long to retain a prompt cache entry created by this request.
-
serviceTier
final Optional<ResponseCompactParams.ServiceTier> serviceTier()
The service tier to use for this request.
-
_model
final JsonField<ResponseCompactParams.Model> _model()
Returns the raw JSON value of model.
Unlike model, this method doesn't throw if the JSON field has an unexpected type.
-
_input
final JsonField<ResponseCompactParams.Input> _input()
Returns the raw JSON value of input.
Unlike input, this method doesn't throw if the JSON field has an unexpected type.
-
_instructions
final JsonField<String> _instructions()
Returns the raw JSON value of instructions.
Unlike instructions, this method doesn't throw if the JSON field has an unexpected type.
-
_previousResponseId
final JsonField<String> _previousResponseId()
Returns the raw JSON value of previousResponseId.
Unlike previousResponseId, this method doesn't throw if the JSON field has an unexpected type.
-
_promptCacheKey
final JsonField<String> _promptCacheKey()
Returns the raw JSON value of promptCacheKey.
Unlike promptCacheKey, this method doesn't throw if the JSON field has an unexpected type.
-
_promptCacheRetention
final JsonField<ResponseCompactParams.PromptCacheRetention> _promptCacheRetention()
Returns the raw JSON value of promptCacheRetention.
Unlike promptCacheRetention, this method doesn't throw if the JSON field has an unexpected type.
-
_serviceTier
final JsonField<ResponseCompactParams.ServiceTier> _serviceTier()
Returns the raw JSON value of serviceTier.
Unlike serviceTier, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalBodyProperties
final Map<String, JsonValue> _additionalBodyProperties()
-
_additionalHeaders
final Headers _additionalHeaders()
Additional headers to send with the request.
-
_additionalQueryParams
final QueryParams _additionalQueryParams()
Additional query param to send with the request.
-
toBuilder
final ResponseCompactParams.Builder toBuilder()
-
_body
final ResponseCompactParams.Body _body()
-
_headers
Headers _headers()
The full set of headers in the parameters, including both fixed and additional headers.
-
_queryParams
QueryParams _queryParams()
The full set of query params in the parameters, including both fixed and additional query params.
-
builder
final static ResponseCompactParams.Builder builder()
Returns a mutable builder for constructing an instance of ResponseCompactParams.
The following fields are required:
.model()
-
-
-
-