Skip to content

Commit 6070a7e

Browse files
committed
CLI: Add guidelines how to use the llm application and Python API
... with `instructions-general.md` and `llms-full.txt` files for executing prompts and holding conversations with LLMs.
1 parent cc5ad0b commit 6070a7e

2 files changed

Lines changed: 28 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Unreleased
44
- Prompt: Added `instructions-general.md` file when generating bundle
5+
- CLI: Added guidelines how to use the `llm` application and Python API
6+
with `instructions-general.md` and `llms-full.txt` files for executing
7+
prompts and holding conversations with LLMs.
58

69
## v0.0.6 - 2025-07-21
710
- Prompt: Added instructions about working with CrateDB to be used for

README.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ nothing big.
6666

6767
- Context bundle files are published to the [about/v1] folder.
6868
They can be used to provide better context for conversations about
69-
CrateDB, for example, by using the `cratedb-about ask` subcommand.
69+
CrateDB, for example, by using the `cratedb-about ask` subcommand,
70+
or by using generic applications like [`llm`].
7071

7172
- The documentation subsystem of the [cratedb-mcp] package uses the
7273
Python API to serve and consider relevant documentation resources
@@ -167,22 +168,43 @@ also be specified using the `OUTDIR` environment variable.
167168
### Query
168169
Ask questions about CrateDB from the command line.
169170
#### CLI
171+
Execute a prompt using the built-in Python implementation.
170172
```shell
171173
export OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
172174
cratedb-about ask "CrateDB does not seem to provide an AUTOINCREMENT feature?"
173175
```
176+
Hold an ongoing chat with a model using the versatile [`llm`] application.
177+
```shell
178+
uvx llm chat --model gpt-4.1 --option temperature 0.5 \
179+
--fragment https://cdn.crate.io/about/v1/llms-full.txt \
180+
--system-fragment https://cdn.crate.io/about/v1/instructions-general.md
181+
}
182+
```
174183
If you are running out of questions, get inspired by the standard library.
175184
```shell
176185
cratedb-about list-questions
177186
```
178187
#### API
179-
Use the Python API to ask questions about CrateDB.
188+
Use the built-in Python API to ask questions about CrateDB.
180189
```python
181190
from cratedb_about import CrateDbKnowledgeConversation
182191

183192
knowledge = CrateDbKnowledgeConversation()
184193
knowledge.ask("CrateDB does not seem to provide an AUTOINCREMENT feature?")
185194
```
195+
Use the Python API of the `llm` package to ask questions about CrateDB.
196+
```python
197+
import llm
198+
199+
model = llm.get_model("gpt-4.1")
200+
response = model.prompt(
201+
"CrateDB does not seem to provide an AUTOINCREMENT feature?",
202+
fragments=["https://cdn.crate.io/about/v1/llms-full.txt"],
203+
system_fragments=["https://cdn.crate.io/about/v1/instructions-general.md"],
204+
temperature=0.5,
205+
)
206+
print(response.text())
207+
```
186208
#### Notes
187209
- To configure a different context file, use the `ABOUT_CONTEXT_URL`
188210
environment variable. It can be a remote URL or a path on the local filesystem.
@@ -235,6 +257,7 @@ recommended, especially if you use it as a library.
235257
[cratedb-outline.yaml]: https://github.com/crate/about/blob/main/src/cratedb_about/outline/cratedb-outline.yaml
236258
[filesystem-spec]: https://filesystem-spec.readthedocs.io/
237259
[hierarchical outline]: https://en.wikipedia.org/wiki/Outline_(list)
260+
[`llm`]: https://llm.datasette.io/
238261
[llms-txt]: https://llmstxt.org/
239262
[llms.txt]: https://cdn.crate.io/about/v1/llms.txt
240263
[llms-full.txt]: https://cdn.crate.io/about/v1/llms-full.txt

0 commit comments

Comments
 (0)