import sqlite_utils import llm # This collection will use an in-memory database that will be # discarded when the Python process exits collection = llm.Collection("entries", model_id="ada-002") # Or you can persist the database to disk like this: db = sqlite_utils.Database("my-embeddings.db") collection = llm.Collection("entries", db, model_id="ada-002") # You can pass a model directly using model= instead of model_id= embedding_model = llm.get_embedding_model("ada-002") collection = llm.Collection("entries", db, model=embedding_model) # Store a string in the collection with an ID: collection.embed("hound", "my happy hound") # Or to store content and extra metadata: collection.embed( "hound", "my happy hound", metadata={"name": "Hound"}, store=True ) # Or embed things in bulk: collection.embed_multi( [ ("hound", "my happy hound"), ("cat", "my dissatisfied cat"), ], # Add this to store the strings in the content column: store=True, )