Class: ClaudeAgentSDK::ClaudeAgentOptions
- Inherits:
-
Object
- Object
- 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.
-
#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.
-
#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_partial_messages ⇒ Object
Returns the value of attribute include_partial_messages.
-
#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.
-
#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.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#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.
-
#system_prompt ⇒ Object
Returns the value of attribute system_prompt.
-
#tools ⇒ Object
Returns the value of attribute tools.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #dup_with(**changes) ⇒ Object
-
#initialize(allowed_tools: [], system_prompt: nil, mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, cli_path: nil, settings: nil, add_dirs: [], env: {}, extra_args: {}, max_buffer_size: nil, stderr: nil, can_use_tool: nil, hooks: nil, user: nil, include_partial_messages: false, fork_session: false, agents: nil, setting_sources: nil, output_format: nil, max_budget_usd: nil, max_thinking_tokens: nil, fallback_model: nil, plugins: nil, debug_stderr: nil, betas: nil, tools: nil, sandbox: nil, enable_file_checkpointing: false, append_allowed_tools: nil) ⇒ ClaudeAgentOptions
constructor
A new instance of ClaudeAgentOptions.
Constructor Details
#initialize(allowed_tools: [], system_prompt: nil, mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, cli_path: nil, settings: nil, add_dirs: [], env: {}, extra_args: {}, max_buffer_size: nil, stderr: nil, can_use_tool: nil, hooks: nil, user: nil, include_partial_messages: false, fork_session: false, agents: nil, setting_sources: nil, output_format: nil, max_budget_usd: nil, max_thinking_tokens: nil, fallback_model: nil, plugins: nil, debug_stderr: nil, betas: nil, tools: nil, sandbox: nil, enable_file_checkpointing: false, append_allowed_tools: nil) ⇒ ClaudeAgentOptions
Returns a new instance of ClaudeAgentOptions.
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 |
# File 'lib/claude_agent_sdk/types.rb', line 787 def initialize( allowed_tools: [], system_prompt: nil, mcp_servers: {}, permission_mode: nil, continue_conversation: false, resume: nil, max_turns: nil, disallowed_tools: [], model: nil, permission_prompt_tool_name: nil, cwd: nil, cli_path: nil, settings: nil, add_dirs: [], env: {}, extra_args: {}, max_buffer_size: nil, stderr: nil, can_use_tool: nil, hooks: nil, user: nil, include_partial_messages: false, fork_session: false, agents: nil, setting_sources: nil, output_format: nil, max_budget_usd: nil, max_thinking_tokens: nil, fallback_model: nil, plugins: nil, debug_stderr: nil, betas: nil, tools: nil, sandbox: nil, enable_file_checkpointing: false, append_allowed_tools: nil ) @allowed_tools = allowed_tools @system_prompt = system_prompt @mcp_servers = mcp_servers @permission_mode = @continue_conversation = continue_conversation @resume = resume @max_turns = max_turns @disallowed_tools = disallowed_tools @model = model @permission_prompt_tool_name = @cwd = cwd @cli_path = cli_path @settings = settings @add_dirs = add_dirs @env = env @extra_args = extra_args @max_buffer_size = max_buffer_size @stderr = stderr @can_use_tool = can_use_tool @hooks = hooks @user = user @include_partial_messages = @fork_session = fork_session @agents = agents @setting_sources = setting_sources @output_format = output_format # JSON schema for structured output @max_budget_usd = max_budget_usd # Spending cap in dollars @max_thinking_tokens = max_thinking_tokens # Extended thinking token budget @fallback_model = fallback_model # Backup model if primary unavailable @plugins = plugins # Array of SdkPluginConfig @debug_stderr = debug_stderr # Debug output file object/path @betas = betas # Array of beta feature strings (e.g., ["context-1m-2025-08-07"]) @tools = tools # Base tools selection: Array, empty array [], or ToolsPreset @sandbox = sandbox # SandboxSettings instance for isolated command execution @enable_file_checkpointing = enable_file_checkpointing # Enable file checkpointing for rewind support @append_allowed_tools = append_allowed_tools # Array of tools to append to allowed_tools end |
Instance Attribute Details
#add_dirs ⇒ Object
Returns the value of attribute add_dirs.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def add_dirs @add_dirs end |
#agents ⇒ Object
Returns the value of attribute agents.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def agents @agents end |
#allowed_tools ⇒ Object
Returns the value of attribute allowed_tools.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def allowed_tools @allowed_tools end |
#append_allowed_tools ⇒ Object
Returns the value of attribute append_allowed_tools.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def append_allowed_tools @append_allowed_tools end |
#betas ⇒ Object
Returns the value of attribute betas.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def betas @betas end |
#can_use_tool ⇒ Object
Returns the value of attribute can_use_tool.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def can_use_tool @can_use_tool end |
#cli_path ⇒ Object
Returns the value of attribute cli_path.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def cli_path @cli_path end |
#continue_conversation ⇒ Object
Returns the value of attribute continue_conversation.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def continue_conversation @continue_conversation end |
#cwd ⇒ Object
Returns the value of attribute cwd.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def cwd @cwd end |
#debug_stderr ⇒ Object
Returns the value of attribute debug_stderr.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def debug_stderr @debug_stderr end |
#disallowed_tools ⇒ Object
Returns the value of attribute disallowed_tools.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def disallowed_tools @disallowed_tools end |
#enable_file_checkpointing ⇒ Object
Returns the value of attribute enable_file_checkpointing.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def enable_file_checkpointing @enable_file_checkpointing end |
#env ⇒ Object
Returns the value of attribute env.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def env @env end |
#extra_args ⇒ Object
Returns the value of attribute extra_args.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def extra_args @extra_args end |
#fallback_model ⇒ Object
Returns the value of attribute fallback_model.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def fallback_model @fallback_model end |
#fork_session ⇒ Object
Returns the value of attribute fork_session.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def fork_session @fork_session end |
#hooks ⇒ Object
Returns the value of attribute hooks.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def hooks @hooks end |
#include_partial_messages ⇒ Object
Returns the value of attribute include_partial_messages.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def @include_partial_messages end |
#max_budget_usd ⇒ Object
Returns the value of attribute max_budget_usd.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def max_budget_usd @max_budget_usd end |
#max_buffer_size ⇒ Object
Returns the value of attribute max_buffer_size.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def max_buffer_size @max_buffer_size end |
#max_thinking_tokens ⇒ Object
Returns the value of attribute max_thinking_tokens.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def max_thinking_tokens @max_thinking_tokens end |
#max_turns ⇒ Object
Returns the value of attribute max_turns.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def max_turns @max_turns end |
#mcp_servers ⇒ Object
Returns the value of attribute mcp_servers.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def mcp_servers @mcp_servers end |
#model ⇒ Object
Returns the value of attribute model.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def model @model end |
#output_format ⇒ Object
Returns the value of attribute output_format.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def output_format @output_format end |
#permission_mode ⇒ Object
Returns the value of attribute permission_mode.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def @permission_mode end |
#permission_prompt_tool_name ⇒ Object
Returns the value of attribute permission_prompt_tool_name.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def @permission_prompt_tool_name end |
#plugins ⇒ Object
Returns the value of attribute plugins.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def plugins @plugins end |
#resume ⇒ Object
Returns the value of attribute resume.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def resume @resume end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def sandbox @sandbox end |
#setting_sources ⇒ Object
Returns the value of attribute setting_sources.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def setting_sources @setting_sources end |
#settings ⇒ Object
Returns the value of attribute settings.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def settings @settings end |
#stderr ⇒ Object
Returns the value of attribute stderr.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def stderr @stderr end |
#system_prompt ⇒ Object
Returns the value of attribute system_prompt.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def system_prompt @system_prompt end |
#tools ⇒ Object
Returns the value of attribute tools.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def tools @tools end |
#user ⇒ Object
Returns the value of attribute user.
777 778 779 |
# File 'lib/claude_agent_sdk/types.rb', line 777 def user @user end |
Instance Method Details
#dup_with(**changes) ⇒ Object
863 864 865 866 867 |
# File 'lib/claude_agent_sdk/types.rb', line 863 def dup_with(**changes) = self.dup changes.each { |key, value| .send("#{key}=", value) } end |