| 1 |
from typing import Dict, Union, Optional |
| 2 |
from typing_extensions import Literal, Annotated, TypeAlias |
| 3 |
|
| 4 |
from .._models import BaseModel, UnionDiscriminator |
| 5 |
from .direct_caller import DirectCaller |
| 6 |
from .server_tool_caller import ServerToolCaller |
| 7 |
from .server_tool_caller_20260120 import ServerToolCaller20260120 |
| 8 |
|
| 9 |
__all__ = ["ToolUseBlock", "Caller"] |
| 10 |
|
| 11 |
Caller: TypeAlias = Annotated[ |
| 12 |
Union[DirectCaller, ServerToolCaller, ServerToolCaller20260120], UnionDiscriminator("type") |
| 13 |
] |
| 14 |
|
| 15 |
|
| 16 |
class ToolUseBlock(BaseModel): |
| 17 |
id: str |
| 18 |
|
| 19 |
caller: Optional[Caller] = None |
| 20 |
|
| 21 |
input: Dict[str, object] |
| 22 |
|
| 23 |
name: str |
| 24 |
|
| 25 |
type: Literal["tool_use"] |
| 26 |
|
| 27 |
toolset_name: Optional[str] = None |
| 28 |
"""For a toolset member tool_use, the toolset family.""" |