-
-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathswagger.yaml
87 lines (79 loc) · 1.79 KB
/
swagger.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
swagger: '2.0'
info:
title: Faiss Web Service
description: Search your Faiss index via http requests
version: 0.0.1
consumes:
- application/json
produces:
- application/json
- text/html
paths:
/faiss/search:
post:
summary: Search your Faiss index
description: The endpoint returns the k nearest neighbors for the given ids, and / or vectors.
parameters:
- name: body
in: body
required: true
schema:
$ref: '#/definitions/FaissSearchRequest'
responses:
'200':
description: Nearest neighbors found, with their score
schema:
$ref: '#/definitions/FaissSearchResponse'
'400':
description: Bad request
'500':
description: Server error
definitions:
FaissSearchRequest:
type: object
required: ['k'] # ids or vectors
properties:
k:
description: Amount of neighbors to return
type: number
format: integer
ids:
description: Ids to search for
type: array
items:
$ref: '#/definitions/Id'
vectors:
description: Vectors to search for
type: array
items:
$ref: '#/definitions/Vector'
FaissSearchResponse:
type: array
items:
type: object
properties:
id:
$ref: '#/definitions/Id'
vector:
$ref: '#/definitions/Vector'
neighbors:
type: array
items:
$ref: '#/definitions/Neightbor'
Id:
type: number
format: integer
Vector:
type: array
items:
type: array
items:
type: number
Neightbor:
type: object
properties:
id:
$ref: '#/definitions/Id'
score:
type: number
format: float