Skip to content

Commit 4ff09da

Browse files
committed
fix(CreateResponse): make maxOutputTokens, previousResponseId, temperature, and topP truly optional in CreateResponseType
1 parent ffafba2 commit 4ff09da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Responses/Responses/CreateResponse.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@ public static function from(array $attributes, MetaInformation $meta): self
131131
: null,
132132
instructions: $attributes['instructions'] ?? null,
133133
maxToolCalls: $attributes['max_tool_calls'] ?? null,
134-
maxOutputTokens: $attributes['max_output_tokens'],
134+
maxOutputTokens: $attributes['max_output_tokens'] ?? null,
135135
model: $attributes['model'],
136136
output: $output,
137137
outputText: OutputText::parse($output),
138138
parallelToolCalls: $attributes['parallel_tool_calls'],
139-
previousResponseId: $attributes['previous_response_id'],
139+
previousResponseId: $attributes['previous_response_id'] ?? null,
140140
prompt: isset($attributes['prompt'])
141141
? ReferencePromptObject::from($attributes['prompt'])
142142
: null,
@@ -147,14 +147,14 @@ public static function from(array $attributes, MetaInformation $meta): self
147147
? CreateResponseReasoning::from($attributes['reasoning'])
148148
: null,
149149
store: $attributes['store'] ?? true,
150-
temperature: $attributes['temperature'],
150+
temperature: $attributes['temperature'] ?? null,
151151
text: isset($attributes['text'])
152152
? CreateResponseFormat::from($attributes['text'])
153153
: null,
154154
toolChoice: $toolChoice,
155155
tools: $tools,
156156
topLogProbs: $attributes['top_logprobs'] ?? null,
157-
topP: $attributes['top_p'],
157+
topP: $attributes['top_p'] ?? null,
158158
truncation: $attributes['truncation'] ?? null,
159159
usage: isset($attributes['usage'])
160160
? CreateResponseUsage::from($attributes['usage'])

0 commit comments

Comments
 (0)