File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 1+ model :
2+ provider : " anthropic"
3+ api_key : " ${ANTHROPIC_API_KEY}"
4+ base_url : " http://localhost:4141"
5+ name : " claude-haiku-4.5"
6+ max_tokens : 32000
7+ timeout : 60
8+
9+ tools :
10+ enabled :
11+ - bash
12+ - file
13+ - edit
14+ - search
15+ - todo
16+
17+ bash :
18+ timeout_ms : 30000
19+ max_output_chars : 100000
20+ forbidden_commands :
21+ - " rm -rf /"
22+ - " mkfs"
23+
24+ output :
25+ format : " markdown"
26+ colors : true
27+ show_spinner : true
Original file line number Diff line number Diff line change @@ -66,6 +66,8 @@ func convertMessages(messages []types.Message) []anthropicsdk.MessageParam {
6666 result = append (result , convertUserMessage (msg ))
6767 case "assistant" :
6868 result = append (result , convertAssistantMessage (msg ))
69+ case "tool" :
70+ result = append (result , convertUserMessage (msg ))
6971 }
7072 }
7173
@@ -86,10 +88,19 @@ func convertUserMessage(msg types.Message) anthropicsdk.MessageParam {
8688 })
8789 case "tool_result" :
8890 if content .ToolResult != nil {
91+ // Wrap tool result content as a TextBlockParam
92+ toolResultContent := []anthropicsdk.ToolResultBlockParamContentUnion {
93+ {
94+ OfText : & anthropicsdk.TextBlockParam {
95+ Text : content .ToolResult .Content ,
96+ },
97+ },
98+ }
99+
89100 contentBlocks = append (contentBlocks , anthropicsdk.ContentBlockParamUnion {
90101 OfToolResult : & anthropicsdk.ToolResultBlockParam {
91102 ToolUseID : content .ToolResult .ToolUseID ,
92- Content : []anthropicsdk. ToolResultBlockParamContentUnion {} ,
103+ Content : toolResultContent ,
93104 IsError : anthropicsdk .Bool (content .ToolResult .IsError ),
94105 },
95106 })
You can’t perform that action at this time.
0 commit comments