diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f34a39d..9b5193ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: run: | cog --check \ -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" \ - docs/*.md + docs/**/*.md - name: Run Black run: | black --check . diff --git a/Justfile b/Justfile index 178a6738..f3f4b5e7 100644 --- a/Justfile +++ b/Justfile @@ -25,7 +25,7 @@ # Rebuild docs with cog @cog: - pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/*.md + pipenv run cog -r -p "import sys, os; sys._called_from_test=True; os.environ['LLM_USER_PATH'] = '/tmp'" docs/**/*.md # Serve live docs on localhost:8000 @docs: cog diff --git a/docs/contributing.md b/docs/contributing.md index 33b720fd..a1047a34 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -32,7 +32,9 @@ This will start a live preview server, using [sphinx-autobuild](https://pypi.org The CLI `--help` examples in the documentation are managed using [Cog](https://github.com/nedbat/cog). Update those files like this: - cog -r docs/*.md + just cog + +You'll need [Just](https://github.com/casey/just) installed to run this command. ## Release process diff --git a/docs/embeddings/python-api.md b/docs/embeddings/python-api.md index 1f9e8c9f..2a7e3b94 100644 --- a/docs/embeddings/python-api.md +++ b/docs/embeddings/python-api.md @@ -135,3 +135,41 @@ for id, score in collection.similar_by_id("cat"): print(id, score) ``` The item itself is excluded from the results. + +(embeddings-sql-schema)= +## SQL schema + +Here's the SQL schema used by the embeddings database: + + +```sql +CREATE TABLE [collections] ( + [id] INTEGER PRIMARY KEY, + [name] TEXT, + [model] TEXT +) +CREATE TABLE "embeddings" ( + [collection_id] INTEGER REFERENCES [collections]([id]), + [id] TEXT, + [embedding] BLOB, + [content] TEXT, + [metadata] TEXT, + [updated] INTEGER, + PRIMARY KEY ([collection_id], [id]) +) +``` + \ No newline at end of file