summaryrefslogtreecommitdiff
path: root/logic/providers/openai/tools.rb
diff options
context:
space:
mode:
Diffstat (limited to 'logic/providers/openai/tools.rb')
-rw-r--r--logic/providers/openai/tools.rb9
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