|
16 | 16 | use Symfony\AI\Platform\Vector\Vector;
|
17 | 17 | use Symfony\AI\Store\Bridge\SurrealDB\Store;
|
18 | 18 | use Symfony\AI\Store\Document\VectorDocument;
|
19 |
| -use Symfony\AI\Store\Exception\InvalidArgumentException; |
20 | 19 | use Symfony\Component\HttpClient\Exception\ClientException;
|
21 | 20 | use Symfony\Component\HttpClient\MockHttpClient;
|
22 | 21 | use Symfony\Component\HttpClient\Response\JsonMockResponse;
|
@@ -115,26 +114,6 @@ public function testStoreCannotAddOnInvalidResponse(): void
|
115 | 114 | $store->add(new VectorDocument(Uuid::v4(), new Vector([0.1, 0.2, 0.3])));
|
116 | 115 | }
|
117 | 116 |
|
118 |
| - public function testStoreCannotAddOnOversizedEmbeddings(): void |
119 |
| - { |
120 |
| - $httpClient = new MockHttpClient([ |
121 |
| - new JsonMockResponse([ |
122 |
| - 'code' => 200, |
123 |
| - 'details' => 'Authentication succeeded.', |
124 |
| - 'token' => 'bar', |
125 |
| - ], [ |
126 |
| - 'http_code' => 200, |
127 |
| - ]), |
128 |
| - ], 'http://localhost:8000'); |
129 |
| - |
130 |
| - $store = new Store($httpClient, 'http://localhost:8000', 'test', 'test', 'test', 'test'); |
131 |
| - |
132 |
| - self::expectException(InvalidArgumentException::class); |
133 |
| - self::expectExceptionMessage('The SurrealDB HTTP API does not support embeddings with more than 1275 dimensions, found 2000'); |
134 |
| - self::expectExceptionCode(0); |
135 |
| - $store->add(new VectorDocument(Uuid::v4(), new Vector(array_fill(0, 2000, 0.1)))); |
136 |
| - } |
137 |
| - |
138 | 117 | public function testStoreCannotAddOnInvalidAddResponse(): void
|
139 | 118 | {
|
140 | 119 | $httpClient = new MockHttpClient([
|
@@ -257,55 +236,6 @@ public function testStoreCannotQueryOnInvalidResponse(): void
|
257 | 236 | $store->query(new Vector(array_fill(0, 1275, 0.1)));
|
258 | 237 | }
|
259 | 238 |
|
260 |
| - public function testStoreCannotQueryOnOversizedEmbeddings(): void |
261 |
| - { |
262 |
| - $httpClient = new MockHttpClient([ |
263 |
| - new JsonMockResponse([ |
264 |
| - 'code' => 200, |
265 |
| - 'details' => 'Authentication succeeded.', |
266 |
| - 'token' => 'bar', |
267 |
| - ], [ |
268 |
| - 'http_code' => 200, |
269 |
| - ]), |
270 |
| - new JsonMockResponse([ |
271 |
| - [ |
272 |
| - 'result' => [ |
273 |
| - [ |
274 |
| - 'id' => Uuid::v4()->toRfc4122(), |
275 |
| - '_vectors' => [0.1, 0.1, 0.1], |
276 |
| - '_metadata' => [ |
277 |
| - '_id' => Uuid::v4()->toRfc4122(), |
278 |
| - ], |
279 |
| - ], |
280 |
| - [ |
281 |
| - 'id' => Uuid::v4()->toRfc4122(), |
282 |
| - '_vectors' => [0.1, 0.1, 0.1], |
283 |
| - '_metadata' => [ |
284 |
| - '_id' => Uuid::v4()->toRfc4122(), |
285 |
| - ], |
286 |
| - ], |
287 |
| - ], |
288 |
| - 'status' => 'OK', |
289 |
| - 'time' => '263.208µs', |
290 |
| - ], |
291 |
| - ], [ |
292 |
| - 'http_code' => 200, |
293 |
| - ]), |
294 |
| - new JsonMockResponse([], [ |
295 |
| - 'http_code' => 400, |
296 |
| - ]), |
297 |
| - ], 'http://localhost:8000'); |
298 |
| - |
299 |
| - $store = new Store($httpClient, 'http://localhost:8000', 'test', 'test', 'test', 'test', 'test'); |
300 |
| - |
301 |
| - $store->add(new VectorDocument(Uuid::v4(), new Vector(array_fill(0, 1275, 0.1)))); |
302 |
| - |
303 |
| - self::expectException(InvalidArgumentException::class); |
304 |
| - self::expectExceptionMessage('The dimensions of the vector must be less than or equal to 1275, found 2000'); |
305 |
| - self::expectExceptionCode(0); |
306 |
| - $store->query(new Vector(array_fill(0, 2000, 0.1))); |
307 |
| - } |
308 |
| - |
309 | 239 | public function testStoreCanQueryOnValidEmbeddings(): void
|
310 | 240 | {
|
311 | 241 | $httpClient = new MockHttpClient([
|
|
0 commit comments