|
124 | 124 | (fact "if new context is tool call result, send it forward" |
125 | 125 | (let [new-context {:messages [{:role "system", :content "You are a voice agent operating via phone. Be concise. The input you receive comes from a speech-to-text (transcription) system that isn't always efficient and may send unclear text. Ask for clarification when you're unsure what the person said."} |
126 | 126 | {:role "user", :content "What's the weather in New York?"} |
127 | | - {:role :assistant, :tool_calls [{:id "call_LCEOwyJ6wsqC5rzJRH0uMnR8", :type :function, :function {:name "get_weather", :arguments {:town "New York"}}}]} |
| 127 | + {:role :assistant, :tool_calls [{:id "call_LCEOwyJ6wsqC5rzJRH0uMnR8", :type :function, :function {:name "get_weather", :arguments "{\"town\":\"New York\"}"}}]} |
128 | 128 | {:role :tool, :content [{:type :text, :text "The weather in New York is 17 degrees celsius"}], :tool_call_id "call_LCEOwyJ6wsqC5rzJRH0uMnR8"}] |
129 | 129 | :tools [{:type :function |
130 | 130 | :function {:name "get_weather" |
|
256 | 256 | :role "assistant"} |
257 | 257 | {:content "Hello there" :role "user"} |
258 | 258 | {:role :assistant |
259 | | - :tool_calls [{:function {:arguments {:date "2023-10-10" |
260 | | - :fields ["price" |
261 | | - "volume"] |
262 | | - :ticker "MSFT"} |
| 259 | + :tool_calls [{:function {:arguments "{\"ticker\":\"MSFT\",\"fields\":[\"price\",\"volume\"],\"date\":\"2023-10-10\"}" |
263 | 260 | :name "retrieve_latest_stock_data"} |
264 | 261 | :id "call_frPVnoe8ruDicw50T8sLHki7" |
265 | 262 | :type :function}]}]}} |
|
269 | 266 | (:frame/data out-frame) => {:messages [{:content "You are a helpful assistant" :role "assistant"} |
270 | 267 | {:content "Hello there" :role "user"} |
271 | 268 | {:role :assistant |
272 | | - :tool_calls [{:function {:arguments {:date "2023-10-10" |
273 | | - :fields ["price" "volume"] |
274 | | - :ticker "MSFT"} |
| 269 | + :tool_calls [{:function {:arguments "{\"ticker\":\"MSFT\",\"fields\":[\"price\",\"volume\"],\"date\":\"2023-10-10\"}" |
275 | 270 | :name "retrieve_latest_stock_data"} |
276 | 271 | :id "call_frPVnoe8ruDicw50T8sLHki7" |
277 | 272 | :type :function}]}]})))) |
0 commit comments