simonw / llm

Access large language models from the command-line
https://llm.datasette.io
Apache License 2.0
4.81k stars 266 forks source link

WIP: Fragments #638

Open simonw opened 4 days ago

simonw commented 4 days ago

Refs:

TODO:

simonw commented 4 days ago

Here's a but of a weird problem. We're storing fragments in the logs.db database - but that means this logic here isn't quite right:

https://github.com/simonw/llm/blob/9b2d4d6256eb82a6a3f67d0e6300f8557778a4c9/llm/cli.py#L476-L482

Here we are only even creating that logs.db database at the very end of prompt() if the user has logging enabled.

But now we need that database at the start of that CLI command in case we need to resolve any fragment aliases using it.

It's a bit weird that it's called logs.db now that it's supporting an additional feature that's not related to if logs are turned on or not. I think I can live with that though.

simonw commented 4 days ago

Lots more fragments available now - I added Datasette, sqlite-utils, s3-credentials and shot-scraper docs to https://github.com/simonw/llm-docs