Skip to content

Commit ba8c5a2

Browse files
dan-obxloryruta
authored andcommitted
examples: updated to use idsync and model json file #25
1 parent 82bbb34 commit ba8c5a2

7 files changed

Lines changed: 325 additions & 37 deletions

File tree

example/ollama/llamas.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616

1717
from objectbox.model import *
18+
from objectbox.model.idsync import sync_model
19+
from objectbox.model.properties import *
20+
import numpy as np
1821

1922
# Have fresh data for each start
2023
objectbox.Store.remove_db_files("objectbox")

example/ollama/obx-model.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,35 @@
22
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
33
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
44
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
5+
"modelVersionParserMinimum": 5,
56
"entities": [
67
{
7-
"id": "1:8004313811940756000",
8+
"id": "1:6961408191300375810",
89
"name": "DocumentEmbedding",
9-
"lastPropertyId": "3:1002055376809445224",
10+
"lastPropertyId": "3:1544317969640594905",
1011
"properties": [
1112
{
12-
"id": "1:5231290100164136665",
13-
"name": "id"
13+
"id": "1:3876977054512990044",
14+
"name": "id",
15+
"type": 6,
16+
"flags": 1
1417
},
1518
{
16-
"id": "2:2794747928415190181",
17-
"name": "document"
19+
"id": "2:7160924628219144152",
20+
"name": "document",
21+
"type": 9,
22+
"flags": 0
1823
},
1924
{
20-
"id": "3:1002055376809445224",
25+
"id": "3:1544317969640594905",
2126
"name": "embedding",
22-
"indexId": "1:5402707781572973098"
27+
"type": 28,
28+
"flags": 8,
29+
"indexId": "1:3700549598877373380"
2330
}
2431
]
2532
}
2633
],
27-
"lastEntityId": "1:8004313811940756000",
28-
"lastIndexId": "1:5402707781572973098",
29-
"modelVersionParserMinimum": 5
34+
"lastEntityId": "1:6961408191300375810",
35+
"lastIndexId": "1:3700549598877373380"
3036
}

example/tasks/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from objectbox.model import *
2-
from objectbox.model.sync_model import sync_model
2+
from objectbox.model.idsync import sync_model
33
import os.path
44

55
@Entity()

example/tasks/obx-model.json

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,40 @@
22
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
33
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
44
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
5+
"modelVersionParserMinimum": 5,
56
"entities": [
67
{
7-
"id": "1:6465125355924028123",
8+
"id": "1:8788355504645367043",
89
"name": "Task",
9-
"lastPropertyId": "4:8015673551585674115",
10+
"lastPropertyId": "4:8008741740181940834",
1011
"properties": [
1112
{
12-
"id": "1:8700906525982901970",
13-
"name": "id"
13+
"id": "1:2204404178690013419",
14+
"name": "id",
15+
"type": 6,
16+
"flags": 1
1417
},
1518
{
16-
"id": "2:6068517061615452812",
17-
"name": "text"
19+
"id": "2:9211247851395059885",
20+
"name": "text",
21+
"type": 9,
22+
"flags": 0
1823
},
1924
{
20-
"id": "3:1585967268027923630",
21-
"name": "date_created"
25+
"id": "3:1225557865887046719",
26+
"name": "date_created",
27+
"type": 10,
28+
"flags": 0
2229
},
2330
{
24-
"id": "4:8015673551585674115",
25-
"name": "date_finished"
31+
"id": "4:8008741740181940834",
32+
"name": "date_finished",
33+
"type": 10,
34+
"flags": 0
2635
}
2736
]
2837
}
2938
],
30-
"lastEntityId": "1:6465125355924028123",
31-
"lastIndexId": "0:0",
32-
"modelVersionParserMinimum": 5
39+
"lastEntityId": "1:8788355504645367043",
40+
"lastIndexId": "0:0"
3341
}

example/vectorsearch-cities/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from objectbox.model import *
22
from objectbox.model.properties import *
3-
from objectbox.model.sync_model import sync_model
3+
from objectbox.model.idsync import sync_model
44
import objectbox
55
import numpy as np
66
import os.path

example/vectorsearch-cities/obx-model.json

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,35 @@
22
"_note1": "KEEP THIS FILE! Check it into a version control system (VCS) like git.",
33
"_note2": "ObjectBox manages crucial IDs for your object model. See docs for details.",
44
"_note3": "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
5+
"modelVersionParserMinimum": 5,
56
"entities": [
67
{
7-
"id": "1:4817145754065816046",
8+
"id": "1:1326033324603613162",
89
"name": "City",
9-
"lastPropertyId": "3:8621035483966640033",
10+
"lastPropertyId": "3:3620267477682371232",
1011
"properties": [
1112
{
12-
"id": "1:5906277260829377830",
13-
"name": "id"
13+
"id": "1:2574904406208562760",
14+
"name": "id",
15+
"type": 6,
16+
"flags": 1
1417
},
1518
{
16-
"id": "2:1820212786894711110",
17-
"name": "name"
19+
"id": "2:17672653531649098",
20+
"name": "name",
21+
"type": 9,
22+
"flags": 0
1823
},
1924
{
20-
"id": "3:8621035483966640033",
25+
"id": "3:3620267477682371232",
2126
"name": "location",
22-
"indexId": "1:933206701064379830"
27+
"type": 28,
28+
"flags": 8,
29+
"indexId": "1:1492488102116293126"
2330
}
2431
]
2532
}
2633
],
27-
"lastEntityId": "1:4817145754065816046",
28-
"lastIndexId": "1:933206701064379830",
29-
"modelVersionParserMinimum": 5
34+
"lastEntityId": "1:1326033324603613162",
35+
"lastIndexId": "1:1492488102116293126"
3036
}

0 commit comments

Comments
 (0)