Class: ClaudeAgentSDK::AgentDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/claude_agent_sdk/types.rb

Overview

Agent definition configuration

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description:, prompt:, tools: nil, disallowed_tools: nil, model: nil, skills: nil, memory: nil, mcp_servers: nil, initial_prompt: nil, max_turns: nil, background: nil, effort: nil, permission_mode: nil) ⇒ AgentDefinition

Returns a new instance of AgentDefinition.



615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
# File 'lib/claude_agent_sdk/types.rb', line 615

def initialize(description:, prompt:, tools: nil, disallowed_tools: nil, model: nil, skills: nil,
               memory: nil, mcp_servers: nil, initial_prompt: nil, max_turns: nil,
               background: nil, effort: nil, permission_mode: nil)
  @description = description
  @prompt = prompt
  @tools = tools
  @disallowed_tools = disallowed_tools # Array of tool names to disallow
  @model = model
  @skills = skills # Array of skill names
  @memory = memory # One of: 'user', 'project', 'local'
  @mcp_servers = mcp_servers # Array of server names or config hashes
  @initial_prompt = initial_prompt # Initial prompt sent when agent starts
  @max_turns = max_turns # Maximum conversation turns for the agent
  @background = background # Whether this agent runs in background
  @effort = effort # See ClaudeAgentSDK::EFFORT_LEVELS or an Integer
  @permission_mode = permission_mode # Permission mode for the agent
end

Instance Attribute Details

#backgroundObject

Returns the value of attribute background.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def background
  @background
end

#descriptionObject

Returns the value of attribute description.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def description
  @description
end

#disallowed_toolsObject

Returns the value of attribute disallowed_tools.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def disallowed_tools
  @disallowed_tools
end

#effortObject

Returns the value of attribute effort.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def effort
  @effort
end

#initial_promptObject

Returns the value of attribute initial_prompt.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def initial_prompt
  @initial_prompt
end

#max_turnsObject

Returns the value of attribute max_turns.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def max_turns
  @max_turns
end

#mcp_serversObject

Returns the value of attribute mcp_servers.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def mcp_servers
  @mcp_servers
end

#memoryObject

Returns the value of attribute memory.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def memory
  @memory
end

#modelObject

Returns the value of attribute model.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def model
  @model
end

#permission_modeObject

Returns the value of attribute permission_mode.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def permission_mode
  @permission_mode
end

#promptObject

Returns the value of attribute prompt.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def prompt
  @prompt
end

#skillsObject

Returns the value of attribute skills.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def skills
  @skills
end

#toolsObject

Returns the value of attribute tools.



612
613
614
# File 'lib/claude_agent_sdk/types.rb', line 612

def tools
  @tools
end