simonw / simonw/llm

Document (or make easier) how to have Python code log to SQLite

Open
#228 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement logging python-api
Dominant language
Python
Stars
12.5k
Forks
998
Avg merge
3d 13h
Merged PRs (30d)
10

Description

Question came up here: https://discord.com/channels/823971286308356157/1128504153841336370/1148406576739254363

Currently there isn't a documented way of having prompts run through the Python code get logged to SQLite.

The undocumented way is to do this:

db = sqlite_utils.Database("logs.db")
response = model.prompt("prompt goes here")
response.log_to_db(db)

But that's a) not documented and b) not much fun to have to remember to do every time.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the Python prompt flow and the existing response.log_to_db(db) entry point first. The issue leaves open whether to document that workflow or make logging automatic; done means users have a clear, supported way to log prompts to SQLite without relying on undocumented behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sqlite
Domain
databases
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.