-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathopenapi.yaml
135 lines (134 loc) · 4.82 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
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.1
info:
title: OS GPT
description: A plugin that executes shell commands on the host PC using ChatGPT Plus, supporting both UNIX-like and Windows systems. Additionally, it can load and query documents from specified folders using vector databases.
version: 'v1'
x-logo:
url: "file://logo.png"
servers:
- url: http://localhost:5004
paths:
/command:
post:
operationId: executeCommand
summary: Execute a shell command
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
command:
type: string
description: The command to execute. Be careful, commands are executed as is.
responses:
"200":
description: Command executed successfully
content:
text/plain:
schema:
type: string
description: The output of the command.
"400":
description: Invalid request, command not provided
"500":
description: An error occurred while executing the command
/load-data:
post:
operationId: loadData
summary: Load documents from the provided folder and create a vector database
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
folder_path:
type: string
description: The path to the folder containing the documents to be loaded.
dataset_name:
type: string
description: The name for the dataset, used as an identifier.
responses:
"200":
description: Database creation completed successfully
content:
text/plain:
schema:
type: string
description: Confirmation message indicating successful database creation.
"400":
description: Invalid request, folder_path or dataset_name not provided
"500":
description: An error occurred during the document loading or database creation
/query-data:
post:
operationId: queryData
summary: Query a specific vector database using a provided query and dataset name
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
query:
type: string
description: The query to search in the database.
dataset_name:
type: string
description: The name of the dataset (previously loaded) to be queried.
responses:
"200":
description: Query completed successfully
content:
text/plain:
schema:
type: string
description: The formatted output containing relevant document segments.
"400":
description: Invalid request, query or dataset_name not provided
"404":
description: No database found for the given dataset_name
"500":
description: An error occurred during the query process
/get-db-info:
post:
operationId: getDbInfo
summary: Retrieve database or folder path information based on the dataset name and query type
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
dataset_name:
type: string
description: The name of the dataset (previously loaded) for which the path information is required.
query_type:
type: string
enum: ['db_path', 'folder_path']
description: The type of path information required ('db_path' for database path, 'folder_path' for folder path).
responses:
"200":
description: Information retrieval completed successfully
content:
application/json:
schema:
type: object
properties:
db_path:
type: string
description: The database path for the specified dataset (if query_type is 'db_path').
folder_path:
type: string
description: The folder path for the specified dataset (if query_type is 'folder_path').
"400":
description: Invalid request, dataset_name or query_type not provided
"404":
description: No information found for the given dataset_name or query_type
"500":
description: An error occurred during the information retrieval process