diff options
author | icebaker <icebaker@proton.me> | 2023-11-19 13:35:54 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2023-11-19 13:35:54 -0300 |
commit | e89a1d57c49c94c16c37a8ee3a69b52a9e2b341b (patch) | |
tree | e82a7579534003f02de32d058f4a60d1d076240c /spec/logic/providers | |
parent | c470d63b169058d81f44569a5f1c4c1fb222279f (diff) |
improving tool specifications
Diffstat (limited to 'spec/logic/providers')
-rw-r--r-- | spec/logic/providers/openai/tools_spec.rb | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/spec/logic/providers/openai/tools_spec.rb b/spec/logic/providers/openai/tools_spec.rb index c92c374..1758e5f 100644 --- a/spec/logic/providers/openai/tools_spec.rb +++ b/spec/logic/providers/openai/tools_spec.rb @@ -13,14 +13,16 @@ RSpec.describe NanoBot::Logic::OpenAI::Tools do expect(described_class.adapt(cartridge[:tools][0])).to eq( { type: 'function', function: { - name: 'get-current-weather', - description: 'Get the current weather in a given location.', + name: 'what-time-is-it', + description: 'Returns the current date and time for a given timezone.', parameters: { type: 'object', properties: { - location: { type: 'string' }, - unit: { type: 'string' } - } + timezone: { + type: 'string', + description: 'A string representing the timezone that should be used to provide a datetime, following the IANA (Internet Assigned Numbers Authority) Time Zone Database. Examples are "Asia/Tokyo" and "Europe/Paris".' + } + }, required: ['timezone'] } } } ) @@ -28,9 +30,15 @@ RSpec.describe NanoBot::Logic::OpenAI::Tools do expect(described_class.adapt(cartridge[:tools][1])).to eq( { type: 'function', function: { - name: 'what-time-is-it', - description: 'Returns the current date and time.', - parameters: { properties: {}, type: 'object' } + name: 'get-current-weather', + description: 'Get the current weather in a given location.', + parameters: { + type: 'object', + properties: { + location: { type: 'string' }, + unit: { type: 'string' } + } + } } } ) |