-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathgroups.py
More file actions
50 lines (41 loc) · 1.41 KB
/
groups.py
File metadata and controls
50 lines (41 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
"""
From https://github.com/anthropics/anthropic-quickstarts/blob/main/computer-use-demo/computer_use_demo/tools/groups.py
"""
from dataclasses import dataclass
from typing import Literal
from .base import BaseAnthropicTool
from .computer import ComputerTool20241022, ComputerTool20250124, ComputerTool20251124
ToolVersion = Literal[
"computer_use_20250124", "computer_use_20241022", "computer_use_20250429", "computer_use_20251124"
]
BetaFlag = Literal[
"computer-use-2024-10-22", "computer-use-2025-01-24", "computer-use-2025-04-29", "computer-use-2025-11-24"
]
@dataclass(frozen=True, kw_only=True)
class ToolGroup:
version: ToolVersion
tools: list[type[BaseAnthropicTool]]
beta_flag: BetaFlag | None = None
TOOL_GROUPS: list[ToolGroup] = [
ToolGroup(
version="computer_use_20241022",
tools=[ComputerTool20241022],
beta_flag="computer-use-2024-10-22",
),
ToolGroup(
version="computer_use_20250124",
tools=[ComputerTool20250124],
beta_flag="computer-use-2025-01-24",
),
ToolGroup(
version="computer_use_20251124",
tools=[ComputerTool20251124],
beta_flag="computer-use-2025-11-24",
),
ToolGroup(
version="computer_use_20250429",
tools=[ComputerTool20250124],
beta_flag="computer-use-2025-01-24",
),
]
TOOL_GROUPS_BY_VERSION = {tool_group.version: tool_group for tool_group in TOOL_GROUPS}