Skip to content

Commit 7ec1207

Browse files
authored
Fix missing output parameter on streamed code interpreter outputs - fixes #404 (#406)
1 parent b7491ac commit 7ec1207

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private function __construct(
3030
/**
3131
* Acts as static factory, and returns a new Response instance.
3232
*
33-
* @param array{step_details: array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}} $attributes
33+
* @param array{step_details: array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs?: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}} $attributes
3434
*/
3535
public static function from(array $attributes): self
3636
{

src/Responses/Threads/Runs/Steps/Delta/ThreadRunStepDeltaResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private function __construct(
3030
/**
3131
* Acts as static factory, and returns a new Response instance.
3232
*
33-
* @param array{id?: string, object: string, delta: array{step_details: array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}} $attributes
33+
* @param array{id?: string, object: string, delta: array{step_details: array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs?: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>}|array{type: 'message_creation', message_creation: array{message_id: string}}}} $attributes
3434
*/
3535
public static function from(array $attributes): self
3636
{

src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeInterpreter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ private function __construct(
3232
/**
3333
* Acts as static factory, and returns a new Response instance.
3434
*
35-
* @param array{input: string, outputs: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>} $attributes
35+
* @param array{input: string, outputs?: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>} $attributes
3636
*/
3737
public static function from(array $attributes): self
3838
{
@@ -41,7 +41,7 @@ public static function from(array $attributes): self
4141
'image' => ThreadRunStepResponseCodeInterpreterOutputImage::from($output),
4242
'logs' => ThreadRunStepResponseCodeInterpreterOutputLogs::from($output),
4343
},
44-
$attributes['outputs'],
44+
$attributes['outputs'] ?? [],
4545
);
4646

4747
return new self(

src/Responses/Threads/Runs/Steps/ThreadRunStepResponseCodeToolCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private function __construct(
3333
/**
3434
* Acts as static factory, and returns a new Response instance.
3535
*
36-
* @param array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}} $attributes
36+
* @param array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs?: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}} $attributes
3737
*/
3838
public static function from(array $attributes): self
3939
{

src/Responses/Threads/Runs/Steps/ThreadRunStepResponseToolCallsStepDetails.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private function __construct(
3333
/**
3434
* Acts as static factory, and returns a new Response instance.
3535
*
36-
* @param array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>} $attributes
36+
* @param array{type: 'tool_calls', tool_calls: array<int, array{id?: string, type: 'code_interpreter', code_interpreter: array{input: string, outputs?: array<int, array{type: 'image', image: array{file_id: string}}|array{type: 'logs', logs: string}>}}|array{id: string, type: 'retrieval', retrieval: array<string, string>}|array{id?: string, type: 'function', function: array{name?: string, arguments: string, output?: ?string}}>} $attributes
3737
*/
3838
public static function from(array $attributes): self
3939
{

0 commit comments

Comments
 (0)