This repository was archived by the owner on Sep 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathmodus_schema.json
More file actions
371 lines (371 loc) · 15.8 KB
/
modus_schema.json
File metadata and controls
371 lines (371 loc) · 15.8 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
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
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
{
"$id": "https://schema.hypermode.com/modus.json",
"$schema": "http://json-schema.org/draft-07/schema",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": {
"type": "string",
"format": "uri",
"description": "The schema that the document should conform to.",
"markdownDescription": "The schema that the document should conform to.\n\nReference: https://json-schema.org/"
},
"endpoints": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 63,
"default": "default",
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"additionalProperties": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "graphql",
"description": "Type of the endpoint."
},
"path": {
"type": "string",
"minLength": 1,
"pattern": "^\\/\\S*$",
"not": {
"enum": ["/health", "/metrics"]
},
"default": "/graphql",
"description": "Path of the endpoint. Must start with a forward slash. Cannot be '/health' or '/metrics'."
},
"auth": {
"type": "string",
"enum": ["none", "bearer-token"],
"default": "bearer-token",
"description": "Type of authentication for the endpoint."
}
},
"required": ["type", "path", "auth"],
"additionalProperties": false
}
]
}
},
"models": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 63,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"additionalProperties": {
"oneOf": [
{
"type": "object",
"required": ["sourceModel", "provider", "connection"],
"additionalProperties": false,
"properties": {
"sourceModel": {
"type": "string",
"minLength": 1,
"description": "Name of the source model, using the id or path assigned by the provider."
},
"provider": {
"type": "string",
"minLength": 1,
"$comment": "More providers can be added to the enum as needed.",
"enum": ["hugging-face"],
"description": "Source provider of the model."
},
"connection": {
"type": "string",
"const": "hypermode",
"description": "Connection for the model. Either 'hypermode', or the name of an external connection as defined in the 'connections' section."
}
}
},
{
"type": "object",
"required": ["connection"],
"additionalProperties": false,
"properties": {
"sourceModel": {
"type": "string",
"minLength": 1,
"description": "Name of the source model, using the id or path assigned by the provider."
},
"connection": {
"type": "string",
"not": {
"const": "hypermode"
},
"minLength": 1,
"maxLength": 63,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$",
"description": "Connection for the model. Either 'hypermode', or the name of an external connection as defined in the 'connections' section."
},
"path": {
"type": "string",
"minLength": 1,
"$comment": "todo: validate path with a pattern regex",
"description": "Path to the model endpoint, applied to the 'baseUrl' of the connection."
}
}
}
]
}
},
"connections": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 63,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"additionalProperties": {
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "http",
"description": "Type of the connection."
},
"baseUrl": {
"type": "string",
"format": "uri",
"minLength": 1,
"pattern": "^https?://\\S+/$",
"description": "Base URL for connections to the connection. Must end with a trailing slash. If providing the entire URL, use the endpoint field instead.",
"markdownDescription": "Base URL for connections to the connection. Must end with a trailing slash. If providing the entire URL, use the `endpoint` field instead.\n\nReference: https://docs.hypermode.com/define-connections"
},
"endpoint": {
"type": "string",
"format": "uri",
"minLength": 1,
"pattern": "^https?://\\S+$",
"description": "Full URL endpoint for connections to the connection. If providing the base URL, use the baseUrl field instead.",
"markdownDescription": "Full URL endpoint for connections to the connection. If providing the base URL, use the `baseUrl` field instead.\n\nReference: https://docs.hypermode.com/define-connections"
},
"headers": {
"type": "object",
"propertyNames": {
"type": "string",
"minLength": 1,
"pattern": "^[\\w!#$%&'*+-.^`|~]+$"
},
"additionalProperties": {
"type": "string",
"minLength": 1
},
"description": "Headers to include in requests to the connection.",
"markdownDescription": "Headers to include in requests to the connection.\n\nReference: https://docs.hypermode.com/define-connections"
},
"queryParameters": {
"type": "object",
"$comment": "Query parameter keys and values will be encoded when used, so there is no need to validate a pattern in the schema.",
"propertyNames": {
"type": "string",
"minLength": 1
},
"additionalProperties": {
"type": "string",
"minLength": 1
},
"description": "Query parameters to include in requests to the connection.",
"markdownDescription": "Query parameters to include in requests to the connection.\n\nReference: https://docs.hypermode.com/define-connections"
}
},
"required": ["type"],
"additionalProperties": false,
"$comment": "Either baseUrl or endpoint must be provided, but not both.",
"allOf": [
{
"oneOf": [
{
"required": ["baseUrl"]
},
{
"required": ["endpoint"]
}
],
"not": {
"required": ["baseUrl", "endpoint"]
}
}
]
},
{
"properties": {
"type": {
"type": "string",
"const": "postgresql",
"description": "Type of the connection."
},
"connString": {
"type": "string",
"minLength": 1,
"pattern": "^postgres(?:ql)?:\\/\\/(.*?@)?([0-9a-zA-Z.-]*?)(:\\d+)?(\\/[0-9a-zA-Z.-]+)?(\\?.+)?$",
"description": "The PostgreSQL connection string in URI format.",
"markdownDescription": "The PostgreSQL connection string in URI format.\n\nReference: https://docs.hypermode.com/define-connections"
}
},
"required": ["type", "connString"],
"additionalProperties": false
},
{
"properties": {
"type": {
"type": "string",
"const": "dgraph",
"description": "Type of the connection."
},
"grpcTarget": {
"type": "string",
"minLength": 1,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9.]+)*:\\d+$",
"description": "The gRPC target for connections to Dgraph, such as \"localhost:9080\" or \"your-server-1234567.grpc.us-east-1.aws.cloud.dgraph.io:443\".",
"markdownDescription": "The gRPC target for connections to Dgraph, such as \"localhost:9080\" or \"your-server-1234567.grpc.us-east-1.aws.cloud.dgraph.io:443\".\n\nReference: https://docs.hypermode.com/define-connections"
},
"key": {
"type": "string",
"minLength": 1,
"description": "API key for Dgraph.",
"markdownDescription": "API key for Dgraph.\n\nReference: https://docs.hypermode.com/define-connections"
}
},
"required": ["type", "grpcTarget"],
"additionalProperties": false
},
{
"properties": {
"type": {
"type": "string",
"const": "neo4j",
"description": "Type of the connection."
},
"dbUri": {
"type": "string",
"minLength": 1,
"pattern": "^(?:neo4j|neo4j\\+s|bolt)://(.*?@)?([0-9a-zA-Z.-]*?)(:\\d+)?(\\/[0-9a-zA-Z.-]+)?(\\?.+)?$",
"description": "The Neo4j connection string in URI format.",
"markdownDescription": "The Neo4j connection string in URI format.\n\nReference: https://docs.hypermode.com/define-connections"
},
"username": {
"type": "string",
"minLength": 1,
"description": "Username for the Neo4j connection.",
"markdownDescription": "Username for the Neo4j connection.\n\nReference: https://docs.hypermode.com/define-connections"
},
"password": {
"type": "string",
"minLength": 1,
"description": "Password for the Neo4j connection.",
"markdownDescription": "Password for the Neo4j connection.\n\nReference: https://docs.hypermode.com/define-connections"
}
},
"required": ["type", "dbUri", "username", "password"],
"additionalProperties": false
}
]
}
},
"collections": {
"type": "object",
"description": "Collection definitions, for natural language search.",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 63,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"additionalProperties": {
"type": "object",
"description": "Collection configuration.",
"additionalProperties": false,
"properties": {
"searchMethods": {
"type": "object",
"description": "Search methods for the collection.",
"propertyNames": {
"type": "string",
"minLength": 1,
"maxLength": 63,
"pattern": "^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$"
},
"additionalProperties": {
"type": "object",
"description": "Search method configuration for the collection. If an index configuration is not specified, a default sequential index will be created automatically.",
"additionalProperties": false,
"properties": {
"embedder": {
"type": "string",
"minLength": 1,
"description": "Name of the embedding function to call in the collection."
},
"index": {
"description": "Index configuration for the collection.",
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"const": "sequential",
"default": "sequential",
"description": "Type of the index."
}
},
"required": ["type"]
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"type": {
"type": "string",
"const": "hnsw",
"default": "sequential",
"description": "Type of the index."
},
"options": {
"type": "object",
"description": "Options for the HNSW index.",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"efConstruction": {
"type": "integer",
"default": 15,
"description": "The number of candidate vertices to evaluate during construction.\n\nDefault: 15"
},
"maxLevels": {
"type": "integer",
"default": 5,
"description": "The maximum number of levels in the structure.\n\nDefault: 5"
}
}
}
},
"required": ["type"]
}
]
}
},
"required": ["embedder"]
}
}
}
}
}
}
}
]
}