Class: ClaudeAgentSDK::ClaudeAgentOptions
- Defined in:
- lib/claude_agent_sdk/types.rb
Overview
Claude Agent Options for configuring queries
Instance Attribute Summary collapse
-
#add_dirs ⇒ Object
Returns the value of attribute add_dirs.
-
#agents ⇒ Object
Returns the value of attribute agents.
-
#allowed_tools ⇒ Object
Returns the value of attribute allowed_tools.
-
#append_allowed_tools ⇒ Object
Returns the value of attribute append_allowed_tools.
-
#bare ⇒ Object
Returns the value of attribute bare.
-
#betas ⇒ Object
Returns the value of attribute betas.
-
#can_use_tool ⇒ Object
Returns the value of attribute can_use_tool.
-
#cli_path ⇒ Object
Returns the value of attribute cli_path.
-
#continue_conversation ⇒ Object
Returns the value of attribute continue_conversation.
-
#cwd ⇒ Object
Returns the value of attribute cwd.
-
#debug_stderr ⇒ Object
Returns the value of attribute debug_stderr.
-
#disallowed_tools ⇒ Object
Returns the value of attribute disallowed_tools.
-
#effort ⇒ Object
Returns the value of attribute effort.
-
#enable_file_checkpointing ⇒ Object
Returns the value of attribute enable_file_checkpointing.
-
#env ⇒ Object
Returns the value of attribute env.
-
#extra_args ⇒ Object
Returns the value of attribute extra_args.
-
#fallback_model ⇒ Object
Returns the value of attribute fallback_model.
-
#fork_session ⇒ Object
Returns the value of attribute fork_session.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#include_hook_events ⇒ Object
Returns the value of attribute include_hook_events.
-
#include_partial_messages ⇒ Object
Returns the value of attribute include_partial_messages.
-
#load_timeout_ms ⇒ Object
Returns the value of attribute load_timeout_ms.
-
#max_budget_usd ⇒ Object
Returns the value of attribute max_budget_usd.
-
#max_buffer_size ⇒ Object
Returns the value of attribute max_buffer_size.
-
#max_thinking_tokens ⇒ Object
Returns the value of attribute max_thinking_tokens.
-
#max_turns ⇒ Object
Returns the value of attribute max_turns.
-
#mcp_servers ⇒ Object
Returns the value of attribute mcp_servers.
-
#model ⇒ Object
Returns the value of attribute model.
-
#observers ⇒ Object
Returns the value of attribute observers.
-
#output_format ⇒ Object
Returns the value of attribute output_format.
-
#permission_mode ⇒ Object
Returns the value of attribute permission_mode.
-
#permission_prompt_tool_name ⇒ Object
Returns the value of attribute permission_prompt_tool_name.
-
#plugins ⇒ Object
Returns the value of attribute plugins.
-
#resume ⇒ Object
Returns the value of attribute resume.
-
#resume_session_at ⇒ Object
Returns the value of attribute resume_session_at.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#session_store ⇒ Object
Returns the value of attribute session_store.
-
#session_store_flush ⇒ Object
Returns the value of attribute session_store_flush.
-
#setting_sources ⇒ Object
Returns the value of attribute setting_sources.
-
#settings ⇒ Object
Returns the value of attribute settings.
-
#stderr ⇒ Object
Returns the value of attribute stderr.
-
#strict_mcp_config ⇒ Object
Returns the value of attribute strict_mcp_config.
-
#system_prompt ⇒ Object
Returns the value of attribute system_prompt.
-
#task_budget ⇒ Object
Returns the value of attribute task_budget.
-
#thinking ⇒ Object
Returns the value of attribute thinking.
-
#tools ⇒ Object
Returns the value of attribute tools.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #bare? ⇒ Boolean
- #continue_conversation? ⇒ Boolean
- #dup_with(**changes) ⇒ Object
- #enable_file_checkpointing? ⇒ Boolean
- #fork_session? ⇒ Boolean
- #include_hook_events? ⇒ Boolean
- #include_partial_messages? ⇒ Boolean
-
#initialize(attributes = {}) ⇒ ClaudeAgentOptions
constructor
A new instance of ClaudeAgentOptions.
- #strict_mcp_config? ⇒ Boolean
Methods inherited from Type
#[], #[]=, from_hash, #to_h, wrap
Constructor Details
#initialize(attributes = {}) ⇒ ClaudeAgentOptions
Returns a new instance of ClaudeAgentOptions.
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 |
# File 'lib/claude_agent_sdk/types.rb', line 1493 def initialize(attributes = {}) self.fork_session = false self.continue_conversation = false self. = false self.enable_file_checkpointing = false self.include_hook_events = false self.strict_mcp_config = false super(merge_with_defaults(attributes || {})) # Non-nil defaults for options that need them. self.env ||= {} self.extra_args ||= {} self.mcp_servers ||= {} self.add_dirs ||= [] self.observers ||= [] self.allowed_tools ||= [] self.disallowed_tools ||= [] self.session_store_flush ||= 'batched' # 0 is a valid (immediate) timeout, so only fill in the default for nil. self.load_timeout_ms = 60_000 if load_timeout_ms.nil? end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ClaudeAgentSDK::Type
Instance Attribute Details
#add_dirs ⇒ Object
Returns the value of attribute add_dirs.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def add_dirs @add_dirs end |
#agents ⇒ Object
Returns the value of attribute agents.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def agents @agents end |
#allowed_tools ⇒ Object
Returns the value of attribute allowed_tools.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def allowed_tools @allowed_tools end |
#append_allowed_tools ⇒ Object
Returns the value of attribute append_allowed_tools.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def append_allowed_tools @append_allowed_tools end |
#bare ⇒ Object
Returns the value of attribute bare.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def @bare end |
#betas ⇒ Object
Returns the value of attribute betas.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def betas @betas end |
#can_use_tool ⇒ Object
Returns the value of attribute can_use_tool.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def can_use_tool @can_use_tool end |
#cli_path ⇒ Object
Returns the value of attribute cli_path.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def cli_path @cli_path end |
#continue_conversation ⇒ Object
Returns the value of attribute continue_conversation.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def continue_conversation @continue_conversation end |
#cwd ⇒ Object
Returns the value of attribute cwd.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def cwd @cwd end |
#debug_stderr ⇒ Object
Returns the value of attribute debug_stderr.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def debug_stderr @debug_stderr end |
#disallowed_tools ⇒ Object
Returns the value of attribute disallowed_tools.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def disallowed_tools @disallowed_tools end |
#effort ⇒ Object
Returns the value of attribute effort.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def effort @effort end |
#enable_file_checkpointing ⇒ Object
Returns the value of attribute enable_file_checkpointing.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def enable_file_checkpointing @enable_file_checkpointing end |
#env ⇒ Object
Returns the value of attribute env.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def env @env end |
#extra_args ⇒ Object
Returns the value of attribute extra_args.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def extra_args @extra_args end |
#fallback_model ⇒ Object
Returns the value of attribute fallback_model.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def fallback_model @fallback_model end |
#fork_session ⇒ Object
Returns the value of attribute fork_session.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def fork_session @fork_session end |
#hooks ⇒ Object
Returns the value of attribute hooks.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def hooks @hooks end |
#include_hook_events ⇒ Object
Returns the value of attribute include_hook_events.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def include_hook_events @include_hook_events end |
#include_partial_messages ⇒ Object
Returns the value of attribute include_partial_messages.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def @include_partial_messages end |
#load_timeout_ms ⇒ Object
Returns the value of attribute load_timeout_ms.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def load_timeout_ms @load_timeout_ms end |
#max_budget_usd ⇒ Object
Returns the value of attribute max_budget_usd.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def max_budget_usd @max_budget_usd end |
#max_buffer_size ⇒ Object
Returns the value of attribute max_buffer_size.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def max_buffer_size @max_buffer_size end |
#max_thinking_tokens ⇒ Object
Returns the value of attribute max_thinking_tokens.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def max_thinking_tokens @max_thinking_tokens end |
#max_turns ⇒ Object
Returns the value of attribute max_turns.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def max_turns @max_turns end |
#mcp_servers ⇒ Object
Returns the value of attribute mcp_servers.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def mcp_servers @mcp_servers end |
#model ⇒ Object
Returns the value of attribute model.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def model @model end |
#observers ⇒ Object
Returns the value of attribute observers.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def observers @observers end |
#output_format ⇒ Object
Returns the value of attribute output_format.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def output_format @output_format end |
#permission_mode ⇒ Object
Returns the value of attribute permission_mode.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def @permission_mode end |
#permission_prompt_tool_name ⇒ Object
Returns the value of attribute permission_prompt_tool_name.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def @permission_prompt_tool_name end |
#plugins ⇒ Object
Returns the value of attribute plugins.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def plugins @plugins end |
#resume ⇒ Object
Returns the value of attribute resume.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def resume @resume end |
#resume_session_at ⇒ Object
Returns the value of attribute resume_session_at.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def resume_session_at @resume_session_at end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def sandbox @sandbox end |
#session_id ⇒ Object
Returns the value of attribute session_id.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def session_id @session_id end |
#session_store ⇒ Object
Returns the value of attribute session_store.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def session_store @session_store end |
#session_store_flush ⇒ Object
Returns the value of attribute session_store_flush.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def session_store_flush @session_store_flush end |
#setting_sources ⇒ Object
Returns the value of attribute setting_sources.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def setting_sources @setting_sources end |
#settings ⇒ Object
Returns the value of attribute settings.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def settings @settings end |
#stderr ⇒ Object
Returns the value of attribute stderr.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def stderr @stderr end |
#strict_mcp_config ⇒ Object
Returns the value of attribute strict_mcp_config.
1489 1490 1491 |
# File 'lib/claude_agent_sdk/types.rb', line 1489 def strict_mcp_config @strict_mcp_config end |
#system_prompt ⇒ Object
Returns the value of attribute system_prompt.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def system_prompt @system_prompt end |
#task_budget ⇒ Object
Returns the value of attribute task_budget.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def task_budget @task_budget end |
#thinking ⇒ Object
Returns the value of attribute thinking.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def thinking @thinking end |
#tools ⇒ Object
Returns the value of attribute tools.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def tools @tools end |
#user ⇒ Object
Returns the value of attribute user.
1478 1479 1480 |
# File 'lib/claude_agent_sdk/types.rb', line 1478 def user @user end |
Instance Method Details
#bare? ⇒ Boolean
1522 1523 1524 |
# File 'lib/claude_agent_sdk/types.rb', line 1522 def !! end |
#continue_conversation? ⇒ Boolean
1554 1555 1556 |
# File 'lib/claude_agent_sdk/types.rb', line 1554 def continue_conversation? !!continue_conversation end |
#dup_with(**changes) ⇒ Object
1516 1517 1518 1519 1520 |
# File 'lib/claude_agent_sdk/types.rb', line 1516 def dup_with(**changes) = self.dup changes.each { |key, value| [key] = value } end |
#enable_file_checkpointing? ⇒ Boolean
1538 1539 1540 |
# File 'lib/claude_agent_sdk/types.rb', line 1538 def enable_file_checkpointing? !!enable_file_checkpointing end |
#fork_session? ⇒ Boolean
1530 1531 1532 |
# File 'lib/claude_agent_sdk/types.rb', line 1530 def fork_session? !!fork_session end |
#include_hook_events? ⇒ Boolean
1562 1563 1564 |
# File 'lib/claude_agent_sdk/types.rb', line 1562 def include_hook_events? !!include_hook_events end |
#include_partial_messages? ⇒ Boolean
1546 1547 1548 |
# File 'lib/claude_agent_sdk/types.rb', line 1546 def !! end |
#strict_mcp_config? ⇒ Boolean
1570 1571 1572 |
# File 'lib/claude_agent_sdk/types.rb', line 1570 def strict_mcp_config? !!strict_mcp_config end |