-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathembedders_api.yaml
More file actions
135 lines (130 loc) · 3.73 KB
/
embedders_api.yaml
File metadata and controls
135 lines (130 loc) · 3.73 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
openapi: '3.0.0'
info:
title: 'Swagger Embedder endpoint REST API - OpenAPI 3.0'
description: |
**Reindexer** Embedder endpoint REST API
version: '1.0.0'
tags:
- name: 'embedder'
description: 'Everything about your Embedders'
paths:
/api/v1/embedder/{name}/produce:
post:
tags:
- 'embedder'
summary: 'Calculate embedder result'
description: |
This operation will calculate the result of the embedding
operationId: postProduct
parameters:
- name: 'format'
in: query
description: 'Encoding data format'
required: true
schema:
type: string
enum:
- json
- text
- name: 'name'
in: path
description: 'Embedder name'
required: true
schema:
type: string
requestBody:
content:
'application/json':
schema:
type: object
required:
- format
- data
properties:
data:
oneOf:
- $ref: '#/components/schemas/JSONDataArray'
- $ref: '#/components/schemas/TextDataArray'
discriminator:
propertyName: format
mapping:
json: JSONDataArray
text: TextDataArray
responses:
200:
description: 'Successful operation'
content:
application/json:
schema:
$ref: '#/components/schemas/EmbedderProduceResponse'
400:
description: 'Invalid arguments supplied'
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
500:
description: 'Unexpected internal error'
content:
application/json:
schema:
$ref: '#/components/schemas/StatusResponse'
components:
schemas:
StatusResponse:
type: 'object'
properties:
success:
type: boolean
response_code:
type: integer
description: 'Duplicates HTTP response code'
description:
type: string
description: 'Text description of error details'
TextDataArray:
description: 'Raw text data for embedding'
type: array
items:
type: string
example: 'some user query'
JSONDataArray:
description: 'JSON with target fields for embedding'
type: array
items:
type: object
description:
'Each object contains fields (names and values) of the document. List
of those fields has to be configured in the index embedding config'
example:
field1: value1
field2: [1, 2, 3]
EmbedderProduceResponse:
type: object
required:
- products
description: 'Products array created by Embedder'
properties:
products:
type: array
items:
type: array
description: 'Single embedder calculation result'
items:
type: object
required:
- chunk
- embedding
properties:
chunk:
type: string
description:
'Single chunk. Currently this value will be ignored and may
be empty string'
embedding:
type: array
description: 'Result embedding for the chunk'
items:
type: number
format: float
example: -1.7