Coverage for haystack/tools/tool_types.py: 100%
5 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-21 13:53 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-21 13:53 +0000
1# SPDX-FileCopyrightText: 2022-present deepset GmbH <info@deepset.ai>
2#
3# SPDX-License-Identifier: Apache-2.0
5from collections.abc import Sequence
7from haystack.tools.tool import Tool
8from haystack.tools.toolset import Toolset
10# Type alias for tools parameter - allows mixing Tools and Toolsets in a sequence
11# Accepts either:
12# - Sequence[Tool | Toolset]: Any sequence (list, tuple, etc.) containing Tools, Toolsets, or a mix of both
13# - Toolset: A single Toolset (not in a sequence)
14ToolsType = Sequence[Tool | Toolset] | Toolset
16# `ToolsType` is this module's only public name; `__all__` keeps the imports above (Tool, Toolset, Sequence) from
17# leaking as exports on `import *`.
18__all__ = ["ToolsType"]