uAgents
uAgents copied to clipboard
feat(core): add message endpoint for inspector
trafficstars
Received and sent local messages can now be retrieved through http://localhost:<PORT>/messages endpoint
We can probably add a serialiser to the Envelope History List as well that automatically returns the sorted list when we call .model_dump_json()
class EnvelopeHistory(BaseModel):
envelopes: List[EnvelopeHistoryEntry]
@field_serializer("envelopes", when_used="json")
def serialize_envelopes_in_order(
self, envelopes: List[EnvelopeHistoryEntry], _info
):
return sorted(envelopes, key=lambda e: e.timestamp)
- [x] please also return the agent address from the
agent_infoendpoint