Skip to content

Commit

Permalink
feat: allow setting session_id in ctx.send
Browse files Browse the repository at this point in the history
  • Loading branch information
jrriehl committed Feb 20, 2024
1 parent 173e9d9 commit f503bd6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/src/uagents/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ async def send(
self,
destination: str,
message: Model,
session_id: Optional[uuid.UUID] = None,
timeout: Optional[int] = DEFAULT_ENVELOPE_TIMEOUT_SECONDS,
) -> MsgStatus:
"""
Expand All @@ -325,6 +326,7 @@ async def send(
message.json(),
schema_digest,
message_type=type(message),
session_id=session_id,
timeout=timeout,
)

Expand Down Expand Up @@ -377,6 +379,7 @@ async def send_raw(
json_message: JsonStr,
schema_digest: str,
message_type: Optional[Type[Model]] = None,
session_id: Optional[uuid.UUID] = None,
timeout: Optional[int] = DEFAULT_ENVELOPE_TIMEOUT_SECONDS,
) -> MsgStatus:
"""
Expand Down Expand Up @@ -471,7 +474,7 @@ async def send_raw(
json_message,
logger=self._logger,
timeout=timeout,
session_id=self._session,
session_id=session_id or self._session,
)

@staticmethod
Expand Down

0 comments on commit f503bd6

Please sign in to comment.