Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/Responses/Responses/Streaming/ContentPart.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @phpstan-import-type OutputTextType from OutputMessageContentOutputText
* @phpstan-import-type ContentRefusalType from OutputMessageContentRefusal
*
* @phpstan-type ContentPartType array{type: string, content_index: int, item_id: string, output_index: int, part: OutputTextType|ContentRefusalType}
* @phpstan-type ContentPartType array{type: string, content_index: int, item_id: string, output_index: int, sequence_number: int, part: OutputTextType|ContentRefusalType}
*
* @implements ResponseContract<ContentPartType>
*/
Expand All @@ -36,6 +36,7 @@ private function __construct(
public readonly int $contentIndex,
public readonly string $itemId,
public readonly int $outputIndex,
public readonly int $sequenceNumber,
public readonly OutputMessageContentOutputText|OutputMessageContentRefusal $part,
private readonly MetaInformation $meta,
) {}
Expand All @@ -55,6 +56,7 @@ public static function from(array $attributes, MetaInformation $meta): self
contentIndex: $attributes['content_index'],
itemId: $attributes['item_id'],
outputIndex: $attributes['output_index'],
sequenceNumber: $attributes['sequence_number'],
part: $part,
meta: $meta,
);
Expand All @@ -70,6 +72,7 @@ public function toArray(): array
'content_index' => $this->contentIndex,
'item_id' => $this->itemId,
'output_index' => $this->outputIndex,
'sequence_number' => $this->sequenceNumber,
'part' => $this->part->toArray(),
];
}
Expand Down
5 changes: 4 additions & 1 deletion src/Responses/Responses/Streaming/OutputItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @phpstan-import-type OutputMcpCallType from OutputMcpCall
* @phpstan-import-type OutputCodeInterpreterToolCallType from OutputCodeInterpreterToolCall
*
* @phpstan-type OutputItemType array{type: string, output_index: int, item: OutputCodeInterpreterToolCallType|OutputComputerToolCallType|OutputFileSearchToolCallType|OutputFunctionToolCallType|OutputMessageType|OutputReasoningType|OutputWebSearchToolCallType|OutputMcpListToolsType|OutputMcpApprovalRequestType|OutputMcpCallType|OutputImageGenerationToolCallType}
* @phpstan-type OutputItemType array{type: string, output_index: int, sequence_number: int, item: OutputCodeInterpreterToolCallType|OutputComputerToolCallType|OutputFileSearchToolCallType|OutputFunctionToolCallType|OutputMessageType|OutputReasoningType|OutputWebSearchToolCallType|OutputMcpListToolsType|OutputMcpApprovalRequestType|OutputMcpCallType|OutputImageGenerationToolCallType}
*
* @implements ResponseContract<OutputItemType>
*/
Expand All @@ -52,6 +52,7 @@ final class OutputItem implements ResponseContract, ResponseHasMetaInformationCo
private function __construct(
public readonly string $type,
public readonly int $outputIndex,
public readonly int $sequenceNumber,
public readonly OutputMessage|OutputCodeInterpreterToolCall|OutputFileSearchToolCall|OutputFunctionToolCall|OutputWebSearchToolCall|OutputComputerToolCall|OutputReasoning|OutputMcpListTools|OutputMcpApprovalRequest|OutputMcpCall|OutputImageGenerationToolCall $item,
private readonly MetaInformation $meta,
) {}
Expand All @@ -78,6 +79,7 @@ public static function from(array $attributes, MetaInformation $meta): self
return new self(
type: $attributes['type'],
outputIndex: $attributes['output_index'],
sequenceNumber: $attributes['sequence_number'],
item: $item,
meta: $meta,
);
Expand All @@ -91,6 +93,7 @@ public function toArray(): array
return [
'type' => $this->type,
'output_index' => $this->outputIndex,
'sequence_number' => $this->sequenceNumber,
'item' => $this->item->toArray(),
];
}
Expand Down
5 changes: 4 additions & 1 deletion src/Responses/Responses/Streaming/OutputTextDone.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use OpenAI\Testing\Responses\Concerns\Fakeable;

/**
* @phpstan-type OutputTextDoneType array{type: string, content_index: int, item_id: string, output_index: int, text: string}
* @phpstan-type OutputTextDoneType array{type: string, content_index: int, item_id: string, output_index: int, sequence_number: int, text: string}
*
* @implements ResponseContract<OutputTextDoneType>
*/
Expand All @@ -31,6 +31,7 @@ private function __construct(
public readonly int $contentIndex,
public readonly string $itemId,
public readonly int $outputIndex,
public readonly int $sequenceNumber,
public readonly string $text,
private readonly MetaInformation $meta,
) {}
Expand All @@ -45,6 +46,7 @@ public static function from(array $attributes, MetaInformation $meta): self
contentIndex: $attributes['content_index'],
itemId: $attributes['item_id'],
outputIndex: $attributes['output_index'],
sequenceNumber: $attributes['sequence_number'],
text: $attributes['text'],
meta: $meta,
);
Expand All @@ -60,6 +62,7 @@ public function toArray(): array
'content_index' => $this->contentIndex,
'item_id' => $this->itemId,
'output_index' => $this->outputIndex,
'sequence_number' => $this->sequenceNumber,
'text' => $this->text,
];
}
Expand Down