Skip to content

Commit bf06504

Browse files
committed
fix tool call deserialization
1 parent 2bb0330 commit bf06504

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Chat/History/AbstractChatHistory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,10 @@ protected function deserializeToolCall(array $message): ToolCallMessage
183183

184184
$this->deserializeMeta($message, $item);
185185

186+
if ($content = $this->deserializeContent($message['content'] ?? null)) {
187+
$item->setContents($content);
188+
}
189+
186190
return $item;
187191
}
188192

src/HttpClient/GuzzleHttpClient.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ class GuzzleHttpClient implements HttpClientInterface
2525
* @param array<string, mixed> $customHeaders
2626
*/
2727
public function __construct(
28-
private readonly array $customHeaders = [],
29-
private readonly float $timeout = 60.0,
30-
private readonly float $connectTimeout = 10.0,
31-
private readonly ?HandlerStack $handler = null,
28+
protected readonly array $customHeaders = [],
29+
protected readonly float $timeout = 60.0,
30+
protected readonly float $connectTimeout = 10.0,
31+
protected readonly ?HandlerStack $handler = null,
32+
protected readonly array $options = [],
3233
) {
3334
}
3435

@@ -38,6 +39,7 @@ public function request(HttpRequest $request): HttpResponse
3839

3940
try {
4041
$options = [
42+
...$this->options,
4143
RequestOptions::HEADERS => [...$this->customHeaders, ...$request->headers],
4244
RequestOptions::TIMEOUT => $this->timeout,
4345
RequestOptions::CONNECT_TIMEOUT => $this->connectTimeout,
@@ -177,7 +179,6 @@ protected function buildMultipartData(array $data): array
177179
}
178180

179181
/**
180-
* @param HttpRequest $request
181182
* @param array<string, mixed> $options
182183
* @throws GuzzleException
183184
*/

0 commit comments

Comments
 (0)