Skip to content

Added tools to TextGenerationPipeline#1655

Open
nico-martin wants to merge 4 commits intomainfrom
fix/tools-in-text-generation-pipeline
Open

Added tools to TextGenerationPipeline#1655
nico-martin wants to merge 4 commits intomainfrom
fix/tools-in-text-generation-pipeline

Conversation

@nico-martin
Copy link
Copy Markdown
Collaborator

pipe(messages, { tools, ... }) is now supported directly in text-generation to align with @huggingface/transfomers:
https://github.com/huggingface/transformers/blob/main/src/transformers/pipelines/text_generation.py#L143

Top-level chat-template args are now handled in the pipeline:

  • tools
  • documents
  • chat_template
  • add_generation_prompt
  • tokenizer_encode_kwargs still works and has precedence if both are provided

@nico-martin nico-martin requested a review from xenova April 17, 2026 13:51
@HuggingFaceDocBuilderDev
Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Copy Markdown
Collaborator

@xenova xenova left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! can you include sample code of how this also works with the python pipeline API?

Comment thread packages/transformers/src/pipelines/text-generation.js Outdated
Comment thread packages/transformers/src/pipelines/text-generation.js Outdated
Comment thread packages/transformers/src/pipelines/text-generation.js Outdated
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.

3 participants