2026-07-02 14:33:36 +07:00
|
|
|
import lancedb, pyarrow
|
|
|
|
|
import config
|
|
|
|
|
db = lancedb.connect(config.memories_db_path)
|
|
|
|
|
schema = pyarrow.schema([
|
|
|
|
|
pyarrow.field( 'id', pyarrow.string() ),
|
|
|
|
|
pyarrow.field( 'title', pyarrow.string() ),
|
|
|
|
|
pyarrow.field( 'story', pyarrow.string() ),
|
|
|
|
|
pyarrow.field( 'vector_title', pyarrow.list_( pyarrow.float32(), config.memories_vector_size ) ),
|
|
|
|
|
])
|
|
|
|
|
db.create_table(config.memories_table, schema=schema)
|
|
|
|
|
print(f'Table "{config.memories_table}" berhasil diproses.')
|