Work IQ Übersicht über Agent-zu-Agent (A2A)

Das Agent-to-Agent-Protokoll (A2A) ermöglicht KI-Agenten die Kommunikation und Zusammenarbeit mit Work IQ. Agenten können autonom arbeiten und strukturierte Aufgaben anstelle einfacher API-Aufrufe mit Work IQ austauschen.

Entdecken Sie Work IQ A2A in der interaktiven Demo.

Protokollversion

Work IQ unterstützt sowohl A2A Version 1.0 als auch 0.3, die über den A2A-Version Anforderungsheader verteilt werden. Wenn der A2A-Version Header weggelassen wird, verwendet Work IQ aus Gründen der Abwärtskompatibilität standardmäßig 0,3. Verwenden Sie Version 1.0, indem Sie in Ihren Anforderungsheadern festlegen A2A-Version: 1.0 .

Authentifizierung

Work IQ A2A verwendet Microsoft Entra ID delegierte Authentifizierung. Weitere Informationen finden Sie in der Referenz zu Work IQ-API-Berechtigungen.

Agent-Ermittlung

Work IQ hostet Agentenkarten für seine verfügbaren Agenten am Standardendpunkt /.well-known/agent-card.json .

  • Für den Standard-Agent: https://workiq.svc.cloud.microsoft/a2a/.well-known/agent-card.json
  • Für einen bestimmten Agent: https://workiq.svc.cloud.microsoft/a2a/{agent-id}/.well-known/agent-card.json

Beispiel

Anforderung

GET https://workiq.svc.cloud.microsoft/a2a/.well-known/agent-card.json
Authorization: Bearer {access-token}
A2A-Version: 1.0

Antwort

{
  "name": "Microsoft Copilot",
  "description": "An AI-powered assistant that helps users with business-related tasks such as managing emails, scheduling meetings, and organizing documents.",
  "version": "1.0.0",
  "documentationUrl": null,
  "iconUrl": "https://copilot.microsoft.com",
  "supportedInterfaces": [
    {
      "url": "https://workiq.svc.cloud.microsoft/a2a",
      "protocolBinding": "JSONRPC",
      "tenant": null,
      "protocolVersion": "1.0"
    }
  ],
  "capabilities": {
    "streaming": true,
    "pushNotifications": false,
    "extensions": [],
    "extendedAgentCard": null
  },
  "provider": {
    "organization": "Microsoft",
    "url": "https://www.microsoft.com"
  },
  "skills": [],
  "defaultInputModes": [
    "text"
  ],
  "defaultOutputModes": [
    "text"
  ],
  "securitySchemes": null,
  "securityRequirements": null,
  "signatures": null
}

Nachrichten senden

Work IQ unterstützt das Senden von Nachrichten im synchronen Modus (SendMessage) und im Streamingmodus (SendStreamingMessage).

Beispiel

Anforderung

POST https://workiq.svc.cloud.microsoft/a2a/
Authorization: Bearer {access-token}
Content-Type: application/json
A2A-Version: 1.0

{
  "jsonrpc": "2.0",
  "id": "<request-guid>",
  "method": "SendMessage",
  "params": {
    "message": {
      "role": "ROLE_USER",
      "messageId": "<message-guid>",
      "parts": [
        {
          "text": "What meetings do I have today?"
        }
      ],
      "metadata": {
        "Location": {
          "timeZoneOffset": -480,
          "timeZone": "America/Los_Angeles"
        }
      }
    }
  }
}

Hinweis

Der A2A-Version: 1.0 Header ist erforderlich, um v1.0-Methodennamen (SendMessage) zu verwenden. Wenn Sie sie weglassen, wird standardmäßig v0.3 verwendet.

Antwort

{
  "jsonrpc": "2.0",
  "id": "<request-guid>",
  "result": {
    "task": {
      "id": "<task-id>",
      "contextId": "ctx-1",
      "status": {
        "state": "TASK_STATE_COMPLETED"
      },
      "artifacts": [
        {
          "artifactId": "<artifact-id>",
          "name": "Answer",
          "parts": [
            {
              "text": "Today you have: 9 AM standup, 11 AM review with Dana, 2 PM customer call."
            }
          ]
        }
      ]
    }
  }
}

Konversationen mit Mehrfachdurchläufen

Übergeben Sie die contextId Antwort aus der vorherigen Antwort in der nächsten Nachricht:

{
  "jsonrpc": "2.0",
  "id": "<request-guid-2>",
  "method": "SendMessage",
  "params": {
    "message": {
      "role": "ROLE_USER",
      "messageId": "<message-guid-2>",
      "contextId": "ctx-1",
      "parts": [
        {
          "text": "Tell me more about the 2 PM customer call."
        }
      ]
    }
  }
}

Vorgangsverwaltung

Work IQ unterstützt die Methoden GetTask, CancelTask und SubscribeToTask zum Verwalten von Aufgaben.

Beispiel

Anforderung

POST https://workiq.svc.cloud.microsoft/a2a/
Authorization: Bearer {access-token}
Content-Type: application/json
A2A-Version: 1.0

{
  "jsonrpc": "2.0",
  "id": "<request-guid-3>",
  "method": "GetTask",
  "params": {
    "id": "<task-id>"
  }
}

Antwort

{
  "jsonrpc": "2.0",
  "id": "<request-guid-3>",
  "result": {
    "id": "<task-id>",
    "contextId": "<ctx-id>",
    "status": {
      "state": "TASK_STATE_COMPLETED",
      "message": {
        "role": "ROLE_AGENT",
        "parts": [],
        "messageId": "<msg-id>",
        "contextId": "<ctx-id>"
      },
      "timestamp": "2026-06-02T14:58:31.3516247+00:00"
    },
    "artifacts": [
      {
        "artifactId": "<artifact-id>",
        "name": "Answer",
        "parts": [
          {
            "text": "Good afternoon! \uD83D\uDE0A  \n\nHope your day is going well so far. What can I help you with today?"
          }
        ]
      }
    ]
  }
}