llm icon indicating copy to clipboard operation
llm copied to clipboard

Full documentation for tools

Open simonw opened this issue 6 months ago • 4 comments

Lots of stuff to document! New tools.md top level page.

Preview: https://github.com/simonw/llm/blob/tools/docs/tools.md

TODO:

  • [x] Document register_tools() plugin hook
  • [x] Basic explanation of what tools are and how they work in LLM
  • [x] Python API for registering tools with a prompt (function and llm.Tool) - including note on how async works
  • [ ] How to use tools with llm -T x r llm --tool X (link this from the usage page too)
  • [x] Docs and example of --python-tools usage for the CLI
  • [ ] Also mention llm tools and llm tools --python-tools debug mechanism
  • [x] Python API for running a prompt with tools via the .chain() method
  • [ ] The debugging hooks before_call and after_call
  • [x] #1000
  • [ ] Short tutorial on using https://github.com/simonw/llm-plugin-tools cookiecutter template

simonw avatar May 12 '25 03:05 simonw

I find myself referring to the new dataclasses so often that I think they should be transposed into the documentation.

simonw avatar May 12 '25 18:05 simonw

In the workshop a question came up about tools with more complex signatures. The answer is that you can define llm.Tool with as complex an input schema as you like, but it's not documented yet.

I'd forgotten you can use a Pydantic model for that too:

https://github.com/simonw/llm/blob/2df619e7d8bf1ad562e521a4d05b659e0b536381/llm/models.py#L109-L118

That needs to be documented, with an example, and a supporting test.

simonw avatar May 15 '25 02:05 simonw

A tutorial showing how to use the cookiecutter template would be great: https://github.com/simonw/llm-plugin-tools

simonw avatar May 17 '25 13:05 simonw

Usage documentation for toolboxes from Python API is here: https://llm.datasette.io/en/latest/python-api.html#toolbox-classes

simonw avatar May 26 '25 17:05 simonw

I'm happy with this now.

simonw avatar Jun 02 '25 01:06 simonw