generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 3
/
openapi.yml
302 lines (286 loc) · 8.29 KB
/
openapi.yml
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
297
298
299
300
301
302
openapi: 3.0.0
info:
title: Greptile API
version: '2.0'
description: API for accessing Greptile services including chat history retrieval, repository processing, and executing queries with streaming support.
servers:
- url: 'https://api.greptile.com/v2/'
components:
securitySchemes:
ApiKeyAuth:
type: http
scheme: bearer
GitHubToken:
type: apiKey
in: header
name: X-GitHub-Token
schemas:
ChatLog:
type: object
properties:
userId:
type: string
timestamp:
type: string
sessionId:
type: string
chatLog:
type: array
items:
type: object
properties:
content:
type: string
role:
type: string
sources:
$ref: '#/components/schemas/SearchResponse'
repos:
type: array
items:
type: string
parentId:
type: string
title:
type: string
Sources:
type: object
properties:
repository:
type: string
description: The name of the repository where the file resides.
remote:
type: string
description: The remote service or platform where the repository is hosted.
branch:
type: string
description: The branch of the repository where the file is found.
filepath:
type: string
description: The relative path to the file within the repository.
linestart:
type: integer
description: The starting line number of the code that is relevant, if applicable.
nullable: true
lineend:
type: integer
description: The ending line number of the code that is relevant, if applicable.
nullable: true
summary:
type: string
description: A summary or description of the contents and functionalities of the file.
RepositoryRequest:
type: object
properties:
remote:
type: string
description: Supported values are "github" or "gitlab".
repository:
type: string
description: Repository identifier in "owner/repository" format.
branch:
type: string
description: Branch name. Optional, defaults to repository's default branch.
reload:
type: boolean
description: If false, won't reprocess if previously successful. Optional, default true.
notify:
type: boolean
description: Whether to notify the user upon completion. Optional, default true.
RepositoryResponse:
type: object
properties:
message:
type: string
description: Processing status message.
statusEndpoint:
type: string
description: URL to check the status of the repository processing.
RepositoryInfo:
type: object
properties:
repository:
type: string
remote:
type: string
branch:
type: string
private:
type: boolean
status:
type: string
filesProcessed:
type: integer
numFiles:
type: integer
sha:
type: string
QueryRequest:
type: object
properties:
messages:
description: List of chat messages until now. For a single query, include only one entry in the list with a natural language query.
type: array
items:
type: object
properties:
id:
type: string
content:
type: string
role:
type: string
repositories:
description: List of repos that Greptile should reference while answering your question.
type: array
items:
type: object
properties:
remote:
type: string
branch:
type: string
repository:
type: string
sessionId:
type: string
description: Optional, defaults to a new session. Only use this if you intend to need to retrieve chat history later.
stream:
type: boolean
description: Optional, default false.
genius:
type: boolean
description: Optional, default false. Genius requests are smarter but 8-10 seconds slower, great for complex usecases like reviewing PR and updating technical docs.
SearchRequest:
type: object
properties:
query:
type: string
description: Natural language search query to find the right code in the repo.
repositories:
type: array
description: List of repos that Greptile should reference while answering your question.
items:
type: object
properties:
remote:
type: string
branch:
type: string
repository:
type: string
sessionId:
type: string
description: Optional, defaults to a new session. You only need this if you want to retrieve this query/response later.
stream:
type: boolean
description: Optional, default false.
QueryResponse:
type: object
properties:
message:
type: string
sources:
$ref: '#/components/schemas/SearchResponse'
SearchResponse:
type: array
items:
$ref: '#/components/schemas/Sources'
paths:
/chats/{sessionId}:
get:
summary: Retrieve chat history for a given session.
security:
- ApiKeyAuth: []
- ApiKeyAuth: []
GitHubToken: []
parameters:
- in: path
name: sessionId
required: true
schema:
type: string
responses:
'200':
description: Chat history retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/ChatLog'
/repositories:
post:
summary: Process or reprocess a repository.
security:
- ApiKeyAuth: []
GitHubToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RepositoryRequest'
responses:
'200':
description: Repository processing started.
content:
application/json:
schema:
$ref: '#/components/schemas/RepositoryResponse'
/repositories/{repositoryId}:
get:
summary: Get information about a single repository.
security:
- ApiKeyAuth: []
- ApiKeyAuth: []
GitHubToken: []
parameters:
- in: path
name: repositoryId
required: true
schema:
type: string
responses:
'200':
description: Repository information retrieved successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/RepositoryInfo'
/query:
post:
summary: Execute a query with optional streaming.
security:
- ApiKeyAuth: []
GitHubToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/QueryRequest'
responses:
'200':
description: Query executed successfully. Response may be streamed.
content:
application/json:
schema:
$ref: '#/components/schemas/QueryResponse'
/search:
post:
summary: Search repositories with natural language queries.
security:
- ApiKeyAuth: []
GitHubToken: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SearchRequest'
responses:
'200':
description: Query executed successfully. Response may be streamed.
content:
application/json:
schema:
$ref: '#/components/schemas/SearchResponse'