datasette / datasette-embeddings

Store and query embedding vectors in Datasette tables
Apache License 2.0
4 stars 0 forks source link

Magic parameter mechanism for embedding text #14

Open simonw opened 3 hours ago

simonw commented 3 hours ago

To help us build SQL interfaces that embed text and then pass the result to the model.

Using this new feature in Datasette core:

simonw commented 3 hours ago

Put this in a queries.yml file:

databases:
  content:
    queries:
      embed:
        select :_openaiembeddefault_q

And then:

datasette content.db -c queries.yml -p 8003 -s plugins.datasette-embeddings.api_key "$(jq -r '.openai' "$(dirname "$(llm logs path)")/keys.json")"

And now: http://127.0.0.1:8003/content/embed?q=hello

CleanShot 2024-11-15 at 13 30 05@2x

simonw commented 3 hours ago

I wish I could put extra underscores in the parameter names. This is a bit ugly.