-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathevolution-tools.lisp
More file actions
79 lines (73 loc) · 3.78 KB
/
evolution-tools.lisp
File metadata and controls
79 lines (73 loc) · 3.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
;;; -*- Lisp -*-
(in-package "GEMINI")
(defun evolution-tools-and-handlers ()
"Return a list of evolution-related functions and their handlers."
(list
(cons
(function-declaration
:name "appendSystemInstruction"
:description "Appends an instruction to the system instruction used by the LLM."
:behavior :blocking
:parameters (schema :type :object
:properties (object :instruction
(schema :type :string
:description "The instruction to append to the system instruction."))
:required (vector :instruction)))
(lambda (&key instruction)
(append-evolvable-system-instruction instruction)))
(cons
(function-declaration
:name "deleteSystemInstruction"
:description "Deletes an instruction from the system instruction used by the LLM."
:behavior :blocking
:parameters (schema :type :object
:properties (object :index
(schema :type :integer
:description "The index of the instruction to delete from the system instruction."))
:required (vector :index)))
(lambda (&key index)
(delete-evolvable-system-instruction index)))
(cons
(function-declaration
:name "insertSystemInstruction"
:description "Inserts an instruction at an index into the system instruction used by the LLM."
:behavior :blocking
:parameters (schema :type :object
:properties (object :index
(schema :type :integer
:description "The index of the instruction to delete from the system instruction.")
:instruction
(schema :type :string
:description "The instruction to insert into the system instruction."))
:required (vector :index :instruction)))
(lambda (&key index instruction)
(insert-evolvable-system-instruction index instruction)))
(cons
(function-declaration
:name "readSystemInstruction"
:description "Reads the system instruction used by the LLM at a particular index."
:behavior :blocking
:parameters (schema :type :object
:properties (object :index
(schema :type :integer
:description "The index of the instruction to delete from the system instruction."))
:required (vector :index))
:response (schema :type :string))
(lambda (&key index)
(read-evolvable-system-instruction index)))
(cons
(function-declaration
:name "updateSystemInstruction"
:description "Modifies the system instruction used by the LLM at a particular index."
:behavior :blocking
:parameters (schema :type :object
:properties (object :index
(schema :type :integer
:description "The index of the instruction to modify in the system instruction.")
:instruction
(schema :type :string
:description "The replacement instruction to modify in the system instruction."))
:required (vector :index :instruction)))
(lambda (&key index instruction)
(update-evolvable-system-instruction index instruction)))
))