Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): context stage 2 #363

Merged
merged 37 commits into from
May 22, 2024
Merged

refactor(core): context stage 2 #363

merged 37 commits into from
May 22, 2024

Conversation

Archento
Copy link
Member

@Archento Archento commented May 7, 2024

List of changes:

  • includes (and depends on) changes from refactor(core): context stage 1 #349
  • add communication module for handling sending of messages
  • add Dispenser class in communication module
  • add new background task in agent.py for message dispensing
  • add new Context interface / Abstract Base Class to be used by the handlers
  • split existing Context into two types:
    • InternalContext: for supporting pro-active behaviour (on_event, on_interval)
    • ExternalContext: for supporting re-active behaviour (on_message)
  • drop protocol discovery feature
  • remove duplicate code
  • remove background_tasks set

@Archento
Copy link
Member Author

Archento commented May 7, 2024

Sync messages and queries still need to be done but it works for most of the examples and should be ready for initial feedback.

python/src/uagents/agent.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jrriehl jrriehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few remaining subtleties to address, but overall this looks great.

@Archento Archento marked this pull request as ready for review May 14, 2024 16:03
@Archento Archento requested a review from jrriehl May 14, 2024 16:24
@Archento Archento linked an issue May 16, 2024 that may be closed by this pull request
@Archento Archento linked an issue May 16, 2024 that may be closed by this pull request
python/src/uagents/communication.py Outdated Show resolved Hide resolved
python/src/uagents/communication.py Show resolved Hide resolved
python/src/uagents/communication.py Show resolved Hide resolved
python/src/uagents/communication.py Show resolved Hide resolved
python/src/uagents/agent.py Show resolved Hide resolved
python/src/uagents/context.py Show resolved Hide resolved
python/src/uagents/context.py Show resolved Hide resolved
python/src/uagents/context.py Show resolved Hide resolved
python/src/uagents/context.py Show resolved Hide resolved
@Archento Archento dismissed Dacksus’s stale review May 22, 2024 16:23

The raised issues are valid and will be revisited in the next iteration / a separate issue.

Copy link
Contributor

@jrriehl jrriehl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Archento Archento merged commit 65f2d98 into main May 22, 2024
9 checks passed
@Archento Archento deleted the refactor/context_stage_2 branch May 22, 2024 16:41
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.

Revisit agents background tasks concept Revisit schema_digest Field name in Envelope
3 participants