Harden vision vector search and embedding jobs.

Add point search, circuit-breaking, and safer gateway limits so artwork similarity lookups fail closed instead of hanging the request path.
This commit is contained in:
test
2026-09-20 14:49:19 +02:00
parent 455b514d50
commit 62aaa2f704
12 changed files with 903 additions and 64 deletions
@@ -46,6 +46,7 @@ it('returns AI similar artworks for a public artwork', function (): void {
Http::fake([
'https://files.skinbase.org/*' => Http::response('image-bytes', 200, ['Content-Type' => 'image/webp']),
'https://vision.klevze.net/vectors/search/point' => Http::response(['detail' => 'Point not found'], 404),
'https://vision.klevze.net/vectors/search/file' => Http::response([
'results' => [
['id' => $source->id, 'score' => 1.0],
@@ -84,6 +85,7 @@ it('falls back to URL search when the file vector endpoint fails for similar-ai'
Http::fake([
'https://files.skinbase.org/*' => Http::response('image-bytes', 200, ['Content-Type' => 'image/webp']),
'https://vision.klevze.net/vectors/search/point' => Http::response(['detail' => 'Point not found'], 404),
'https://vision.klevze.net/vectors/search/file' => Http::response(['error' => 'missing endpoint'], 404),
'https://vision.klevze.net/vectors/search' => Http::response([
'results' => [
@@ -141,4 +143,4 @@ it('searches by uploaded image through the vector gateway', function (): void {
return $request->url() === 'https://vision.klevze.net/vectors/search/file'
&& $request->hasHeader('X-API-Key', 'test-key');
});
});
});