Skip to content

Commit 995caf6

Browse files
committed
ref
1 parent 8d1f587 commit 995caf6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/rag/manticore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
// initialize the store
3131
$store = new Store(
3232
httpClient: http_client(),
33-
host: env('MANTICORE_HOST'),
33+
host: 'http://127.0.0.1:9308',
3434
table: 'movies',
3535
field: '_movie_vectors',
3636
);

src/store/src/Bridge/Manticore/Store.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function convertToVectorDocument(array $data): VectorDocument
150150
return new VectorDocument(
151151
id: Uuid::fromString($payload['uuid']),
152152
vector: $vector,
153-
metadata: new Metadata(json_decode($payload['metadata'], true)),
153+
metadata: new Metadata($payload['metadata'] ?? []),
154154
score: $data['_knn_dist'] ?? null
155155
);
156156
}

src/store/tests/Bridge/Manticore/StoreTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ public function testStoreCanQuery()
179179
'_source' => [
180180
'uuid' => Uuid::v7()->toRfc4122(),
181181
'random' => [0.1, 0.2, 0.3],
182-
'metadata' => json_encode([
182+
'metadata' => [
183183
'foo' => 'bar',
184-
]),
184+
],
185185
],
186186
],
187187
],

0 commit comments

Comments
 (0)