Skip to content

Commit 11fe1aa

Browse files
committed
Export EffortLevel TypeAlias and use it in types (fixes #938)\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 694e4f3 commit 11fe1aa

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

src/claude_agent_sdk/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,8 @@
142142
ToolUseBlock,
143143
UserMessage,
144144
UserPromptSubmitHookInput,
145-
)
145+
146+
EffortLevel,)
146147

147148
# MCP Server Support
148149

src/claude_agent_sdk/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
SettingSource = Literal["user", "project", "local"]
3333

3434

35+
EffortLevel: TypeAlias = EffortLevel
36+
3537
class SystemPromptPreset(TypedDict):
3638
"""System prompt preset configuration."""
3739

@@ -96,7 +98,7 @@ class AgentDefinition:
9698
initialPrompt: str | None = None # noqa: N815
9799
maxTurns: int | None = None # noqa: N815
98100
background: bool | None = None
99-
effort: Literal["low", "medium", "high", "xhigh", "max"] | int | None = None
101+
effort: EffortLevel | int | None = None
100102
permissionMode: PermissionMode | None = None # noqa: N815
101103

102104

@@ -1864,7 +1866,7 @@ class ClaudeAgentOptions:
18641866
See https://docs.anthropic.com/en/docs/build-with-claude/adaptive-thinking.
18651867
"""
18661868

1867-
effort: Literal["low", "medium", "high", "xhigh", "max"] | None = None
1869+
effort: EffortLevel | None = None
18681870
"""Controls how much effort Claude puts into its response.
18691871
18701872
Works with adaptive thinking to guide thinking depth.

0 commit comments

Comments
 (0)