Skip to content

Conversation

@vblagoje
Copy link
Member

@vblagoje vblagoje commented Oct 22, 2025

Why:

Adopts Haystack's ToolsType to enable flexible tool composition, developers can now mix individual Tool objects and Toolset instances in a single list

part of:

What:

  • Updated tools parameter from Union[List[Tool], Toolset] to ToolsType in constructor and all methods
  • Haystack dependency to 2.19.0 for ToolsType support
  • Added tests for mixed tool collection initialization and request parameter formatting

How can it be used:

from haystack.tools import Tool, Toolset
from haystack_integrations.components.generators.meta_llama import MetaLlamaChatGenerator

weather_tool = Tool(name="weather", ...)
population_toolset = Toolset([...])

# NEW: Mix Tool and Toolset freely
generator = MetaLlamaChatGenerator(tools=[weather_tool, population_toolset])

How did you test it:

  • Unit tests verify mixed tool initialization and correct API parameter formatting
  • Backward compatibility validated for existing patterns (list of tools, single toolset)
  • Added integration test test_live_run_with_mixed_tools() demonstrates end-to-end LLM tool invocation from mixed collections

Notes for the reviewer:

  • MetaLlamaChatGenerator inherits from OpenAIChatGenerator, so tool handling is delegated to the parent class
  • Fully backward compatible; no migration needed
  • The integration test verifies that the Llama API correctly processes mixed tool collections

@vblagoje vblagoje requested a review from a team as a code owner October 22, 2025 12:11
@vblagoje vblagoje requested review from sjrl and removed request for a team October 22, 2025 12:11
@github-actions github-actions bot added integration:meta-llama type:documentation Improvements or additions to documentation labels Oct 22, 2025
@vblagoje vblagoje marked this pull request as draft October 22, 2025 12:14
sjrl
sjrl previously approved these changes Oct 22, 2025
Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

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

Looks good! (other than failing tests)

@sjrl sjrl dismissed their stale review October 22, 2025 12:16

PR moved back to draft

@vblagoje
Copy link
Member Author

Looks good! (other than failing tests)

Yes, this one really requires attention to see what is going on now

@vblagoje vblagoje marked this pull request as ready for review October 24, 2025 09:03
@vblagoje
Copy link
Member Author

@sjrl figured it out - weaker 17B model although Llama4 series can't handle multiple tool calls properly. Llama-3.3-70B-Instruct does it no problem!

@vblagoje vblagoje requested a review from sjrl October 24, 2025 09:05
Copy link
Contributor

@sjrl sjrl left a comment

Choose a reason for hiding this comment

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

Nice, looks good!

@vblagoje vblagoje merged commit 096f47d into main Oct 24, 2025
11 checks passed
@vblagoje vblagoje deleted the meta_llama-toolstype branch October 24, 2025 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:meta-llama type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants