mirror of
https://github.com/anthropics/claude-quickstarts.git
synced 2026-12-02 10:49:23 +08:00
19 lines
508 B
Python
19 lines
508 B
Python
"""Code execution server tool for the agent framework."""
|
|
|
|
from dataclasses import dataclass
|
|
from typing import Any
|
|
|
|
|
|
@dataclass
|
|
class CodeExecutionServerTool:
|
|
"""Code execution server tool that uses Anthropic's server tool format."""
|
|
|
|
name: str = "code_execution"
|
|
type: str = "code_execution_20250522"
|
|
|
|
def to_dict(self) -> dict[str, Any]:
|
|
"""Convert to Anthropic server tool format."""
|
|
return {
|
|
"type": self.type,
|
|
"name": self.name,
|
|
} |