Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magic parameter mechanism for embedding text #14

Open
simonw opened this issue Nov 15, 2024 · 2 comments
Open

Magic parameter mechanism for embedding text #14

simonw opened this issue Nov 15, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Contributor

simonw commented Nov 15, 2024

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 simonw added the enhancement New feature or request label Nov 15, 2024
@simonw
Copy link
Contributor Author

simonw commented Nov 15, 2024

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
Copy link
Contributor Author

simonw commented Nov 15, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant