MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / Send

Method Send

internal/agent/agent.go:63–69  ·  view source on GitHub ↗

Send appends a user message and runs the tool-use loop until the model stops requesting tools (or MaxTurns is reached). Returns the final assistant text concatenation, which is printed live as it arrives for the root agent and silently accumulated for subagents.

(ctx context.Context, prompt string)

Source from the content-addressed store, hash-verified

61// assistant text concatenation, which is printed live as it arrives for
62// the root agent and silently accumulated for subagents.
63func (a *Agent) Send(ctx context.Context, prompt string) (string, error) {
64 a.messages = append(a.messages, api.Message{
65 Role: api.RoleUser,
66 Content: []api.Block{{Type: api.BlockText, Text: prompt}},
67 })
68 return a.loop(ctx)
69}
70
71func (a *Agent) loop(ctx context.Context) (string, error) {
72 var finalText strings.Builder

Callers

nothing calls this directly

Calls 1

loopMethod · 0.95

Tested by

no test coverage detected