Commit graph

962 commits

Author SHA1 Message Date
Simon Willison
921fae9a0a Release 0.27.1
Refs #1237, #1238, #1239. #1240
2025-08-11 22:14:55 -07:00
Simon Willison
c41c122239 Use tools in templates with llm chat, closes #1239 2025-08-11 22:11:17 -07:00
Simon Willison
2f206d0e26 Fix for duplicated prompts in llm chat with templates, closes #1240
Also includes a bug fix for system fragments, see https://github.com/simonw/llm/issues/1240#issuecomment-3177684518
2025-08-11 21:52:54 -07:00
Simon Willison
c6e158071a Ran black 2025-08-11 21:47:11 -07:00
Simon Willison
e6ac18fbcb Fix for confusing error, closes #1238 2025-08-11 16:52:16 -07:00
Simon Willison
9f1417f6e8 Fix for enum options and --save, refs #1237 2025-08-11 16:16:27 -07:00
Simon Willison
e15e1ad717 Credit James Sanford in changelog, refs #1218, #1232 2025-08-11 14:29:35 -07:00
Simon Willison
e4c1a46d90 Fix test failure caused by version bump, refs #1218 2025-08-11 14:27:16 -07:00
James Sanford
2a54939951
Fix streaming tool calls with tests for many variants. (#1218)
* Recorded instance of streaming tool response variant "a".

This is the typical response, where "arguments":"" arrives
first in the stream, followed by "arguments":"{}"

The response data is a real capture from the OpenRouter API,
however some request and header data may be from other test fixtures.

* Recorded instance of streaming tool response variant "b".

This is a streaming response where the first arguments
you get is a fully formed "arguments":"{}"

The response data is a real capture from the OpenRouter API,
however some request and header data may be from other test fixtures.

* Test cases for streaming tool responses.

Note that the replays are marked as "read-only", as they are variants
seen in the wild where the streaming tool call argument fragments
arrive in a specific order.

* Fix streaming tool response variant "b", where "arguments":"{}" is what arrives first.

The previous code erroneously caused the first "arguments" to be duplicated,
by using "+=" even when being initially set.

This went unnoticed as many models stream "arguments":"" first.

When a more fully formed "arguments" fragment arrived first, it was causing
"Error: Extra data: line 1 column 3 (char 2)"

* Recorded instance of streaming tool response variant "c".

This was failing with "Error: unsupported operand type(s) for +=: 'NoneType' and 'str'"

The response data is a real capture from the OpenRouter API,
however some request and header data may be from other test fixtures.

* Test case for streaming tool response variant "c".

* Fix streaming tool response variant "c".

However, I'm not sure why arguments was initially not present or seen as None.
2025-08-11 14:17:52 -07:00
Simon Willison
4292fe9d21 Relase 0.27
Refs #1009, #1014, #1049, #1053, #1088, #1104, #1110, #1111, #1114, #1117, #1134, #1137, #1148, #1150, #1177, #1228, #1229, #1232
2025-08-11 13:55:05 -07:00
Simon Willison
5204a11f33 Allow -o option when calling tools, closes #1233 2025-08-11 13:44:26 -07:00
Simon Willison
cbd3aab511 GPT-5 model IDs, refs #1229 2025-08-11 13:23:36 -07:00
Simon Willison
08094082f2
Toolbox.add_tool(), prepare() and prepare_async() methods
Closes #1111
2025-08-11 13:19:31 -07:00
Simon Willison
ef3192b44d
Better docs for OpenAI model options
!stable-docs

Closes #1228
2025-08-03 15:31:25 -07:00
Simon Willison
0bf655a1fe Cog against README 2025-06-20 10:11:57 -07:00
Simon Willison
24f32fe7b4
Grant models the ability to execute tools 2025-06-19 13:21:03 -07:00
Simon Willison
0863ed460e llm logs -l/--latest -q option, closes #1177 2025-06-17 23:23:45 -07:00
Simon Willison
544ce17c1d Tests to confirm responses FTS triggers
Refs https://github.com/simonw/llm/issues/1177#issuecomment-2982832935
2025-06-17 23:18:22 -07:00
Simon Willison
2292d7a56d
No need for a venv in Codex 2025-06-03 15:57:59 -07:00
Simon Willison
ac0506e15b
AGENTS.md file for Codex 2025-06-03 15:52:09 -07:00
Simon Willison
12b6ea6977
Fix grammar in attachments docs 2025-06-03 15:48:07 -07:00
Simon Willison
3a96d52895 Better handling of before_call cancellation, closes #1148 2025-06-01 18:36:55 -07:00
Simon Willison
d96ae4ed8d Fix --async logging to database, closes #1150 2025-06-01 17:38:26 -07:00
Simon Willison
65dde782b7 Fix mypy warning, closes #1146 2025-06-01 17:03:44 -07:00
Simon Willison
30e0c4abe8
ToolResult.exception for tool errors, now logged to DB
Closes #1104
2025-06-01 17:01:40 -07:00
Simon Willison
e6dcd414a5
note about async before_call/after_call 2025-06-01 12:36:28 -07:00
Sukhbinder Singh
f5a38d3342 Add -h shortcut for --help
Closes #983, #1134
2025-06-01 12:31:02 -07:00
Joe Freeman
94c62f45b1
Fix type of tools argument (#1144)
* Fix type of 'tools'
2025-06-01 12:06:20 -07:00
Simon Willison
ed64fc3362
chain_limit/before_call/after_call for conversations
* chain_limit/before_call/after_call for conversations, closes #1088
* Docs for before_call/after_call including for model.conversation
2025-06-01 12:00:29 -07:00
Simon Willison
b5d1c5ee90
Tools can now return attachments
Closes #1014

- llm.ToolOutput(output='...', attachments=[...]) for tools to return attachments
- New table: `tool_results_attachments`
- Table is populated when tools return attachments
- llm --tools-debug shows attachments returned by tools
- llm logs shows attachments returned by tools
2025-06-01 10:08:36 -07:00
Simon Willison
f74e242442
Clarifying comment 2025-06-01 09:16:37 -07:00
Simon Willison
fd2f0ffbcd Better error on llm templates show, closes #1053 2025-05-31 17:26:07 -07:00
Simon Willison
330a568683 Raise error if a non-Toolbox subclass is passed to register(), closes #1114 2025-05-30 21:37:41 -07:00
Simon Willison
a3a2996fed
Tools in templates (#1138)
Closes #1009
2025-05-30 17:44:52 -07:00
Simon Willison
796e8952e8
Deploy advanced-model-plugins.md
!stable-docs

Refs #1137
2025-05-29 22:27:48 -07:00
Simon Willison
a2063e913f
Try pip install . in ReadTheDocs
Refs #1137
2025-05-29 22:24:54 -07:00
Simon Willison
2fd6c09db1 More labels in docs 2025-05-28 08:02:32 -07:00
Simon Willison
f2cf81e29a Move LLM_RAISE_ERRORS to advanced model plugins, closes #1121 2025-05-28 08:02:25 -07:00
Simon Willison
b858b0083e set_resolved_model() for async models, closes #1117 2025-05-28 07:39:57 -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
Simon Willison
afb170a62a
llm-fragments-reader
!stable-docs
2025-05-27 20:11:11 -07:00
Dan Turkel
64f78e3867
add four new plugins to directory (#1115) 2025-05-27 20:06:46 -07:00
Dan Turkel
cbe304a6ea
document register_embedding_models hook (#1049)
* document register_embedding_models hook
2025-05-27 20:00:58 -07:00
Simon Willison
045d00ed98
Bump copyright year in docs 2025-05-27 19:46:40 -07:00
Simon Willison
fed9573629 Tools section in plugin directory
!stable-docs

Closes #1110
2025-05-27 14:20:05 -07:00
Simon Willison
c6b2f2681a Release 0.26
Refs #1000, #1089, #1094, #1096, #1097, #1099, #1103, #1066
2025-05-27 13:32:59 -07:00
Simon Willison
eddcf480e3 Show tool_instances on logging.md, refs #1089 2025-05-27 13:28:46 -07:00
Simon Willison
6bab712cdd Fix for module 'builtins' has no attribute 'instance_id, closes #1107 2025-05-27 13:13:28 -07:00
Simon Willison
fe7a1f0ee7 Tweaked header 2025-05-27 13:06:12 -07:00
Simon Willison
dbb02d65b9 Fix for llm_time plugin test 2025-05-27 10:26:08 -07:00