|
10 | 10 | from .session import Session |
11 | 11 | from .._models import BaseModel |
12 | 12 | from .message_part import MessagePart |
| 13 | +from .shared.unknown_error import UnknownError |
| 14 | +from .shared.provider_auth_error import ProviderAuthError |
13 | 15 |
|
14 | 16 | __all__ = [ |
15 | 17 | "EventListResponse", |
|
33 | 35 | "EventSessionError", |
34 | 36 | "EventSessionErrorProperties", |
35 | 37 | "EventSessionErrorPropertiesError", |
36 | | - "EventSessionErrorPropertiesErrorProviderAuthError", |
37 | | - "EventSessionErrorPropertiesErrorProviderAuthErrorData", |
38 | | - "EventSessionErrorPropertiesErrorUnknownError", |
39 | | - "EventSessionErrorPropertiesErrorUnknownErrorData", |
40 | 38 | "EventSessionErrorPropertiesErrorMessageOutputLengthError", |
41 | 39 | ] |
42 | 40 |
|
@@ -141,40 +139,14 @@ class EventSessionDeleted(BaseModel): |
141 | 139 | type: Literal["session.deleted"] |
142 | 140 |
|
143 | 141 |
|
144 | | -class EventSessionErrorPropertiesErrorProviderAuthErrorData(BaseModel): |
145 | | - message: str |
146 | | - |
147 | | - provider_id: str = FieldInfo(alias="providerID") |
148 | | - |
149 | | - |
150 | | -class EventSessionErrorPropertiesErrorProviderAuthError(BaseModel): |
151 | | - data: EventSessionErrorPropertiesErrorProviderAuthErrorData |
152 | | - |
153 | | - name: Literal["ProviderAuthError"] |
154 | | - |
155 | | - |
156 | | -class EventSessionErrorPropertiesErrorUnknownErrorData(BaseModel): |
157 | | - message: str |
158 | | - |
159 | | - |
160 | | -class EventSessionErrorPropertiesErrorUnknownError(BaseModel): |
161 | | - data: EventSessionErrorPropertiesErrorUnknownErrorData |
162 | | - |
163 | | - name: Literal["UnknownError"] |
164 | | - |
165 | | - |
166 | 142 | class EventSessionErrorPropertiesErrorMessageOutputLengthError(BaseModel): |
167 | 143 | data: object |
168 | 144 |
|
169 | 145 | name: Literal["MessageOutputLengthError"] |
170 | 146 |
|
171 | 147 |
|
172 | 148 | EventSessionErrorPropertiesError: TypeAlias = Annotated[ |
173 | | - Union[ |
174 | | - EventSessionErrorPropertiesErrorProviderAuthError, |
175 | | - EventSessionErrorPropertiesErrorUnknownError, |
176 | | - EventSessionErrorPropertiesErrorMessageOutputLengthError, |
177 | | - ], |
| 149 | + Union[ProviderAuthError, UnknownError, EventSessionErrorPropertiesErrorMessageOutputLengthError], |
178 | 150 | PropertyInfo(discriminator="name"), |
179 | 151 | ] |
180 | 152 |
|
|
0 commit comments