-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.py
38 lines (34 loc) · 906 Bytes
/
schema.py
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
import json
from client import Client
Client.schema.delete_all()
schema = {
"classes": [
{
"class": "Article",
"vectorizer": "text2vec-cohere",
"properties": [
{
"name": "category",
"dataType": ["text"],
"description": "article category"
},
{
"name": "heading",
"dataType": ["text"],
"description": "article title"
},
{
"name": "article",
"dataType": ["text"],
"description": "article content"
}
]
}
]
}
# create the schema
Client.schema.create(schema)
# get the schema
schema = Client.schema.get()
# print the schema
print(json.dumps(schema, indent=4))