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:
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user