Skip to content

Commit 00c3ac8

Browse files
committed
Prefix tool name with server to LLM: <server>__<toolname>.
Fixes #196
1 parent c501a2e commit 00c3ac8

File tree

21 files changed

+314
-284
lines changed

21 files changed

+314
-284
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Prefix tool name with server to LLM: <server>__<toolname>. #196
6+
57
## 0.77.1
68

79
- Fix token renew when using rewrite feature.

integration-test/integration/chat/anthropic_test.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
212212
(match-content chat-id "assistant" {:type "reasonStarted" :id (m/pred string?)})
213213
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text "I should call tool"})
214-
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca_directory_tree"})
214+
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca__eca_directory_tree"})
215215
(match-content chat-id "assistant" {:type "reasonFinished" :id (m/pred string?) :totalTimeMs (m/pred number?)})
216216
(match-content chat-id "assistant" {:type "text" :text "I will list files"})
217217
(match-content chat-id "assistant" {:type "toolCallPrepare"
@@ -270,12 +270,12 @@
270270
{:role "assistant"
271271
:content [{:type "thinking"
272272
:signature "enc-123"
273-
:thinking "I should call tool eca_directory_tree"}]}
273+
:thinking "I should call tool eca__eca_directory_tree"}]}
274274
{:role "assistant" :content [{:type "text" :text "I will list files"}]}
275275
{:role "assistant"
276276
:content [{:type "tool_use"
277277
:id "tool-1"
278-
:name "eca_directory_tree"
278+
:name "eca__eca_directory_tree"
279279
:input {:path (h/project-path->canon-path "resources")}}]}
280280
{:role "user"
281281
:content [{:type "tool_result"
@@ -285,6 +285,6 @@
285285
" file2.md\n\n"
286286
"0 directories, 2 files\n")}]}]
287287
:tools (m/embeds
288-
[{:name "eca_directory_tree"}])
288+
[{:name "eca__eca_directory_tree"}])
289289
:system (m/pred vector?)}
290290
(llm.mocks/get-req-body :tool-calling-0)))))))

integration-test/integration/chat/github_copilot_test.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@
199199
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
200200
(match-content chat-id "assistant" {:type "reasonStarted" :id (m/pred string?)})
201201
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text "I should call tool"})
202-
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca_directory_tree"})
202+
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca__eca_directory_tree"})
203203
(match-content chat-id "assistant" {:type "reasonFinished" :id (m/pred string?) :totalTimeMs (m/pred number?)})
204204
(match-content chat-id "assistant" {:type "text" :text "I will list files"})
205205
(match-content chat-id "assistant" {:type "toolCallPrepare"
@@ -266,19 +266,19 @@
266266
{:role "assistant"
267267
:content [{:type "thinking"
268268
:signature "enc-123"
269-
:thinking "I should call tool eca_directory_tree"}]}
269+
:thinking "I should call tool eca__eca_directory_tree"}]}
270270
{:role "assistant" :content [{:type "text" :text "I will list files"}]}
271271
{:role "assistant"
272272
:content [{:type "tool_use"
273273
:id "tool-1"
274-
:name "eca_directory_tree"
274+
:name "eca__eca_directory_tree"
275275
:input {:path (h/project-path->canon-path "resources")}}]}
276276
{:role "user"
277277
:content [{:type "tool_result"
278278
:tool_use_id "tool-1"
279279
:content (str "[FILE] " (h/project-path->canon-path "resources/file1.md\n")
280280
"[FILE] " (h/project-path->canon-path "resources/file2.md\n\n"))}]}]
281281
:tools (m/embeds
282-
[{:name "eca_directory_tree"}])
282+
[{:name "eca__eca_directory_tree"}])
283283
:system (m/pred vector?)}
284284
llm.mocks/*last-req-body*))))))

integration-test/integration/chat/google_test.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
(match-content chat-id "system" {:type "progress" :state "running" :text "Generating"})
199199
(match-content chat-id "assistant" {:type "reasonStarted" :id (m/pred string?)})
200200
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text "I should call tool"})
201-
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca_directory_tree"})
201+
(match-content chat-id "assistant" {:type "reasonText" :id (m/pred string?) :text " eca__eca_directory_tree"})
202202
(match-content chat-id "assistant" {:type "reasonFinished" :id (m/pred string?) :totalTimeMs (m/pred number?)})
203203
(match-content chat-id "assistant" {:type "text" :text "I will list files"})
204204
(match-content chat-id "assistant" {:type "toolCallPrepare"
@@ -265,19 +265,19 @@
265265
{:role "assistant"
266266
:content [{:type "thinking"
267267
:signature "enc-123"
268-
:thinking "I should call tool eca_directory_tree"}]}
268+
:thinking "I should call tool eca__eca_directory_tree"}]}
269269
{:role "assistant" :content [{:type "text" :text "I will list files"}]}
270270
{:role "assistant"
271271
:content [{:type "tool_use"
272272
:id "tool-1"
273-
:name "eca_directory_tree"
273+
:name "eca__eca_directory_tree"
274274
:input {:path (h/project-path->canon-path "resources")}}]}
275275
{:role "user"
276276
:content [{:type "tool_result"
277277
:tool_use_id "tool-1"
278278
:content (str "[FILE] " (h/project-path->canon-path "resources/file1.md\n")
279279
"[FILE] " (h/project-path->canon-path "resources/file2.md\n\n"))}]}]
280280
:tools (m/embeds
281-
[{:name "eca_directory_tree"}])
281+
[{:name "eca__eca_directory_tree"}])
282282
:system (m/pred vector?)}
283283
llm.mocks/*last-req-body*))))))

integration-test/integration/chat/ollama_test.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,13 +252,13 @@
252252
{:role "assistant" :content "I will list files"}
253253
{:role "assistant" :tool-calls [{:type "function"
254254
:function {:id (m/pred string?)
255-
:name "eca_directory_tree"
255+
:name "eca__eca_directory_tree"
256256
:arguments {:path (h/project-path->canon-path "resources")}
257257
:summary "Listing file tree"
258258
:origin "native"}}]}
259259
{:role "tool" :content (str (h/project-path->canon-path "resources") "\n"
260260
" file1.md\n"
261261
" file2.md\n\n"
262262
"0 directories, 2 files\n")}]
263-
:tools (m/embeds [{:type "function" :function {:name "eca_directory_tree"}}])}
263+
:tools (m/embeds [{:type "function" :function {:name "eca__eca_directory_tree"}}])}
264264
(llm.mocks/get-req-body :tool-calling-0)))))))

0 commit comments

Comments
 (0)