文件历史

提交图

25 次代码提交

作者 SHA1 备注 提交日期
Simon Willison 0fa7ccf58f Ran Black 2026-04-28 14:42:39 -07:00
Simon Willison b97a6902f5 Persist visible reasoning to logs and render in markdown
Adds a `reasoning` column to the responses table (migration m022)
populated from concatenated visible-reasoning text in the assembled
message. `llm logs --md` renders it under a `## Reasoning` heading
above the response when present.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-28 14:27:22 -07:00
Simon Willison c8889e0a76 Ran black 2026-03-17 11:25:12 -07:00
Simon Willison 301db6d76c responses.resolved_model column and response.set_resolved_model(model_id) method, closes #1117 2025-05-28 07:17:03 -07:00
André Arko fc44fd6a0d llm chat now respects default model options (#985) 2025-05-24 14:24:53 -07:00
Simon Willison deafb7e76a Removed unused fixture 2025-05-24 00:03:27 -07:00
Simon Willison b6f4838b17 Test for fragments in chat, refs #1044, #1048 2025-05-23 23:48:48 -07:00
Dan Turkel 88d3e11c65 Support fragments in chat through -f, --sf, and !fragments (#1048)
* add vscode and uv artifacts to gitignore
* !fragment feature
* Update fragment command to accept multiple fragments
* Add support for multiple fragments in !fragment command, factor out fragment processing
* Add support for fragment/system fragment arguments in chat command
* update docs

---------

Co-authored-by: Simon Willison <swillison@gmail.com>
2025-05-23 23:31:16 -07:00
Simon Willison bd2180df7d llm chat --tool and --functions (#1062)
* Tool support for llm chat, closes #1004
2025-05-20 21:30:27 -07:00
Sukhbinder Singh 8c7d33ee52 Fixes --continue bug and adds --database argument to llm chat
* Fix database bug in continue conversation and adds --database to llm chat
* Move the --database to proper place and update help.

Closes #933
2025-05-04 15:57:13 -07:00
Benedikt Willi 7dcfa31143 Add '!edit' command to modify prompts in chat sessions using default editor (#969)
* Add '!edit' command to modify prompts in chat sessions
2025-05-04 10:19:48 -07:00
Simon Willison 62c90dd472 llm prompt --schema X option and model.prompt(..., schema=) parameter (#777)
Refs #776

* Implemented new llm prompt --schema and model.prompt(schema=)
* Log schema to responses.schema_id and schemas table
* Include schema in llm logs Markdown output
* Test for schema=pydantic_model
* Initial --schema CLI documentation
* Python docs for schema=
* Advanced plugin docs on schemas
2025-02-26 16:58:28 -08:00
Simon Willison f9af563df5 response.on_done() mechanism, closes #653 2024-12-01 15:47:23 -08:00
Simon Willison 8a7b0c4f5d response.usage() and await aresponse.usage(), closes #644 2024-11-19 21:25:37 -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 ba75c674cb llm.get_async_model(), llm.AsyncModel base class and OpenAI async models (#613)
- https://github.com/simonw/llm/issues/507#issuecomment-2458639308

* register_model is now async aware

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458658134

* Refactor Chat and AsyncChat to use _Shared base class

Refs https://github.com/simonw/llm/issues/507#issuecomment-2458692338

* fixed function name

* Fix for infinite loop

* Applied Black

* Ran cog

* Applied Black

* Add Response.from_row() classmethod back again

It does not matter that this is a blocking call, since it is a classmethod

* Made mypy happy with llm/models.py

* mypy fixes for openai_models.py

I am unhappy with this, had to duplicate some code.

* First test for AsyncModel

* Still have not quite got this working

* Fix for not loading plugins during tests, refs #626

* audio/wav not audio/wave, refs #603

* Black and mypy and ruff all happy

* Refactor to avoid generics

* Removed obsolete response() method

* Support text = await async_mock_model.prompt("hello")

* Initial docs for llm.get_async_model() and await model.prompt()

Refs #507

* Initial async model plugin creation docs

* duration_ms ANY to pass test

* llm models --async option

Refs https://github.com/simonw/llm/pull/613#issuecomment-2474724406

* Removed obsolete TypeVars

* Expanded register_models() docs for async

* await model.prompt() now returns AsyncResponse

Refs https://github.com/simonw/llm/pull/613#issuecomment-2475157822

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-11-13 17:51:00 -08:00
Simon Willison 286cf9fcd9 attachments= keyword argument, tests pass again - refs #587 2024-10-28 15:41:34 -07:00
Simon Willison 8021e12aaa Windows readline fix, plus run CI against macOS and Windows
Test / test (macos-latest, >=2.0.0, 3.10) (push) Has been cancelled
Test / test (macos-latest, ==1.10.2, 3.9) (push) Has been cancelled
Test / test (macos-latest, >=2.0.0, 3.11) (push) Has been cancelled
Test / test (macos-latest, >=2.0.0, 3.12) (push) Has been cancelled
Test / test (macos-latest, >=2.0.0, 3.8) (push) Has been cancelled
Test / test (macos-latest, >=2.0.0, 3.9) (push) Has been cancelled
Test / test (ubuntu-latest, ==1.10.2, 3.10) (push) Has been cancelled
Test / test (ubuntu-latest, ==1.10.2, 3.11) (push) Has been cancelled
Test / test (ubuntu-latest, ==1.10.2, 3.12) (push) Has been cancelled
Test / test (ubuntu-latest, ==1.10.2, 3.8) (push) Has been cancelled
Test / test (ubuntu-latest, ==1.10.2, 3.9) (push) Has been cancelled
Test / test (ubuntu-latest, >=2.0.0, 3.10) (push) Has been cancelled
Test / test (ubuntu-latest, >=2.0.0, 3.11) (push) Has been cancelled
Test / test (ubuntu-latest, >=2.0.0, 3.12) (push) Has been cancelled
Test / test (ubuntu-latest, >=2.0.0, 3.8) (push) Has been cancelled
Test / test (ubuntu-latest, >=2.0.0, 3.9) (push) Has been cancelled
Test / test (macos-latest, ==1.10.2, 3.10) (push) Has been cancelled
Test / test (macos-latest, ==1.10.2, 3.11) (push) Has been cancelled
Test / test (macos-latest, ==1.10.2, 3.12) (push) Has been cancelled
Test / test (macos-latest, ==1.10.2, 3.8) (push) Has been cancelled
Test / test (windows-latest, ==1.10.2, 3.10) (push) Has been cancelled
Test / test (windows-latest, ==1.10.2, 3.11) (push) Has been cancelled
Test / test (windows-latest, ==1.10.2, 3.12) (push) Has been cancelled
Test / test (windows-latest, ==1.10.2, 3.8) (push) Has been cancelled
Test / test (windows-latest, ==1.10.2, 3.9) (push) Has been cancelled
Test / test (windows-latest, >=2.0.0, 3.10) (push) Has been cancelled
Test / test (windows-latest, >=2.0.0, 3.11) (push) Has been cancelled
Test / test (windows-latest, >=2.0.0, 3.12) (push) Has been cancelled
Test / test (windows-latest, >=2.0.0, 3.8) (push) Has been cancelled
Test / test (windows-latest, >=2.0.0, 3.9) (push) Has been cancelled
* Run CI on Windows and macOS as well as Ubuntu, refs #407
* Use pyreadline3 on win32
* Back to fail-fast since we have a bigger matrix now
* Mark some tests as xfail on windows
2024-01-26 16:24:58 -08:00
Simon Willison 9e529bb36a Wrap !multi in single quotes, for consistency with exit/quit 2023-09-12 10:45:02 -07:00
Simon Willison f54f2c659d response.__str__ method, closes #268 2023-09-12 10:36:29 -07:00
Simon Willison 9c33d30843 llm chat !multi support, closes #267 2023-09-12 09:31:20 -07:00
Simon Willison ae7f4f6de7 llm chat -o/--option - refs #244 2023-09-10 11:14:28 -07:00
Simon Willison 8de6783dcc llm chat test system prompt 2023-09-04 23:36:25 -07:00
Simon Willison c14959571e llm chat test continue conversation 2023-09-04 23:36:25 -07:00
Simon Willison 5495112d9f Initial tests for llm chat, refs #231 2023-09-04 23:36:25 -07:00