MCPcopy Index your code
hub / github.com/docker/docker-agent / TestToolCalls

Function TestToolCalls

pkg/app/transcript/transcript_test.go:53–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

51}
52
53func TestToolCalls(t *testing.T) {
54 t.Parallel()
55 sess := session.New(
56 session.WithUserMessage("Hello"),
57 )
58 sess.AddMessage(&session.Message{
59 AgentName: "root",
60 Message: chat.Message{
61 Role: chat.MessageRoleAssistant,
62 Content: "Hello to you too",
63 ToolCalls: []tools.ToolCall{
64 {
65 Function: tools.FunctionCall{Name: "shell", Arguments: `{"cmd":"ls"}`},
66 },
67 },
68 },
69 })
70
71 sess.AddMessage(&session.Message{
72 AgentName: "",
73 Message: chat.Message{
74 Role: chat.MessageRoleTool,
75 Content: ".\n..",
76 },
77 })
78 content := PlainText(sess)
79
80 golden.Assert(t, content, "tool_calls.golden")
81}
82
83// ─── Document attachment rendering ───────────────────────────────────────────
84

Callers

nothing calls this directly

Calls 5

NewFunction · 0.92
WithUserMessageFunction · 0.92
PlainTextFunction · 0.85
AssertMethod · 0.80
AddMessageMethod · 0.65

Tested by

no test coverage detected