What's Changed
Context
The Context class has been significantly refactored to achieve a more logical grouping of objects, including them only where they are needed and removing them where they are not. We also introduced a new Context interface class that should provide you with a distraction free overview of what the Context has to offer.
The refactoring results in slimmer contexts throughout the framework but also incurs some breaking changes:
- Some known Context methods were relocated to the 'uagents.communication' module including:
- Context.send_raw_exchange_envelope(...) which is now replaced by Communication.send_exchange_envelope(...) and slightly altered to accept envelopes and a list of endpoints
- Context.send_sync_message(...) is moved to uagents.communication as well and provides a practical usage example of the above method
- ctx.name, ctx.identifier and ctx.address are moved to ctx.agent (see uagents.agent.AgentRepresentation)
- ctx.wallet was removed from the Context: use agent.wallet instead
- ctx.send() and ctx.send_raw() no longer handle the actual http requests of sending the message, but only put the envelope in a queue which is constantly processed by the Dispenser (see uagents.communication)
- ctx.experimental_broadcast has been renamed to ctx.broadcast
Envelope
The schema_digest field has had the 'protocol' alias removed.
Storage
Storage has been unified with an interface class (StorageAPI) to prepare easier integration with other storage methods like ORM or DB adapters.
Dialogues
The experimental Dialogue class uagents.experimental.dialogues.Dialogue has also been updated in a few ways. Most notably:
- instantiation now only needs the name of the dialogue everything else was made optional
- the dialogue.storage property accepts the new StorageAPI compatible instances so to use the agents existing storage write storage=agent.storage, leaving it empty creates a new .json file for the dialogue
- dialogues are specifically started with the dialogue.start_dialogue() method
- a new dialogue.cleanup_interval property together with the existing dialogue.timeout property will give you more control over storage management
Commits
* feat(integration): Block time agents by qati in https://github.com/fetchai/uAgents/pull/352
* initial submission by chakka-guna-sekhar-venkata-chennaiah in https://github.com/fetchai/uAgents/pull/300
* feat(integration): Google tools integration by abhifetch in https://github.com/fetchai/uAgents/pull/303
* PICT - Mitochondria by BhavyamSanghavi in https://github.com/fetchai/uAgents/pull/358
* PICT- uAgent Alchemists by Prem07a in https://github.com/fetchai/uAgents/pull/351
* Added Integrated MakeTrip Project by ParasY1724 in https://github.com/fetchai/uAgents/pull/355
* Update README.md by devrajshetake in https://github.com/fetchai/uAgents/pull/346
* PICT Tech Wizards by FireFeast7 in https://github.com/fetchai/uAgents/pull/356
* feat(core): generalise dialogue storage solution by Archento in https://github.com/fetchai/uAgents/pull/367
* refactor(core): context stage 2 by Archento in https://github.com/fetchai/uAgents/pull/363
* refactor(core): dialogue cleanup task handling by Archento in https://github.com/fetchai/uAgents/pull/370
* feat(core): add persistent dialogue sessions by Archento in https://github.com/fetchai/uAgents/pull/371
* chore(example): fix agent examples for new context by Archento in https://github.com/fetchai/uAgents/pull/373
* chore(core): bump version to 0.12.0 by jrriehl in https://github.com/fetchai/uAgents/pull/372
New Contributors
* chakka-guna-sekhar-venkata-chennaiah made their first contribution in https://github.com/fetchai/uAgents/pull/300
* BhavyamSanghavi made their first contribution in https://github.com/fetchai/uAgents/pull/358
* Prem07a made their first contribution in https://github.com/fetchai/uAgents/pull/351
* ParasY1724 made their first contribution in https://github.com/fetchai/uAgents/pull/355
* devrajshetake made their first contribution in https://github.com/fetchai/uAgents/pull/346
* FireFeast7 made their first contribution in https://github.com/fetchai/uAgents/pull/356
**Full Changelog**: https://github.com/fetchai/uAgents/compare/v0.11.1...v0.12.0