Skip to content

Commit a70a449

Browse files
fixed the typings for the json response in the ollama json response
1 parent 22ed668 commit a70a449

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/Agents/Adapters/Ollama.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ public function embed(string $text): array
7373
/**
7474
* @var array{
7575
* error?: string,
76-
* embeddings?: array<int, array<int, float>>,
77-
* total_duration?: int,
78-
* load_duration?: int
76+
* embeddings: array<int, array<int, float>>,
77+
* total_duration: int,
78+
* load_duration: int
7979
* }|null $json
8080
*/
8181
$json = is_string($body) ? json_decode($body, true) : null;
@@ -86,8 +86,8 @@ public function embed(string $text): array
8686

8787
return [
8888
'embedding' => $json['embeddings'][0],
89-
'total_duration' => $json['total_duration'] ?? null,
90-
'load_duration' => $json['load_duration'] ?? null,
89+
'total_duration' => $json['total_duration'],
90+
'load_duration' => $json['load_duration'],
9191
];
9292
}
9393

0 commit comments

Comments
 (0)