Skip to content

Commit

Permalink
Small fixes to the example script
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlQLange committed Jan 15, 2025
1 parent cfad22e commit c482cea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/sqlite_vec_example.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
require "langchain"

# Initialize the LLM (using OpenAI in this example)
# Initialize the LLM (using Ollama in this example)
llm = Langchain::LLM::Ollama.new

# Initialize the SQLite-vec vectorstore
db = Langchain::Vectorsearch::SqliteVec.new(
url: ":memory:", # Use a file-based DB (or ":memory:" for in-memory)
url: ":memory:", # Use a file-based DB by passing a path or ":memory:" for in-memory
index_name: "documents",
namespace: "test",
llm: llm
Expand Down Expand Up @@ -43,5 +43,4 @@
puts "Answer: #{response.chat_completion}"

# Clean up
db.destroy_default_schema
File.delete("test_vectors.sqlite3") if File.exist?("test_vectors.sqlite3")
db.destroy_default_schema

0 comments on commit c482cea

Please sign in to comment.