Skip to content

Commit c31b23a

Browse files
committed
more typing, comment
1 parent d087dc0 commit c31b23a

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/agentex/lib/sdk/fastacp/impl/temporal_acp.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from contextlib import asynccontextmanager
55

66
from fastapi import FastAPI
7+
from temporalio.converter import PayloadCodec
78

89
from agentex.lib.types.acp import (
910
SendEventParams,
@@ -31,7 +32,7 @@ def __init__(
3132
temporal_task_service: TemporalTaskService | None = None,
3233
plugins: list[Any] | None = None,
3334
interceptors: list[Any] | None = None,
34-
payload_codec: Any | None = None,
35+
payload_codec: PayloadCodec | None = None,
3536
):
3637
super().__init__()
3738
self._temporal_task_service = temporal_task_service
@@ -42,7 +43,7 @@ def __init__(
4243

4344
@classmethod
4445
@override
45-
def create(cls, temporal_address: str, plugins: list[Any] | None = None, interceptors: list[Any] | None = None, payload_codec: Any | None = None) -> "TemporalACP":
46+
def create(cls, temporal_address: str, plugins: list[Any] | None = None, interceptors: list[Any] | None = None, payload_codec: PayloadCodec | None = None) -> "TemporalACP":
4647
logger.info("Initializing TemporalACP instance")
4748

4849
# Create instance without temporal client initially

src/agentex/lib/types/fastacp.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class TemporalACPConfig(AsyncACPConfig):
5050
temporal_address: The address of the temporal server
5151
plugins: List of Temporal client plugins
5252
interceptors: List of Temporal worker interceptors
53+
payload_codec: Optional ``temporalio.converter.PayloadCodec`` for
54+
encoding/decoding payloads (e.g. encryption, compression). NOTE:
55+
this only configures the ACP (client) side. The worker side must
56+
be configured separately via ``AgentexWorker(payload_codec=...)``
57+
with the SAME codec, or decode will fail at runtime.
5358
"""
5459

5560
type: Literal["temporal"] = Field(default="temporal", frozen=True)

0 commit comments

Comments
 (0)