-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathopenapi.yaml
76 lines (76 loc) · 1.89 KB
/
openapi.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
openapi: 3.0.1
info:
title: Prompt Engineering FAQ
description: Search and get prompt engineering FAQ
version: "v1"
servers:
- url: http://localhost:8000
paths:
/query:
post:
summary: Query
operationId: query
description: Get the answer and question about prompt engineering
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/QueryRequest"
required: true
responses:
"200":
description: Successful Response
content:
application/json:
schema:
$ref: "#/components/schemas/QueryResponse"
components:
schemas:
QueryRequest:
title: QueryRequest
required:
- query
- top_k
type: object
properties:
query:
title: Query
type: string
description: Used to search for a prompt engineering based on keywords. For example, ?query=react will return a list of relivant faq.
top_k:
title: Top K
type: integer
default: 3
description: Used to limit the number of results returned. For example, ?top_k=5 will return a list of 5 faq. if not specified, the default value is 3.
QueryResponse:
title: QueryResponse
required:
- results
type: object
properties:
results:
title: Results
type: array
items:
$ref: "#/components/schemas/QueryResult"
QueryResult:
title: QueryResult
required:
- id
- score
- question
- answer
type: object
properties:
id:
title: Id
type: number
score:
title: Score
type: number
question:
title: Question
type: string
answer:
title: Answer
type: string