Skip to content

Commit 3eda07e

Browse files
authored
fix: cleanup json formatting (#605)
# Description Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Follow the [`CONTRIBUTING` Guide](https://github.com/google/A2A/blob/main/CONTRIBUTING.md). - [ ] Make your Pull Request title in the <https://www.conventionalcommits.org/> specification. - [ ] Ensure the tests and linter pass (Run `nox -s format` from the repository root to format) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent f99d96a commit 3eda07e

File tree

1 file changed

+74
-72
lines changed

1 file changed

+74
-72
lines changed

docs/specification.md

Lines changed: 74 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,87 +1399,89 @@ _(Server closes the SSE connection after the `final:true` event)._
13991399

14001400
4. **Server processes the new input and responds (e.g., task completed or more input needed):**
14011401

1402-
```json
1403-
{
1404-
"jsonrpc": "2.0",
1405-
"id": "req-004",
1406-
"result": {
1407-
"id": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1408-
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1409-
"status": {
1410-
"state": "completed",
1411-
"message": {
1412-
"role": "agent",
1413-
"parts": [
1414-
{
1415-
"type": "text",
1416-
"text": "Okay, I've found a flight for you. Confirmation XYZ123. Details are in the artifact."
1417-
}
1418-
]
1419-
},
1420-
},
1421-
"artifacts": [
1422-
{
1423-
"artifactId":"9b6934dd-37e3-4eb1-8766-962efaab63a1",
1424-
"name": "FlightItinerary.json",
1425-
"parts": [
1426-
{
1427-
"type": "data",
1428-
"data": {
1429-
"confirmationId": "XYZ123",
1430-
"from": "JFK",
1431-
"to": "LHR",
1432-
"departure": "2024-10-10T18:00:00Z",
1433-
"arrival": "2024-10-11T06:00:00Z",
1434-
"returnDeparture": "..."
1402+
1403+
```json
1404+
{
1405+
"jsonrpc": "2.0",
1406+
"id": "req-004",
1407+
"result": {
1408+
"id": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1409+
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1410+
"status": {
1411+
"state": "completed",
1412+
"message": {
1413+
"role": "agent",
1414+
"parts": [
1415+
{
1416+
"type": "text",
1417+
"text": "Okay, I've found a flight for you. Confirmation XYZ123. Details are in the artifact."
1418+
}
1419+
]
1420+
},
1421+
},
1422+
"artifacts": [
1423+
{
1424+
"artifactId":"9b6934dd-37e3-4eb1-8766-962efaab63a1",
1425+
"name": "FlightItinerary.json",
1426+
"parts": [
1427+
{
1428+
"type": "data",
1429+
"data": {
1430+
"confirmationId": "XYZ123",
1431+
"from": "JFK",
1432+
"to": "LHR",
1433+
"departure": "2024-10-10T18:00:00Z",
1434+
"arrival": "2024-10-11T06:00:00Z",
1435+
"returnDeparture": "..."
1436+
}
14351437
}
1436-
}
1437-
]
1438-
}
1439-
],
1440-
"history": [
1441-
{
1438+
]
1439+
}
1440+
],
1441+
"history": [
1442+
{
1443+
"role": "user",
1444+
"parts": [
1445+
{
1446+
"type": "text",
1447+
"text": "I'd like to book a flight."
1448+
}
1449+
],
1450+
"messageId": "c53ba666-3f97-433c-a87b-6084276babe2",
1451+
"taskId": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1452+
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4"
1453+
},
1454+
{
1455+
"role": "agent",
1456+
"parts": [
1457+
{
1458+
"type": "text",
1459+
"text": "Sure, I can help with that! Where would you like to fly to, and from where? Also, what are your preferred travel dates?"
1460+
}
1461+
],
1462+
"messageId": "c2e1b2dd-f200-4b04-bc22-1b0c65a1aad2",
1463+
"taskId": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1464+
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4"
1465+
},
1466+
{
14421467
"role": "user",
14431468
"parts": [
14441469
{
14451470
"type": "text",
1446-
"text": "I'd like to book a flight."
1471+
"text": "I want to fly from New York (JFK) to London (LHR) around October 10th, returning October 17th."
14471472
}
14481473
],
1449-
"messageId": "c53ba666-3f97-433c-a87b-6084276babe2",
1474+
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
14501475
"taskId": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1451-
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4"
1452-
},
1453-
{
1454-
"role": "agent",
1455-
"parts": [
1456-
{
1457-
"type": "text",
1458-
"text": "Sure, I can help with that! Where would you like to fly to, and from where? Also, what are your preferred travel dates?"
1459-
}
1460-
],
1461-
"messageId": "c2e1b2dd-f200-4b04-bc22-1b0c65a1aad2",
1462-
"taskId": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1463-
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4"
1464-
},
1465-
{
1466-
"role": "user",
1467-
"parts": [
1468-
{
1469-
"type": "text",
1470-
"text": "I want to fly from New York (JFK) to London (LHR) around October 10th, returning October 17th."
1471-
}
1472-
],
1473-
"contextId": "c295ea44-7543-4f78-b524-7a38915ad6e4",
1474-
"taskId": "3f36680c-7f37-4a5f-945e-d78981fafd36",
1475-
"messageId": "0db1d6c4-3976-40ed-b9b8-0043ea7a03d3"
1476-
}
1477-
],
1478-
"kind": "task",
1479-
"metadata": {}
1476+
"messageId": "0db1d6c4-3976-40ed-b9b8-0043ea7a03d3"
1477+
}
1478+
],
1479+
"kind": "task",
1480+
"metadata": {}
1481+
}
14801482
}
1481-
}
1482-
```
1483+
```
1484+
14831485

14841486
### 9.4. Push Notification Setup and Usage
14851487

0 commit comments

Comments
 (0)