Add support for tools and return an output object
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.