File tree Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Expand file tree Collapse file tree 3 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 22# using objectbox as a vector store
33
44import ollama
5- import objectbox
6- from objectbox .model import *
7- from objectbox .model .properties import *
5+ from objectbox import *
86
97documents = [
108 "Llamas are members of the camelid family meaning they're pretty closely related to vicuñas and camels" ,
1614]
1715
1816# Have fresh data for each start
19- objectbox . Store .remove_db_files ("objectbox" )
17+ Store .remove_db_files ("objectbox" )
2018
2119@Entity ()
2220class DocumentEmbedding :
@@ -27,7 +25,7 @@ class DocumentEmbedding:
2725 distance_type = VectorDistanceType .COSINE
2826 ))
2927
30- store = objectbox . Store ()
28+ store = Store ()
3129box = store .box (DocumentEmbedding )
3230
3331print ("Documents to embed: " , len (documents ))
Original file line number Diff line number Diff line change 11from cmd import Cmd
2- import objectbox
3- from objectbox .model import *
2+ from objectbox import *
43import time
54
65@Entity ()
@@ -24,7 +23,7 @@ def format_date(timestamp_ms: int) -> str:
2423
2524class TasklistCmd (Cmd ):
2625 prompt = "> "
27- _store = objectbox . Store (directory = "tasklist-db" )
26+ _store = Store (directory = "tasklist-db" )
2827 _box = _store .box (Task )
2928
3029 def do_ls (self , _ ):
Original file line number Diff line number Diff line change 11from cmd import Cmd
2- import objectbox
3- from objectbox .model import *
2+ from objectbox import *
43import time
54import csv
65import os
@@ -32,7 +31,7 @@ def __init__(self, *args):
3231 Cmd .__init__ (self , * args )
3332 dbdir = "cities-db"
3433 new_db = not os .path .exists (dbdir )
35- self ._store = objectbox . Store (directory = dbdir )
34+ self ._store = Store (directory = dbdir )
3635 self ._box = self ._store .box (City )
3736 if new_db :
3837 with open (os .path .join (os .path .dirname (__file__ ), 'cities.csv' )) as f :
You can’t perform that action at this time.
0 commit comments