-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
35 lines (33 loc) · 1.02 KB
/
setup.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
import weaviate
from src.constants import database_collection_name, database_dataset_text_field_name
# Connect to database server
client = weaviate.Client("http://localhost:8080")
# Create the Weaviate schema
schema = {
"classes": [
{
"class": database_collection_name,
"description": "A vector object",
"properties": [
{
"name": database_dataset_text_field_name,
"description": "Single memory",
"dataType": ["string"],
"moduleConfig": {
"text2vec-openai": {
"vectorizePropertyName": False,
}
},
}
],
"vectorIndexConfig": {"distance": "cosine"},
"moduleConfig": {
"text2vec-openai": {
"vectorizeClassName": False
}
}
}
]
}
client.schema.delete_all()
client.schema.create(schema)