Skip to content

Conversation

NishantSrivastava81
Copy link

Fix: Add Pydantic Model Reconstruction for A2A Framework Compatibility

Problem:
The existing a2a-redis implementations (both RedisStreamsEventQueue and RedisPubSubEventQueue) serialize Pydantic models to JSON correctly but only return raw dictionaries during deserialization. The A2A framework's EventConsumer expects actual Pydantic model instances, not dictionaries.

This causes the A2A framework's EventConsumer to hang indefinitely during event processing. Upon dequeue, only raw Python dictionaries are returned instead of reconstructing the original Pydantic model instances. The A2A framework's EventConsumer.consume_all() method relies on isinstance() checks and attribute access on Pydantic models to determine when to stop consuming events.

Changes:

  • New model_utils.py with serialization helpers
  • Updated Redis Streams queue for model reconstruction
  • Updated Redis Pub/Sub queue for model reconstruction

Fixes #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventConsumer hanging due to missing Pydantic model reconstruction in Redis queues

1 participant