-
Notifications
You must be signed in to change notification settings - Fork 0
/
services.proto
executable file
·296 lines (256 loc) · 9.19 KB
/
services.proto
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
syntax = "proto3";
import "admin_account.proto";
import "admin_apikey.proto";
import "admin.proto";
import "admin_job.proto";
import "admin_metric.proto";
import "admin_security.proto";
import "admin_user.proto";
import "chat.proto";
import "common.proto";
import "indexing.proto";
import "serving.proto";
import "status.proto";
import "list_documents.proto";
import "google/api/annotations.proto";
option java_package = "com.vectara";
option java_outer_classname = "ServiceProtos";
option go_package = "vectara.com/public/proto/services";
package com.vectara;
// Request to index a document.
message IndexDocumentRequest {
// The Customer ID to issue the request for.
int64 customer_id = 1;
// The Corpus ID to index the document into.
int64 corpus_id = 2;
// The Document to index.
com.vectara.indexing.Document document = 3;
}
message IndexDocumentResponse {
// ALREADY_EXISTS (6) The document has already been indexed, and no new quota was consumed.
// RESOURCE_EXHAUSTED (8): The indexing request cannot complete because the system is out of resources. This error may be due to too many simultaneous requests or you exceeded your quota.
// CONFLICT (409): The Document ID already exists. Indexing doesn't support updating documents.
// The new request does not match the previous request for the Document ID. If you would like
// to update the document, delete it first, and then add it to the index again.
// TOO_MANY_REQUESTS (429): The server is overloaded, or you sent too many indexing requests
// to the server in a short amount of time. This is similar to RESOURCE_EXHAUSTED.
// IDX__TRANSIENT_PARTIAL_DELETION_FAILURE (5000): The indexing request resulted in a transient error during the partial deletion of documents. Try the request again.
// IDX__PERMANENT_PARTIAL_DELETION_FAILURE (5001): The indexing request resulted in a
// permanent error during the partial deletion of documents. See https://status.vectara.com
// for the latest info on any outages. If the problem persists, please contact us via support
// or via our community forums at https://discuss.vectara.com if you’re a Growth user.
// during the partial deletion of documents.
//
// Some common relevant error codes may also be returned for corresponding errors,
// for example, PERMISSION_DENIED, DISABLED_CUSTOMER, NOT_FOUND.
Status status = 1;
// The storage quota needed for the document indexed in the request.
// If "status" is ALREADY_EXISTS, it means that the document was already in the index prior to
// this request. In such cases, quota is not consumed again and the value in this field
// represents the quota consumed when the document was indexed the first time.
StorageQuota quota_consumed = 2;
}
service IndexService {
rpc Index(IndexDocumentRequest) returns (IndexDocumentResponse) {
option (google.api.http) = {
post: "/v1/index"
body: "*"
};
}
rpc Delete(DeleteDocumentRequest) returns (DeleteDocumentResponse) {
option (google.api.http) = {
post: "/v1/delete-doc"
body: "*"
};
}
}
service QueryService {
// A standard single-request, single-response endpoint designed for high performance.
rpc Query(com.vectara.serving.BatchQueryRequest)
returns (com.vectara.serving.BatchQueryResponse) {
option (google.api.http) = {
post: "/v1/query"
body: "*"
};
}
// A streamed response interface when lower latency is absolutely critical.
rpc StreamQuery(com.vectara.serving.BatchQueryRequest)
returns (stream com.vectara.serving.QueryResponsePart) {
option (google.api.http) = {
post: "/v1/stream-query"
body: "*"
};
}
}
service AdminService {
rpc CreateCorpus(com.vectara.admin.CreateCorpusRequest) returns (com.vectara.admin.CreateCorpusResponse){
option (google.api.http) = {
post: "/v1/create-corpus"
body: "*"
};
}
rpc UpdateCorpus(com.vectara.admin.UpdateCorpusRequest)
returns (com.vectara.admin.UpdateCorpusResponse) {
option (google.api.http) = {
post: "/v1/update-corpus"
body: "*"
};
}
rpc DeleteCorpus(com.vectara.admin.DeleteCorpusRequest) returns (com.vectara.admin.DeleteCorpusResponse){
option (google.api.http) = {
post: "/v1/delete-corpus"
body: "*"
};
}
rpc ResetCorpus(com.vectara.admin.ResetCorpusRequest) returns (com.vectara.admin.ResetCorpusResponse){
option (google.api.http) = {
post: "/v1/reset-corpus"
body: "*"
};
}
rpc ListCorpora(com.vectara.admin.ListCorporaRequest)
returns (com.vectara.admin.ListCorporaResponse) {
option (google.api.http) = {
post: "/v1/list-corpora"
body: "*"
};
}
rpc ListJobs(com.vectara.admin.ListJobsRequest) returns (com.vectara.admin.ListJobsResponse) {
option (google.api.http) = {
post: "/v1/list-jobs"
body: "*"
};
}
// Return information about corpora.
rpc ReadCorpus(com.vectara.admin.ReadCorpusRequest)
returns (com.vectara.admin.ReadCorpusResponse) {
option (google.api.http) = {
post: "/v1/read-corpus"
body: "*"
};
}
rpc ComputeCorpusSize(com.vectara.admin.ComputeCorpusSizeRequest)
returns (com.vectara.admin.ComputeCorpusSizeResponse) {
option (google.api.http) = {
post: "/v1/compute-corpus-size"
body: "*"
};
}
rpc ComputeAccountSize(com.vectara.admin.ComputeAccountSizeRequest)
returns (com.vectara.admin.ComputeAccountSizeResponse) {
option (google.api.http) = {
post: "/v1/compute-account-size"
body: "*"
};
}
rpc ListUsers(com.vectara.admin.ListUsersRequest)
returns (com.vectara.admin.ListUsersResponse) {
option (google.api.http) = {
post: "/v1/list-users"
body: "*"
};
}
rpc ManageUser(com.vectara.admin.ManageUserRequest)
returns (com.vectara.admin.ManageUserResponse) {
option (google.api.http) = {
post: "/v1/manage-user"
body: "*"
};
}
rpc UpdateCorpusEnablement(com.vectara.admin.UpdateCorpusEnablementRequest) returns (com.vectara.admin.UpdateCorpusEnablementResponse) {
option (google.api.http) = {
post: "/v1/update-corpus-enablement"
body: "*"
};
}
rpc ReplaceCorpusFilterAttrs(com.vectara.admin.ReplaceCorpusFilterAttrsRequest) returns (com.vectara.admin.ReplaceCorpusFilterAttrsResponse) {
option (google.api.http) = {
post: "/v1/replace-corpus-filter-attrs"
body: "*"
};
}
// Get metric usage of either sliding windows or between two timestamps
rpc GetUsageMetrics(com.vectara.admin.UsageMetricsRequest) returns (com.vectara.admin.UsageMetricsResponse){
option (google.api.http) = {
post: "/v1/get-usage-metrics"
body: "*"
};
}
rpc CreateApiKey(com.vectara.admin.CreateApiKeyRequest) returns (com.vectara.admin.CreateApiKeyResponse) {
option (google.api.http) = {
post: "/v1/create-api-key"
body: "*"
};
}
rpc EnableApiKey(com.vectara.admin.EnableApiKeyRequest) returns (com.vectara.admin.EnableApiKeyResponse) {
option (google.api.http) = {
post: "/v1/enable-api-key"
body: "*"
};
}
rpc DeleteApiKey(com.vectara.admin.DeleteApiKeyRequest) returns (com.vectara.admin.DeleteApiKeyResponse) {
option (google.api.http) = {
post: "/v1/delete-api-key"
body: "*"
};
}
rpc ListApiKeys(com.vectara.admin.ListApiKeysRequest) returns (com.vectara.admin.ListApiKeysResponse) {
option (google.api.http) = {
post: "/v1/list-api-keys"
body: "*"
};
}
}
// Service for working with documents.
service DocumentService {
// Returns a list of documents for customer/corpus with pagination and optional document metadata filtering.
rpc ListDocuments(com.vectara.lists.ListDocumentsRequest) returns (com.vectara.lists.ListDocumentsResponse) {
option (google.api.http) = {
post: "/v1/list-documents"
body: "*"
};
}
}
// Service for working with chat conversations.
service ChatService {
// List all conversations.
rpc ListConversations(com.vectara.chat.ListConversationsRequest)
returns (com.vectara.chat.ListConversationsResponse) {
option (google.api.http) = {
post: "/v1/list-conversations"
body: "*"
};
}
// Read all turns within the passed conversations.
rpc ReadConversations(com.vectara.chat.ReadConversationsRequest)
returns (com.vectara.chat.ReadConversationsResponse) {
option (google.api.http) = {
post: "/v1/read-conversations"
body: "*"
};
}
// Delete conversations (including all turns in it).
rpc DeleteConversations(com.vectara.chat.DeleteConversationsRequest)
returns (com.vectara.chat.DeleteConversationsResponse) {
option (google.api.http) = {
post: "/v1/delete-conversations"
body: "*"
};
}
// Delete turns.
rpc DeleteTurns(com.vectara.chat.DeleteTurnsRequest)
returns (com.vectara.chat.DeleteTurnsResponse) {
option (google.api.http) = {
post: "/v1/delete-turns"
body: "*"
};
}
// Disable turn. The turn will no longer be used in conversations.
rpc DisableTurns(com.vectara.chat.DisableTurnsRequest)
returns (com.vectara.chat.DisableTurnsResponse) {
option (google.api.http) = {
post: "/v1/disable-turns"
body: "*"
};
}
}