文件历史

139 次代码提交

作者 SHA1 备注 提交日期
Simon Willison 946e433698 More docstrings and autoclass embeds in docs 2026-03-31 13:12:32 -07:00
Simon Willison 1562a8f444 Added some more autoclass docs, with new doctrings 2026-03-31 12:54:00 -07:00
Eric Bloch f7934c5c26 Fix some descriptor leaks (#1313)
Refs #1312
2025-12-11 14:20:58 -08:00
Giuseppe Rota 618463de13 fix: register fragment source in chat command (#1316)
* Register fragment source in chat command
2025-12-11 13:54:32 -08:00
Simon Willison c7abd58000 Fix for asyncio.iscoroutinefunction warning 2025-11-14 15:49:18 -08:00
Simon Willison 08094082f2 Toolbox.add_tool(), prepare() and prepare_async() methods
Closes #1111
2025-08-11 13:19:31 -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 30e0c4abe8 ToolResult.exception for tool errors, now logged to DB
Closes #1104
2025-06-01 17:01:40 -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 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 6bab712cdd Fix for module 'builtins' has no attribute 'instance_id, closes #1107 2025-05-27 13:13:28 -07:00
Simon Willison 9e25055765 Turn incorrect tool names into errors, closes #1104 2025-05-27 09:29:05 -07:00
Simon Willison e4ecb86421 Log tool_instances to database (#1098)
* Log tool_instances to database, closes #1089
* Tested for both sync and async models
2025-05-26 21:01:55 -07:00
Simon Willison 1dc7a1d1f9 Monotonic ULIDs, refs #1099 2025-05-26 19:49:42 -07:00
Simon Willison a87e4505ff Remove obsolete details: mechanism from ChainResults, closes #1087 2025-05-25 22:43:45 -07:00
Simon Willison bb336d33a0 Toolbox class for class-based tool collections (#1086)
* Toolbox class for class-based tool collections

Refs #1059, #1058, #1057
2025-05-25 22:42:52 -07:00
Arjan Mossel 5d6f96a908 Provide response_json type hint (#1077) 2025-05-24 13:46:36 -07:00
Simon Willison 36477cf9e5 llm chat -c and llm -c carry forward tools, closes #1020 2025-05-23 21:10:51 -07:00
Simon Willison d2886d4692 Record which plugin a tool came from, including in DB - refs #1020 2025-05-23 15:44:12 -07:00
Simon Willison 3e3492898c Conversations using tools in Python API
Refs #1033
2025-05-21 23:05:16 -07:00
Simon Willison e172e9e52d Clean up one more comment 2025-05-21 21:42:46 -07:00
Simon Willison 3cb875fa3d Async tool support (#1063)
* Sync models can now call async tools, refs #987
* Test for async tool functions in sync context, refs #987
* Test for asyncio tools, plus test that they run in parallel
* Docs for async tool usage
2025-05-21 21:42:19 -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
Simon Willison 2df619e7d8 --chain-limit option, closes #1025 2025-05-13 21:52:39 -04:00
Simon Willison c81f0560e0 Fixed remaining mypy problems, refs #1023
Refs https://github.com/simonw/llm/pull/996#issuecomment-2878191352
2025-05-13 17:19:30 -07:00
Simon Willison 96f910bb30 Fix for TypeError: 'coroutine' object is not iterable 2025-05-13 17:19:30 -07:00
Simon Willison a029e0b70c AsyncModel.chain() raises NotImplementedError, closes #1021 2025-05-13 17:19:30 -07:00
Simon Willison 5ae20bd549 Guard against chunk=None from models
Bug that I encountered while working on #1019
2025-05-13 17:19:30 -07:00
Simon Willison 1efb14f294 Upgrade condense-json
Refs https://github.com/simonw/llm/issues/1003#issuecomment-2873322525
Refs https://github.com/simonw/condense-json/issues/5
2025-05-13 17:19:30 -07:00
Simon Willison a50de8b57a ChainResponse.log_to_db() method and test, refs #1017, #1003 2025-05-13 17:19:30 -07:00
Simon Willison 5162cabbe1 First test for tools, plus vcr+syrupy, refs #1017 2025-05-13 17:19:30 -07:00
Simon Willison 9650c5de10 Removed obsolete details() method, closes #1007 2025-05-13 17:19:30 -07:00
Simon Willison e319069503 Initial implementation of --td and --ta, refs #1005
Uses new mechanism from #1007
2025-05-13 17:19:30 -07:00
Simon Willison ea4df34563 New response.excute_tool_calls(), refs #1007 2025-05-13 17:19:30 -07:00
Simon Willison 387f89d88b Load tool stuff from database, refs #1010 2025-05-13 17:19:30 -07:00
Simon Willison db642d3013 Ensure all responses have a ULID 2025-05-13 17:19:30 -07:00
Simon Willison f994196b32 tool_calls_or_raise()
Refs #992, #998, #999
2025-05-13 17:19:30 -07:00
Simon Willison 32cab986ea Log tool stuff to the database, refs #1003 2025-05-13 17:19:30 -07:00
Simon Willison 4ae6d45f3a First working prototype of llm -T toolname
Refs https://github.com/simonw/llm/issues/990#issuecomment-2870630946
2025-05-13 17:19:30 -07:00
Simon Willison 8a3c461e46 model.chain() method, tools=[func1, func2]
Also fixed mypy errors, but had to drop AsyncResponse for the moment.

Refs https://github.com/simonw/llm/issues/937#issuecomment-2870479021
2025-05-13 17:19:30 -07:00
Simon Willison 619daa6ff2 .chain().details() debug method
https://github.com/simonw/llm/issues/937#issuecomment-2870465951
2025-05-13 17:19:30 -07:00
Simon Willison 7dbf0b8586 Got a tool call to run through OpenAI
Refs https://github.com/simonw/llm/issues/937#issuecomment-2870434157
2025-05-13 17:19:30 -07:00
Simon Willison c0ef4f4da1 Enforce chain limit of 5
Refs https://github.com/simonw/llm/issues/937#issuecomment-2870390330
2025-05-13 17:19:30 -07:00
Simon Willison 3b37854c26 Initial Conversation.chain() and ChainResponse
Refs https://github.com/simonw/llm/issues/937#issuecomment-2870365809
2025-05-13 17:19:30 -07:00
Simon Willison c990578934 ToolCall.tool_call_id property, refs #937 2025-05-13 17:19:30 -07:00