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

using protocols for message handler decorated functions #4046

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MohMaz
Copy link
Contributor

@MohMaz MohMaz commented Nov 3, 2024

Why are these changes needed?

Addressing a To Do item that thought might help solving #3839 but still facing same issue.

Related issue number

Checks

Signed-off-by: Mohammad Mazraeh <[email protected]>
@MohMaz MohMaz changed the title using protocols, stil getting error using protocols for message handler decorated functions Nov 3, 2024
@@ -47,13 +47,19 @@ class MessageHandler(Protocol[AgentT, ReceivesT, ProducesT]): # type: ignore
async def __call__(agent_instance: AgentT, message: ReceivesT, ctx: MessageContext) -> ProducesT: ...


# NOTE: this works on concrete types and not inheritance
# TODO: Use a protocol for the outer function to check checked arg names
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jackgerrits @ekzhu I addressed this TODO but we're still facing same issue. Any guidance you might be able to provide?

@MohMaz MohMaz self-assigned this Nov 4, 2024
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.

1 participant