We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3c71f1 commit 91b772bCopy full SHA for 91b772b
1 file changed
examples/sparse/example.php
@@ -33,10 +33,10 @@ function fetchEmbeddings($inputs)
33
$context = stream_context_create($opts);
34
$response = file_get_contents($url, false, $context);
35
$embeddings = [];
36
- foreach (json_decode($response, true) as $row) {
+ foreach (json_decode($response, true) as $item) {
37
$embedding = [];
38
- foreach ($row as $v) {
39
- $embedding[$v['index']] = $v['value'];
+ foreach ($item as $e) {
+ $embedding[$e['index']] = $e['value'];
40
}
41
$embeddings[] = $embedding;
42
0 commit comments