|
| 1 | +# This file was auto-generated by Fern from our API Definition. |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +import datetime as dt |
| 6 | +import typing |
| 7 | + |
| 8 | +from ....core.datetime_utils import serialize_datetime |
| 9 | +from ....core.pydantic_utilities import deep_union_pydantic_dicts, pydantic_v1 |
| 10 | + |
| 11 | + |
| 12 | +class ChatMessageWithPlaceholders_Chatmessage(pydantic_v1.BaseModel): |
| 13 | + role: str |
| 14 | + content: str |
| 15 | + type: typing.Literal["chatmessage"] = "chatmessage" |
| 16 | + |
| 17 | + def json(self, **kwargs: typing.Any) -> str: |
| 18 | + kwargs_with_defaults: typing.Any = { |
| 19 | + "by_alias": True, |
| 20 | + "exclude_unset": True, |
| 21 | + **kwargs, |
| 22 | + } |
| 23 | + return super().json(**kwargs_with_defaults) |
| 24 | + |
| 25 | + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: |
| 26 | + kwargs_with_defaults_exclude_unset: typing.Any = { |
| 27 | + "by_alias": True, |
| 28 | + "exclude_unset": True, |
| 29 | + **kwargs, |
| 30 | + } |
| 31 | + kwargs_with_defaults_exclude_none: typing.Any = { |
| 32 | + "by_alias": True, |
| 33 | + "exclude_none": True, |
| 34 | + **kwargs, |
| 35 | + } |
| 36 | + |
| 37 | + return deep_union_pydantic_dicts( |
| 38 | + super().dict(**kwargs_with_defaults_exclude_unset), |
| 39 | + super().dict(**kwargs_with_defaults_exclude_none), |
| 40 | + ) |
| 41 | + |
| 42 | + class Config: |
| 43 | + frozen = True |
| 44 | + smart_union = True |
| 45 | + extra = pydantic_v1.Extra.allow |
| 46 | + json_encoders = {dt.datetime: serialize_datetime} |
| 47 | + |
| 48 | + |
| 49 | +class ChatMessageWithPlaceholders_Placeholder(pydantic_v1.BaseModel): |
| 50 | + name: str |
| 51 | + type: typing.Literal["placeholder"] = "placeholder" |
| 52 | + |
| 53 | + def json(self, **kwargs: typing.Any) -> str: |
| 54 | + kwargs_with_defaults: typing.Any = { |
| 55 | + "by_alias": True, |
| 56 | + "exclude_unset": True, |
| 57 | + **kwargs, |
| 58 | + } |
| 59 | + return super().json(**kwargs_with_defaults) |
| 60 | + |
| 61 | + def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]: |
| 62 | + kwargs_with_defaults_exclude_unset: typing.Any = { |
| 63 | + "by_alias": True, |
| 64 | + "exclude_unset": True, |
| 65 | + **kwargs, |
| 66 | + } |
| 67 | + kwargs_with_defaults_exclude_none: typing.Any = { |
| 68 | + "by_alias": True, |
| 69 | + "exclude_none": True, |
| 70 | + **kwargs, |
| 71 | + } |
| 72 | + |
| 73 | + return deep_union_pydantic_dicts( |
| 74 | + super().dict(**kwargs_with_defaults_exclude_unset), |
| 75 | + super().dict(**kwargs_with_defaults_exclude_none), |
| 76 | + ) |
| 77 | + |
| 78 | + class Config: |
| 79 | + frozen = True |
| 80 | + smart_union = True |
| 81 | + extra = pydantic_v1.Extra.allow |
| 82 | + json_encoders = {dt.datetime: serialize_datetime} |
| 83 | + |
| 84 | + |
| 85 | +ChatMessageWithPlaceholders = typing.Union[ |
| 86 | + ChatMessageWithPlaceholders_Chatmessage, ChatMessageWithPlaceholders_Placeholder |
| 87 | +] |
0 commit comments