outlines icon indicating copy to clipboard operation
outlines copied to clipboard

Add support for tools and return an output object

Open RobinPicard opened this issue 4 months ago • 0 comments

The idea is that for the tools definition, the user could provide a list of either of those:

  • callables
  • dicts containing tool definitions
  • Pydantic model

The tools argument would be provided in the same places as the output_type. In the generator, there is a step to turn the user tools input into a list of dicts (a bit similar to how we are compiling the output_type for steerable models).

Then, each model's type adapter would have a format_tools method that would turn this standardized tool dict definition into the argument expected by the model.

Each model, upon receiving a response for the text generation, would then return an Output object (distinguishing between regular responses and tool calls).

This Output instance returned by the model could then be used as a message in a Chat input.

Something yet to be figured out is how we handle streaming.

RobinPicard avatar Aug 22 '25 13:08 RobinPicard