|
155 | 155 | :on-close (fn [_ws code reason] |
156 | 156 | (reset! alive? false) |
157 | 157 | (t/log! :info ["Elevenlabs websocket connection closed" "Code:" code "Reason:" reason]))} |
158 | | - _ (t/log! {:level :info :id :deepgram-transcriptor} "Connecting to transcription websocket") |
| 158 | + _ (t/log! {:level :info :id :elevenlabs} "Connecting to transcription websocket") |
159 | 159 | ws-conn @(ws/websocket |
160 | 160 | url |
161 | 161 | conf) |
|
197 | 197 | (let [attempt (u/parse-if-json (str acc msg))] |
198 | 198 | (if (map? attempt) |
199 | 199 | [(assoc state :audio/acc "") (when-let [audio (:audio attempt)] |
200 | | - {:out (frame/audio-output-raw (u/decode-base64 audio))})] |
| 200 | + {:out [(frame/audio-output-raw (u/decode-base64 audio))]})] |
201 | 201 | ;; continue concatenating |
202 | 202 | [(assoc state :audio/acc attempt)])) |
203 | 203 | (cond |
|
240 | 240 | llm-write (a/chan 100) |
241 | 241 | llm-read (a/chan 1024) |
242 | 242 | write-to-llm #(loop [] |
243 | | - (t/log! {:level :info :id :llm} "Starting LLM loop") |
244 | 243 | (if-let [msg (a/<!! llm-write)] |
245 | 244 | (do |
246 | | - (t/log! {:level :debug :id :llm} ["LLM CONTEXT" msg]) |
247 | 245 | (assert (or (frame/llm-context? msg) |
248 | 246 | (frame/control-interrupt-start? msg)) "Invalid frame sent to LLM. Only llm-context or interrupt-start") |
249 | 247 | (openai/flow-do-completion! state llm-read msg) |
|
264 | 262 | ([] {:ins {:in "Channel for llm text chunks"} |
265 | 263 | :outs {:out "Channel for assembled speak frames"}}) |
266 | 264 | ([_] {:acc nil}) |
267 | | - ([{:keys [acc]} msg] |
| 265 | + ([{:keys [acc]} _ msg] |
268 | 266 | (when (frame/llm-text-chunk? msg) |
269 | 267 | (let [{:keys [sentence accumulator]} (u/assemble-sentence acc (:frame/data msg))] |
270 | 268 | (if sentence |
|
310 | 308 | :elevenlabs/voice-id "7sJPxFeMXAVWZloGIqg2" |
311 | 309 | :voice/stability 0.5 |
312 | 310 | :voice/similarity-boost 0.8 |
313 | | - :voice/use-speaker-boost? true}} |
| 311 | + :voice/use-speaker-boost? true |
| 312 | + :flow/language :en |
| 313 | + :audio.out/encoding :ulaw |
| 314 | + :audio.out/sample-rate 8000}} |
314 | 315 |
|
315 | 316 | :print-sink {:proc (flow/process |
316 | 317 | {:describe (fn [] {:ins {:in "Channel for receiving transcriptions"}}) |
|
0 commit comments