Documentation
¶
Overview ¶
Package delegate is for Go agents on Lagrange that call other addresses. Calls made with Interceptor carry the agent's token, so Lagrange knows who is calling, and the platform task the agent is working on, so the call shows up nested under that task in the task tree and the live graph.
exec = delegate.Executor(exec) // remember the platform task of each execution client, _ := a2aclient.NewFromCard(ctx, card, a2aclient.WithCallInterceptors(delegate.Interceptor(token))) client.SendMessage(ctx, req) // ctx from Execute
Index ¶
Constants ¶
const HeaderTask = "Lagrange-Task"
HeaderTask carries the platform task an agent is working on: the relay sets it on requests to agents, and Interceptor sends it back on the agent's own calls.
const TagsKey = "https://threeagents.dev/ext/tags/v1"
TagsKey in a message's metadata holds the sender's tags for it, {"name": "value"}: short strings (up to 16, names up to 64 and values up to 256 characters) that the activity log records with the task, as data.tags of the entry that created it, so any client can group and label tasks (a subtask ID, a ticket, a customer).
Variables ¶
This section is empty.
Functions ¶
func Executor ¶
func Executor(exec a2asrv.AgentExecutor) a2asrv.AgentExecutor
Executor wraps exec so that the platform task of each execution (the Lagrange-Task header the relay sends) is in the context Execute gets.
func Interceptor ¶
func Interceptor(token string) a2aclient.CallInterceptor
Interceptor authenticates calls with token (empty: anonymous) and passes on the platform task from ctx.
Types ¶
This section is empty.