summaryrefslogtreecommitdiff
path: root/spec/data
diff options
context:
space:
mode:
authoricebaker <icebaker@proton.me>2023-11-18 19:07:10 -0300
committericebaker <icebaker@proton.me>2023-11-18 19:07:10 -0300
commit8ae78b954350755a47a13133668dba93bac15f37 (patch)
tree9cdc3bb770d778bd8d00675fdbc1f27a6e27e37c /spec/data
parentab22d1bbe37093912cb7418b3c945153a15f4255 (diff)
adding support for tools
Diffstat (limited to 'spec/data')
-rw-r--r--spec/data/cartridges/tools.yml28
-rw-r--r--spec/data/providers/openai/tools.yml11
2 files changed, 39 insertions, 0 deletions
diff --git a/spec/data/cartridges/tools.yml b/spec/data/cartridges/tools.yml
new file mode 100644
index 0000000..0c2a30b
--- /dev/null
+++ b/spec/data/cartridges/tools.yml
@@ -0,0 +1,28 @@
+---
+tools:
+ - name: get-current-weather
+ type: function
+ description: Get the current weather in a given location.
+ parameters:
+ - name: location
+ - name: unit
+ fennel: |
+ (let [{:location location :unit unit} parameters]
+ (.. "Here is the weather in " location ", in " unit ": 35.8°C."))
+
+ - name: what-time-is-it
+ description: Returns the current date and time.
+ fennel: |
+ (os.date)
+
+ - name: sh
+ description: It has access to computer users' data and can be used to run shell commands, similar to those in a Linux terminal, to extract information. Please be mindful and careful to avoid running dangerous commands on users' computers.
+ parameters:
+ - name: command
+ type: array
+ items:
+ type: string
+ description: An array of strings that represents a shell command along with its arguments or options. For instance, `["df", "-h"]` executes the `df -h` command, where each array element specifies either the command itself or an associated argument/option.
+ clojure: |
+ (require '[clojure.java.shell :refer [sh]])
+ (println (apply sh (get parameters "command")))
diff --git a/spec/data/providers/openai/tools.yml b/spec/data/providers/openai/tools.yml
new file mode 100644
index 0000000..681fb2c
--- /dev/null
+++ b/spec/data/providers/openai/tools.yml
@@ -0,0 +1,11 @@
+---
+- id: call_XYZ
+ type: function
+ function:
+ name: get-current-weather
+ arguments: '{"location":"Tokyo, Japan"}'
+- id: call_ZYX
+ type: function
+ function:
+ name: what-time-is-it
+ arguments: "{}"