12 lines
499 B
Python
12 lines
499 B
Python
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.')
|