|
52 | 52 | (s/def ::container-response (s/keys :req-un [::pty-output ::exit-code ::info ::done]
|
53 | 53 | :opt-un [::timeout ::kill-container]))
|
54 | 54 |
|
| 55 | +;; -- tool parameters -- |
| 56 | +(s/def :tool/parameters any?) |
| 57 | + |
| 58 | +;; -- container tools -- |
| 59 | +(s/def :container/image string?) |
| 60 | +(s/def :container/command (s/coll-of string?)) |
| 61 | +(s/def :container/stdin any?) |
| 62 | +(s/def :container/volumes (s/coll-of string?)) |
| 63 | +(s/def :container/entrypoint string?) |
| 64 | +(s/def :container/workdir string?) |
| 65 | +(s/def :tool/container (s/keys :req-un [:container/image] |
| 66 | + :opt-un [:container/stdin :container/command :container/volumes :container/entrypoint :container/workdir])) |
| 67 | + |
55 | 68 | ;; -- Spec definitions for Tools --
|
56 | 69 | (s/def ::github-ref (s/and string? #(string/starts-with? % "github:")))
|
57 | 70 | (s/def :prompt/ref ::github-ref)
|
58 | 71 | (s/def :prompt/prompt (s/or :github-ref ::github-ref :relative-path string?))
|
59 | 72 | (s/def :tool/name string?)
|
60 |
| -(s/def :docker/type #{"prompt" "container"}) |
| 73 | +(s/def :docker/type #{"prompt"}) |
61 | 74 | (s/def :tool/description string?)
|
62 | 75 | (s/def ::prompt-tool (s/keys :req-un [:tool/name :tool/description :docker/type]
|
63 | 76 | :opt-un [:tool/parameters :prompt/prompt :prompt/ref]))
|
64 | 77 | (s/def ::container-tool (s/keys :req-un [:tool/name :tool/description :tool/container]
|
65 | 78 | :opt-un [:tool/parameters]))
|
66 |
| -(s/def ::placeholder-tool (s/keys :req-un [:tool/name :tool/description] |
67 |
| - :opt-un [:tool/parameters])) |
68 |
| -(s/def :tool/function (s/or :container ::container-tool :prompt ::prompt-tool :placeholder ::placeholder-tool)) |
| 79 | +(s/def :tool/function (s/or :container ::container-tool :prompt ::prompt-tool)) |
69 | 80 | (s/def :tool/type #{"function"})
|
70 | 81 | (s/def ::tool (s/keys :req-un [:tool/type :tool/function]))
|
71 | 82 | (s/def ::tools (s/coll-of ::tool))
|
|
0 commit comments