mindsdb icon indicating copy to clipboard operation
mindsdb copied to clipboard

Add A2A API support to configuration and Docker setup

Open dusvyat opened this issue 7 months ago • 0 comments

Description

Updated the release configuration to include A2A API with its own host and port. Adjusted the Dockerfile to expose the new A2A port and modified the entry point to enable the A2A API alongside existing APIs.

Fixes #issue_number

Type of change

(Please delete options that are not relevant)

  • [ ] 🐛 Bug fix (non-breaking change which fixes an issue)
  • [ ] ⚡ New feature (non-breaking change which adds functionality)
  • [ ] 📢 Breaking change (fix or feature that would cause existing functionality not to work as expected)
  • [ ] 📄 This change requires a documentation update

Verification Process

To ensure the changes are working as expected:

  1. start Docker

docker-compose down && docker-compose up -d

  1. Check logs to make sure A2A server started without error

docker logs mindsdb-mindsdb-1 | grep -i "a2a" | tail -20

  1. Run a command to the A2A server to check it is accessible
curl -X POST \
  "http://localhost:47338/a2a" \
  -H "Content-Type: application/json" \
  -H "Accept: text/event-stream" \
  -H "Cache-Control: no-cache" \
  -H "Connection: keep-alive" \
  -d '{
    "jsonrpc": "2.0",
    "id": "your-request-id",
    "method": "tasks/sendSubscribe",
    "params": {
      "id": "your-task-id",
      "sessionId": "your-session-id",
      "message": {
        "role": "user",
        "parts": [
          {"type": "text", "text": "What is the population of new york?"}
        ],
        "metadata": {
          "agentName": "my_agent_123"
        }
      },
      "acceptedOutputModes": ["text/plain"]
    }
  }' \
  --no-buffer

expected response (as agent is not setup) but it shows A2A server is handling the request as expected:


id: 261496245519040
event: message
data: {"jsonrpc":"2.0","id":"your-request-id","result":{"id":"your-task-id","artifact":{"parts":[{"type":"text","text":"Error connecting to MindsDB streaming API: 404 Client Error: NOT FOUND for url: http://localhost:47334/api/projects/mindsdb/agents/my_agent_123/completions/stream"}],"index":0,"append":false}}}

:  

id: 261496245518880
event: message
data: {"jsonrpc":"2.0","id":"your-request-id","result":{"id":"your-task-id","status":{"state":"completed","timestamp":"2025-05-28T10:40:46.962743"},"final":true}}

:  

Additional Media:

  • [ ] I have attached a brief loom video or screenshots showcasing the new functionality or change.

Checklist:

  • [x] My code follows the style guidelines(PEP 8) of MindsDB.
  • [x] I have appropriately commented on my code, especially in complex areas.
  • [ ] Necessary documentation updates are either made or tracked in issues.
  • [x] Relevant unit and integration tests are updated or added.

dusvyat avatar May 28 '25 07:05 dusvyat