diff options
author | icebaker <icebaker@proton.me> | 2023-11-19 16:43:41 -0300 |
---|---|---|
committer | icebaker <icebaker@proton.me> | 2023-11-19 16:43:41 -0300 |
commit | 154aa68caf50a18af5c0dff1d368fc639314e0ba (patch) | |
tree | b2ab75665e42de79f22cca82bf03cfc49759f485 /logic | |
parent | e89a1d57c49c94c16c37a8ee3a69b52a9e2b341b (diff) |
improving tools parameters
Diffstat (limited to 'logic')
-rw-r--r-- | logic/providers/openai/tools.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/logic/providers/openai/tools.rb b/logic/providers/openai/tools.rb index 68f2209..1b2882a 100644 --- a/logic/providers/openai/tools.rb +++ b/logic/providers/openai/tools.rb @@ -41,13 +41,16 @@ module NanoBot end def self.adapt(cartridge) - { + output = { type: 'function', function: { - name: cartridge[:name], description: cartridge[:description], - parameters: cartridge[:parameters] + name: cartridge[:name], description: cartridge[:description] } } + + output[:function][:parameters] = (cartridge[:parameters] || { type: 'object', properties: {} }) + + output end end end |