Skip to content

Conversation

RobinPicard
Copy link
Contributor

@RobinPicard RobinPicard commented Aug 22, 2025

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 RobinPicard force-pushed the add_tools_support branch 2 times, most recently from 204406e to 455b26d Compare September 11, 2025 14:20
@RobinPicard RobinPicard marked this pull request as ready for review September 11, 2025 15:04
@RobinPicard RobinPicard changed the title Draft add support for tools Add support for tools and return an output object Sep 11, 2025
@RobinPicard RobinPicard requested a review from rlouf September 12, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants