CreateResponseRequest class
Request to create a response.
- Annotations
-
- @immutable
Constructors
-
CreateResponseRequest({required String model, required ResponseInput input, String? instructions, List<
Tool> ? tools, ToolChoice? toolChoice, String? previousResponseId, int? maxOutputTokens, double? temperature, double? topP, double? presencePenalty, double? frequencyPenalty, bool? stream, StreamOptions? streamOptions, ReasoningConfig? reasoning, TextConfig? text, Truncation? truncation, bool? parallelToolCalls, ServiceTier? serviceTier, Map<String, String> ? metadata, List<Include> ? include, bool? store, bool? background, int? maxToolCalls, String? safetyIdentifier, String? promptCacheKey, int? topLogprobs}) -
Creates a CreateResponseRequest.
const
-
CreateResponseRequest.fromJson(Map<
String, dynamic> json) -
Creates a CreateResponseRequest from JSON.
factory
- CreateResponseRequest.text({required String model, required String input, String? instructions, int? maxOutputTokens, double? temperature})
-
Creates a simple text request.
factory
Properties
- background → bool?
-
Whether to run the request in the background and return immediately.
final
- frequencyPenalty → double?
-
Penalizes new tokens based on their frequency in the text so far.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
include
→ List<
Include> ? -
Additional data to include in response.
final
- input → ResponseInput
-
The input for the response.
final
- instructions → String?
-
System-level instructions for the model.
final
- maxOutputTokens → int?
-
Maximum tokens to generate.
final
- maxToolCalls → int?
-
The maximum number of tool calls the model may make while generating.
final
-
metadata
→ Map<
String, String> ? -
User-defined metadata.
final
- model → String
-
The model to use for generation.
final
- parallelToolCalls → bool?
-
Whether the model may call multiple tools in parallel.
final
- presencePenalty → double?
-
Penalizes new tokens based on whether they appear in the text so far.
final
- previousResponseId → String?
-
ID of a previous response for multi-turn conversation.
final
- promptCacheKey → String?
-
A key to use when reading from or writing to the prompt cache.
final
- reasoning → ReasoningConfig?
-
Configuration for reasoning models.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safetyIdentifier → String?
-
A stable identifier used for safety monitoring and abuse detection.
final
- serviceTier → ServiceTier?
-
Service tier for request processing.
final
- store → bool?
-
Whether to store the response for later retrieval.
final
- stream → bool?
-
Whether to stream the response.
final
- streamOptions → StreamOptions?
-
Options that control streamed response behavior.
final
- temperature → double?
-
Sampling temperature (0.0 - 2.0).
final
- text → TextConfig?
-
Configuration for text output.
final
- toolChoice → ToolChoice?
-
How the model should choose which tool to call.
final
-
tools
→ List<
Tool> ? -
Tools available to the model.
final
- topLogprobs → int?
-
The number of most likely tokens to return at each position.
final
- topP → double?
-
Top-p sampling parameter.
final
- truncation → Truncation?
-
Truncation strategy for long inputs.
final
Methods
-
copyWith(
{String? model, ResponseInput? input, Object? instructions = unsetCopyWithValue, Object? tools = unsetCopyWithValue, Object? toolChoice = unsetCopyWithValue, Object? previousResponseId = unsetCopyWithValue, Object? maxOutputTokens = unsetCopyWithValue, Object? temperature = unsetCopyWithValue, Object? topP = unsetCopyWithValue, Object? presencePenalty = unsetCopyWithValue, Object? frequencyPenalty = unsetCopyWithValue, Object? stream = unsetCopyWithValue, Object? streamOptions = unsetCopyWithValue, Object? reasoning = unsetCopyWithValue, Object? text = unsetCopyWithValue, Object? truncation = unsetCopyWithValue, Object? parallelToolCalls = unsetCopyWithValue, Object? serviceTier = unsetCopyWithValue, Object? metadata = unsetCopyWithValue, Object? include = unsetCopyWithValue, Object? store = unsetCopyWithValue, Object? background = unsetCopyWithValue, Object? maxToolCalls = unsetCopyWithValue, Object? safetyIdentifier = unsetCopyWithValue, Object? promptCacheKey = unsetCopyWithValue, Object? topLogprobs = unsetCopyWithValue}) → CreateResponseRequest - Creates a copy with replaced values.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override