Skip to content

Commit

Permalink
add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
RLKRo committed Nov 13, 2024
1 parent c22a98c commit e6a6a34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chatsky/core/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ class Context(BaseModel):
"""

origin_interface: Optional[str] = Field(default=None)
"""
Name of the interface that produced the first request in this context.
"""

@classmethod
def init(cls, start_label: AbsoluteNodeLabelInitTypes, id: Optional[Union[UUID, int, str]] = None):
Expand Down
11 changes: 11 additions & 0 deletions chatsky/core/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,19 @@ class MediaGroup(Attachment):


class Origin(BaseModel):
"""
Denotes the origin of the message.
"""

message: Optional[Any] = None
"""
Original data that the message is created from.
E.g. telegram update.
"""
interface: Optional[str] = None
"""
Name of the interface that produced the message.
"""

@field_serializer("message", when_used="json")
def pickle_serialize_message(self, value):
Expand Down

0 comments on commit e6a6a34

Please sign in to comment.