Skip to content

Commit 207cee1

Browse files
committed
Merge branch 'main' into 0.10.x
2 parents a428fcd + d084c63 commit 207cee1

File tree

5 files changed

+13
-11
lines changed

5 files changed

+13
-11
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
- Nuno Maduro: **[github.com/sponsors/nunomaduro](https://github.com/sponsors/nunomaduro)**
1515
- Sandro Gehri: **[github.com/sponsors/gehrisandro](https://github.com/sponsors/gehrisandro)**
1616

17+
> **Looking for Assistants v2 support?**
18+
>
19+
> Check out the [0.10.x release](https://github.com/openai-php/client/releases/tag/v0.10.0-beta.1) (beta)
20+
1721
## Table of Contents
1822
- [Get Started](#get-started)
1923
- [Usage](#usage)

src/Resources/Concerns/Transportable.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
trait Transportable
1010
{
11-
/**
12-
* Creates a Client instance with the given API token.
13-
*/
1411
public function __construct(private readonly TransporterContract $transporter)
1512
{
1613
// ..

src/Responses/Chat/CreateStreamedResponseChoice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ private function __construct(
1414
}
1515

1616
/**
17-
* @param array{index: int, delta: array{role?: string, content?: string}, finish_reason: string|null} $attributes
17+
* @param array{index: int, delta?: array{role?: string, content?: string}, finish_reason: string|null} $attributes
1818
*/
1919
public static function from(array $attributes): self
2020
{
2121
return new self(
2222
$attributes['index'],
23-
CreateStreamedResponseDelta::from($attributes['delta']),
23+
CreateStreamedResponseDelta::from($attributes['delta'] ?? []),
2424
$attributes['finish_reason'] ?? null,
2525
);
2626
}

src/Testing/Responses/Concerns/Fakeable.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ private static function buildAttributes(array $original, array $override): array
3535
unset($override[$key]);
3636
}
3737

38-
// we are going to append all remaining overrides with numeric keys
38+
// we are going to append all remaining overrides
3939
foreach ($override as $key => $value) {
40-
if (! is_numeric($key)) {
41-
continue;
42-
}
43-
4440
$new[$key] = $value;
4541
}
4642

tests/Responses/Assistants/AssistantResponse.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@
101101
test('fake with override', function () {
102102
$response = AssistantResponse::fake([
103103
'id' => 'asst_1234',
104+
'metadata' => [
105+
'key' => 'value',
106+
],
104107
]);
105108

106109
expect($response)
107-
->id->toBe('asst_1234');
110+
->id->toBe('asst_1234')
111+
->metadata->toBeArray()
112+
->metadata->key->toBe('value');
108113
});

0 commit comments

Comments
 (0)