Repository navigation
docs: add HTTP/JSON-RPC examples to a2a-agents - #742
Conversation
|
Heads up on the red |
04598ef to
fa7119e
Compare
Signed-off-by: Moritz Schmitz von Hülst <mschmitzvonhuelst@gmail.com>
fa7119e to
eecbc5a
Compare
|
Rebased onto the latest main (no content changes — still just the two a2a-agents.md files, 72 added lines). Content checks are green; the red deploy remains the expected fork-secret failure from my note above. Ready for review. |
Rachael-Graham
left a comment
There was a problem hiding this comment.
Thanks for this. I ran both curl calls as written against a kagent v1.0.1 cluster: the card lists the JSON-RPC interface first, and SendMessage returns a completed task with the answer in artifacts and the contextId you describe. The comments below are style only, and each one applies to the main copy too.
|
|
||
| {{< reuse "kagent-docs/snippets/grpcurl-prerequisites.md" >}} | ||
|
|
||
| The examples in the rest of this page use `grpcurl` to call the gRPC transport. The controller serves the same service over HTTP/JSON-RPC on the same port `8083`; the `Call it over HTTP` section near the end of this page shows the equivalent `curl` calls. |
There was a problem hiding this comment.
The docs avoid spatial pointers such as "near the end of this page", and this sentence joins two clauses with a semicolon. Suggest: "To call the same service over HTTP/JSON-RPC with curl, see Call it over HTTP."
|
|
||
| A tool approval works in the same way, but the agent sends `tool_approval_request`, and the caller answers with `tool_approval_response`. For the pause kinds, the approval model, and what a nested agent's pause looks like, see [Human in the loop]({{< link path="agents/human-in-the-loop" >}}). | ||
|
|
||
| ## Call it over HTTP |
There was a problem hiding this comment.
"it" in the heading has no antecedent for a reader who lands here from the table of contents, and the intro below it says "so far" and "below", which the style guide avoids. Suggest a heading such as "Call an agent over HTTP/JSON-RPC", and an intro that names the gRPC examples instead of pointing at them.
| curl -s localhost:8083/agents/kagent/my-first-agent/.well-known/agent-card.json | ||
| ``` | ||
|
|
||
| The card advertises the JSON-RPC URL first, then the gRPC interface. Point every JSON-RPC call at the first `supportedInterfaces` entry, whose `url` is `http://<controller>/agents/<namespace>/<name>`. A hand-assembled HTTP call sets the Agent in the URL and needs no `tenant`; a `tenant` that an HTTP request does supply must match its URL. |
There was a problem hiding this comment.
"the first supportedInterfaces entry" depends on order. Name it by its value instead, for example "the entry whose protocolBinding is JSONRPC" (I confirmed on a v1.0.1 cluster that this entry carries the /agents/<namespace>/<name> URL). The semicolon before "a tenant that an HTTP request does supply" should also become a full stop.
|
|
||
| The reply is the same task the `SendMessage` gRPC call returns: the answer arrives in `artifacts`, and `contextId` is the Session ID to repeat on a follow-up message. | ||
|
|
||
| 3. The JSON-RPC surface uses the pinned upstream A2A v1 SDK method names: `SendMessage`, `SendStreamingMessage` (streams events over the same `POST` endpoint), `GetTask`, `ListTasks`, `CancelTask`, `SubscribeToTask`, and `GetExtendedAgentCard`. Those are the v1 names for what older A2A clients called `message/send`, `message/stream`, `tasks/get`, `tasks/list`, `tasks/cancel`, and `tasks/resubscribe`. |
There was a problem hiding this comment.
This step lists method names but asks the reader to do nothing, so it reads better as a short paragraph, or a table that maps each v1 method to its older name, after the steps. "pinned upstream A2A v1 SDK" is also internal phrasing, and "A2A v1 method names" says the same thing.
…t-dev#538) Signed-off-by: Moritz Schmitz von Hülst <mschmitzvonhuelst@gmail.com>
Rachael-Graham
left a comment
There was a problem hiding this comment.
lgtm, thank you as always!
Closes #538
examples/a2a-agents.mdcalls the kagent A2A service exclusively withgrpcurland lists the HTTP/JSON-RPC endpoints (agent card + JSON-RPCPOST) only in a table. A reader who wants to use an ordinary HTTP client has nothing to follow: nocurlexample for reading the card, and no JSON-RPC request body to copy.This adds a Call it over HTTP section showing the equivalent
curlcalls, grounded in the upstream endpoint contract (docs/architecture/a2a-transports.mdonkagent-dev/kagentv1.0.0-alpha13):GET /agents/{namespace}/{name}/.well-known/agent-card.json2.0request toPOST /agents/{namespace}/{name}, mirroring the existingSendMessageexample (messageId/role/parts)Applies to the
latestandmaincopies of the page, which are kept identical.How to Test
hugo --config hugo.yaml --gc --minify grep -c "Call it over HTTP" docs-site/public/kagent/latest/examples/a2a-agents/index.htmlBuilds cleanly (956 pages) and the new section renders in the built HTML for both
latestandmain.