5858 * @phpstan-import-type FunctionToolChoiceType from FunctionToolChoice
5959 * @phpstan-import-type HostedToolChoiceType from HostedToolChoice
6060 * @phpstan-import-type ReasoningType from CreateResponseReasoning
61+ * @phpstan-import-type ReferencePromptObjectType from ReferencePromptObject
6162 *
63+ * @phpstan-type InstructionsType array<int, mixed>|string|null
6264 * @phpstan-type ToolChoiceType 'none'|'auto'|'required'|FunctionToolChoiceType|HostedToolChoiceType
6365 * @phpstan-type ToolsType array<int, ComputerUseToolType|FileSearchToolType|FunctionToolType|WebSearchToolType|ImageGenerationToolType|RemoteMcpToolType|CodeInterpreterToolType>
6466 * @phpstan-type OutputType array<int, OutputComputerToolCallType|OutputFileSearchToolCallType|OutputFunctionToolCallType|OutputMessageType|OutputReasoningType|OutputWebSearchToolCallType|OutputMcpListToolsType|OutputMcpApprovalRequestType|OutputMcpCallType|OutputImageGenerationToolCallType|OutputCodeInterpreterToolCallType>
65- * @phpstan-type CreateResponseType array{id: string, object: 'response', created_at: int, status: 'completed'|'failed'|'in_progress'|'incomplete', error: ErrorType|null, incomplete_details: IncompleteDetailsType|null, instructions: string|null , max_output_tokens: int|null, model: string, output: OutputType, output_text: string|null, parallel_tool_calls: bool, previous_response_id: string|null, reasoning: ReasoningType|null, store: bool, temperature: float|null, text: ResponseFormatType, tool_choice: ToolChoiceType, tools: ToolsType, top_p: float|null, truncation: 'auto'|'disabled'|null, usage: UsageType|null, user: string|null, metadata: array<string, string>|null}
67+ * @phpstan-type CreateResponseType array{id: string, object: 'response', created_at: int, status: 'completed'|'failed'|'in_progress'|'incomplete', error: ErrorType|null, incomplete_details: IncompleteDetailsType|null, instructions: InstructionsType , max_output_tokens: int|null, model: string, output: OutputType, output_text: string|null, parallel_tool_calls: bool, previous_response_id: string|null, prompt: ReferencePromptObjectType |null, reasoning: ReasoningType|null, store: bool, temperature: float|null, text: ResponseFormatType, tool_choice: ToolChoiceType, tools: ToolsType, top_p: float|null, truncation: 'auto'|'disabled'|null, usage: UsageType|null, user: string|null, metadata: array<string, string>|null}
6668 *
6769 * @implements ResponseContract<CreateResponseType>
6870 */
@@ -79,6 +81,7 @@ final class CreateResponse implements ResponseContract, ResponseHasMetaInformati
7981 /**
8082 * @param 'response' $object
8183 * @param 'completed'|'failed'|'in_progress'|'incomplete' $status
84+ * @param array<int, mixed>|string|null $instructions
8285 * @param array<int, OutputMessage|OutputComputerToolCall|OutputFileSearchToolCall|OutputWebSearchToolCall|OutputFunctionToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall|OutputCodeInterpreterToolCall> $output
8386 * @param array<int, ComputerUseTool|FileSearchTool|FunctionTool|WebSearchTool|ImageGenerationTool|RemoteMcpTool|ImageGenerationTool|CodeInterpreterTool> $tools
8487 * @param 'auto'|'disabled'|null $truncation
@@ -91,13 +94,14 @@ private function __construct(
9194 public readonly string $ status ,
9295 public readonly ?CreateResponseError $ error ,
9396 public readonly ?CreateResponseIncompleteDetails $ incompleteDetails ,
94- public readonly ? string $ instructions ,
97+ public readonly array | string | null $ instructions ,
9598 public readonly ?int $ maxOutputTokens ,
9699 public readonly string $ model ,
97100 public readonly array $ output ,
98101 public readonly ?string $ outputText ,
99102 public readonly bool $ parallelToolCalls ,
100103 public readonly ?string $ previousResponseId ,
104+ public readonly ?ReferencePromptObject $ prompt ,
101105 public readonly ?CreateResponseReasoning $ reasoning ,
102106 public readonly bool $ store ,
103107 public readonly ?float $ temperature ,
@@ -184,6 +188,9 @@ public static function from(array $attributes, MetaInformation $meta): self
184188 outputText: empty ($ texts ) ? null : implode (' ' , $ texts ),
185189 parallelToolCalls: $ attributes ['parallel_tool_calls ' ],
186190 previousResponseId: $ attributes ['previous_response_id ' ],
191+ prompt: isset ($ attributes ['prompt ' ])
192+ ? ReferencePromptObject::from ($ attributes ['prompt ' ])
193+ : null ,
187194 reasoning: isset ($ attributes ['reasoning ' ])
188195 ? CreateResponseReasoning::from ($ attributes ['reasoning ' ])
189196 : null ,
@@ -227,6 +234,7 @@ public function toArray(): array
227234 ),
228235 'parallel_tool_calls ' => $ this ->parallelToolCalls ,
229236 'previous_response_id ' => $ this ->previousResponseId ,
237+ 'prompt ' => $ this ->prompt ?->toArray(),
230238 'reasoning ' => $ this ->reasoning ?->toArray(),
231239 'store ' => $ this ->store ,
232240 'temperature ' => $ this ->temperature ,
0 commit comments