|
4 | 4 | [eca.config :as config] |
5 | 5 | [eca.llm-providers.anthropic :as llm-providers.anthropic] |
6 | 6 | [eca.llm-providers.ollama :as llm-providers.ollama] |
7 | | - [eca.llm-providers.openai :as llm-providers.openai])) |
| 7 | + [eca.llm-providers.openai :as llm-providers.openai] |
| 8 | + [eca.logger :as logger])) |
8 | 9 |
|
9 | 10 | (set! *warn-on-reflection* true) |
10 | 11 |
|
|
30 | 31 | (reset! first-message-received* true) |
31 | 32 | (apply on-first-message-received args)) |
32 | 33 | (apply on-message-received args)) |
| 34 | + on-error-wrapper (fn [& args] |
| 35 | + (apply logger/error args) |
| 36 | + (apply on-error args)) |
33 | 37 | tools (when (:mcp-tools model-config) |
34 | 38 | (mapv mcp-tool->llm-tool mcp-tools)) |
35 | 39 | web-search (:web-search model-config)] |
|
46 | 50 | :web-search web-search |
47 | 51 | :api-key (:openaiApiKey config)} |
48 | 52 | {:on-message-received on-message-received-wrapper |
49 | | - :on-error on-error |
| 53 | + :on-error on-error-wrapper |
50 | 54 | :on-prepare-tool-call on-prepare-tool-call |
51 | 55 | :on-tool-called on-tool-called |
52 | 56 | :on-reason on-reason}) |
|
63 | 67 | :web-search web-search |
64 | 68 | :api-key (:anthropicApiKey config)} |
65 | 69 | {:on-message-received on-message-received-wrapper |
66 | | - :on-error on-error |
| 70 | + :on-error on-error-wrapper |
67 | 71 | :on-prepare-tool-call on-prepare-tool-call |
68 | 72 | :on-tool-called on-tool-called}) |
69 | 73 |
|
|
77 | 81 | :tools tools |
78 | 82 | :user-prompt user-prompt} |
79 | 83 | {:on-message-received on-message-received-wrapper |
80 | | - :on-error on-error |
| 84 | + :on-error on-error-wrapper |
| 85 | + :on-prepare-tool-call on-prepare-tool-call |
81 | 86 | :on-tool-called on-tool-called}) |
82 | 87 |
|
83 | 88 | :else |
|
0 commit comments