Liking cljdoc? Tell your friends :D

im.ttalk.agent.provider.anthropic-server-tools

Anthropic 服务端工具块的「看得懂」的视图(designs/provider-reliability.md §9; Keelson Providers/AnthropicServerTools.cs 的 Describe)。

服务端工具块(server_tool_use、web_search_tool_result、code_execution_tool_result …)在 中立层始终是不透明回放载荷(:blocks,原样回放、pause_turn 续跑都认它),这一点不变。 本 ns 只给界面 / 日志一个纯数据视图(查询词、搜到的网址、执行输出),不进历史。

(server-tools/describe-all (:content raw-anthropic-response))
;=> [{:kind :web-search-call :id "srvtoolu_1" :queries ["clojure"]}
;    {:kind :web-search-result :tool-use-id "srvtoolu_1" :results [{:url .. :title ..}]}]
Anthropic 服务端工具块的「看得懂」的视图(designs/provider-reliability.md §9;
Keelson `Providers/AnthropicServerTools.cs` 的 `Describe`)。

服务端工具块(`server_tool_use`、`web_search_tool_result`、`code_execution_tool_result` …)在
中立层始终是不透明回放载荷(`:blocks`,原样回放、pause_turn 续跑都认它),这一点不变。
本 ns 只给界面 / 日志一个纯数据视图(查询词、搜到的网址、执行输出),**不进历史**。

```clojure
(server-tools/describe-all (:content raw-anthropic-response))
;=> [{:kind :web-search-call :id "srvtoolu_1" :queries ["clojure"]}
;    {:kind :web-search-result :tool-use-id "srvtoolu_1" :results [{:url .. :title ..}]}]
```
raw docstring

describeclj

(describe block)

一个 Anthropic 内容块 → 视图 map;不认识(text / tool_use / thinking …)→ nil。视图带 :raw 原块。

块视图
server_tool_use name=web_search{:kind :web-search-call :id :queries [q]}
server_tool_use name=*code_execution{:kind :code-execution-call :id :name :input "代码或命令"}
其它 server_tool_use(web_fetch …){:kind :server-tool-call :id :name :input {...}}
web_search_tool_result{:kind :web-search-result :tool-use-id :results [{:url :title :page-age}]}
*code_execution_tool_result{:kind :code-execution-result :tool-use-id :stdout :stderr :return-code}

结果是错误对象(*_tool_result_error)→ 视图带 :error-code。

一个 Anthropic 内容块 → 视图 map;不认识(text / tool_use / thinking …)→ nil。视图带 `:raw` 原块。

| 块 | 视图 |
|---|---|
| server_tool_use name=web_search | `{:kind :web-search-call :id :queries [q]}` |
| server_tool_use name=*code_execution | `{:kind :code-execution-call :id :name :input "代码或命令"}` |
| 其它 server_tool_use(web_fetch …) | `{:kind :server-tool-call :id :name :input {...}}` |
| web_search_tool_result | `{:kind :web-search-result :tool-use-id :results [{:url :title :page-age}]}` |
| *code_execution_tool_result | `{:kind :code-execution-result :tool-use-id :stdout :stderr :return-code}` |
结果是错误对象(`*_tool_result_error`)→ 视图带 `:error-code`。
sourceraw docstring

describe-allclj

(describe-all blocks)

一组内容块 → 认得的那些块的视图(按原次序;认不出的跳过)。

一组内容块 → 认得的那些块的视图(按原次序;认不出的跳过)。
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close