Skip to content

[BUG] Actor Method don't support custom object #795

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

Open
heavenwing opened this issue Mar 27, 2025 · 0 comments
Open

[BUG] Actor Method don't support custom object #795

heavenwing opened this issue Mar 27, 2025 · 0 comments
Labels
kind/bug Something isn't working

Comments

@heavenwing
Copy link

Expected Behavior

my actor interface defines below:

from abc import abstractmethod

from dapr.actor import ActorInterface, actormethod

from common_models.agent import ReportGuideAgentResult


class ReportGuideAgentActorInterface(ActorInterface):
    @abstractmethod
    @actormethod(name="Answer")
    async def answer(self, user_input: str) -> ReportGuideAgentResult: ...

Actual Behavior

But got a ERR_ACTOR_INVOKE_METHOD error: "ReportGuideAgentResult is not JSON serializable"

I have to change return type into str, and serialize it in my Actor class, and deserialize it in my Client class.

VERSION is 1.15

@heavenwing heavenwing added the kind/bug Something isn't working label Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant