Class: Swarm::Agent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: "Agent", model: "gpt-4", instructions: "You are a helpful agent.", functions: [], tool_choice: nil, parallel_tool_calls: true) ⇒ Agent

Returns a new instance of Agent.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/swarm/types.rb', line 5

def initialize(
  name: "Agent",
  model: "gpt-4",
  instructions: "You are a helpful agent.",
  functions: [],
  tool_choice: nil,
  parallel_tool_calls: true
)
  @name = name
  @model = model
  @instructions = instructions
  @functions = functions
  @tool_choice = tool_choice
  @parallel_tool_calls = parallel_tool_calls
end

Instance Attribute Details

#functionsObject

Returns the value of attribute functions.



3
4
5
# File 'lib/swarm/types.rb', line 3

def functions
  @functions
end

#instructionsObject

Returns the value of attribute instructions.



3
4
5
# File 'lib/swarm/types.rb', line 3

def instructions
  @instructions
end

#modelObject

Returns the value of attribute model.



3
4
5
# File 'lib/swarm/types.rb', line 3

def model
  @model
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/swarm/types.rb', line 3

def name
  @name
end

#parallel_tool_callsObject

Returns the value of attribute parallel_tool_calls.



3
4
5
# File 'lib/swarm/types.rb', line 3

def parallel_tool_calls
  @parallel_tool_calls
end

#tool_choiceObject

Returns the value of attribute tool_choice.



3
4
5
# File 'lib/swarm/types.rb', line 3

def tool_choice
  @tool_choice
end