文件历史

提交图

29 次代码提交

作者 SHA1 备注 提交日期
Simon Willison c8889e0a76 Ran black 2026-03-17 11:25:12 -07:00
Simon Willison eafe141d49 Fix for Python 3.9, refs #1099 2025-05-26 19:54:57 -07:00
Simon Willison 1dc7a1d1f9 Monotonic ULIDs, refs #1099 2025-05-26 19:49:42 -07:00
Simon Willison 3d25708acd Instantiate from spec utility function, refs #1059
Code by o3, docstring by Claude Sonnet 4
2025-05-24 08:21:33 -07:00
Simon Willison 3cbc37a470 Log tool plugin to database
Refs https://github.com/simonw/llm/issues/1020#issuecomment-2905968166
2025-05-23 15:59:43 -07:00
Simon Willison f6fefb3816 llm schemas list --json/--nl options, closes #1070 2025-05-23 15:17:32 -07:00
Simon Willison 32cab986ea Log tool stuff to the database, refs #1003 2025-05-13 17:19:30 -07:00
Simon Willison a571a4e948 register_fragment_loaders() hook (#886)
* Docs and shape of register_fragment_loaders hook, refs #863
* Update docs for fragment loaders returning a list of FragmentString
* Support multiple fragments with same content, closes #888
* Call the pm.hook.register_fragment_loaders hook
* Test for register_fragment_loaders hook
* Rename FragmentString to Fragment

Closes #863
2025-04-06 17:03:34 -07:00
Simon Willison ac49075129 llm logs -e/--expand option, closes #881 2025-04-06 00:25:28 -07:00
Simon Willison f740a5cbbd Fragments (#859)
* WIP fragments: schema plus reading but not yet writing, refs #617
* Unique index on fragments.alias, refs #617
* Fragments are now persisted, added basic CLI commands
* Fragment aliases work now, refs #617
* Improved help for -f/--fragment
* Support fragment hash as well
* Documentation for fragments
* Better non-JSON display of llm fragments list
* llm fragments -q search option
* _truncate_string is now truncate_string
* Use condense_json to avoid duplicate data in JSON in DB, refs #617
* Follow up to 3 redirects for fragments
* Python API docs for fragments= and system_fragments=
* Fragment aliases cannot contain a : - this is to ensure we can add custom fragment loaders later on, refs https://github.com/simonw/llm/pull/859#issuecomment-2761534692
* Use template fragments when running prompts
* llm fragments show command plus llm fragments group tests
* Tests for fragments family of commands
* Test for --save with fragments
* Add fragments tables to docs/logging.md
* Slightly better llm fragments --help
* Handle fragments in past conversations correctly
* Hint at llm prompt --help in llm --help, closes #868
* llm logs -f filter plus show fragments in llm logs --json
* Include prompt and system fragments in llm logs -s
* llm logs markdown fragment output and tests, refs #617
2025-04-05 17:22:37 -07:00
Simon Willison cc94111892 Skip invalid templates in llm templates list, closes #880 2025-04-05 11:32:35 -07:00
Simon Willison 4a45bc6efc Move new truncate_string to llm.utils, add tests
Refs #759
2025-03-22 16:30:34 -07:00
Simon Willison 48f67f4085 llm logs --data-ids flag, closes #800 2025-02-27 20:31:50 -08:00
Simon Willison 1bebf8b34a --schema t:template-name option, plus improved schema docs
Closes #799, refs #788
2025-02-27 17:25:31 -08:00
Simon Willison eb2b243fdf schema_dsl(..., multi=True) parameter, refs #790 2025-02-27 10:28:42 -08:00
Simon Willison 8d32b71ef1 Renamed build_json_schema to schema_dsl 2025-02-27 10:22:29 -08:00
Simon Willison e20bd45cb5 Fix for mypy and ruff, refs #790 2025-02-27 10:01:24 -08:00
Simon Willison 321636e791 New schema DSL, closes #790
Plus made a start on schemas.md refs #788
2025-02-27 09:48:44 -08:00
Simon Willison 99a1adcece Initial llm schemas list implementation, refs #781 2025-02-27 07:35:48 -08:00
Simon Willison f35ac31c21 llm logs --schema, --data, --data-array and --data-key options (#785)
* llm logs --schema option, refs #782
* --data and --data-array and --data-key options, refs #782
* Tests for llm logs --schema options, refs #785
* Also implemented --schema ID lookup, refs #780
* Using --data-key implies --data
* Docs for llm logs --schema and --data etc
2025-02-26 21:51:08 -08:00
Simon Willison 656d8fa3c4 --xl/--extract-last flag for prompt and log list commands (#718)
Closes #717
2025-01-24 10:52:46 -08:00
Simon Willison 67d4a99645 llm prompt -x/--extract option, closes #681 2024-12-19 06:40:05 -08:00
Simon Willison cfb10f4afd Log input tokens, output tokens and token details (#642)
* Store input_tokens, output_tokens, token_details on Response, closes #610
* llm prompt -u/--usage option
* llm logs -u/--usage option
* Docs on tracking token usage in plugins
* OpenAI default plugin logs usage
2024-11-19 20:21:59 -08:00
Simon Willison 5d1d723d4b Special case treat audio/wave as audio/wav, closes #603 2024-11-07 17:13:54 -08:00
Simon Willison 13ab8bb5fb Better HTTPX logging idiom, thanks @karpetrosyan
https://github.com/encode/httpx/discussions/3073#discussioncomment-8263619

Refs #404
2024-01-27 21:46:15 -08:00
Simon Willison 029d8e9e26 Better function name 2024-01-26 12:06:30 -08:00
Simon Willison 1f67f14cdb Re-implemented LLM_OPENAI_SHOW_RESPONSES against httpx
Closes #404
Refs #364
2024-01-26 10:33:03 -08:00
Simon Willison 214fcaaf86 Upgrade to run against OpenAI >= 1.0
* strategy: fail-fast: false - to help see all errors
* Apply latest Black

Refs #325
2024-01-25 22:00:44 -08:00
Simon Willison c679d4d99e llm openai models command, closes #70 2023-07-01 10:39:24 -07:00