Class: SignalWire::Skills::Builtin::DateTimeSkill

Inherits:
SkillBase
  • Object
show all
Defined in:
lib/signalwire/skills/builtin/datetime.rb

Instance Attribute Summary

Attributes inherited from SkillBase

#agent, #logger, #params, #swaig_fields

Instance Method Summary collapse

Methods inherited from SkillBase

#cleanup, #get_global_data, #get_hints, #get_param, #get_parameter_schema, #initialize, #instance_key, #required_env_vars, #setup, #supports_multiple_instances?, #version

Constructor Details

This class inherits a constructor from SignalWire::Skills::SkillBase

Instance Method Details

#descriptionObject



11
# File 'lib/signalwire/skills/builtin/datetime.rb', line 11

def description; 'Get current date, time, and timezone information'; end

#get_prompt_sectionsObject



34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/signalwire/skills/builtin/datetime.rb', line 34

def get_prompt_sections
  [
    {
      'title' => 'Date and Time Information',
      'body' => 'You can provide current date and time information.',
      'bullets' => [
        'Use get_current_time to tell users what time it is',
        'Use get_current_date to tell users today\'s date',
        'Both tools support different timezones'
      ]
    }
  ]
end

#nameObject



10
# File 'lib/signalwire/skills/builtin/datetime.rb', line 10

def name;        'datetime'; end

#register_toolsObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/signalwire/skills/builtin/datetime.rb', line 13

def register_tools
  [
    {
      name: 'get_current_time',
      description: 'Get the current time, optionally in a specific timezone',
      parameters: {
        'timezone' => { 'type' => 'string', 'description' => "Timezone name (e.g., 'America/New_York', 'Europe/London'). Defaults to UTC." }
      },
      handler: method(:handle_get_time)
    },
    {
      name: 'get_current_date',
      description: 'Get the current date',
      parameters: {
        'timezone' => { 'type' => 'string', 'description' => 'Timezone name for the date. Defaults to UTC.' }
      },
      handler: method(:handle_get_date)
    }
  ]
end