mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-30 12:20:57 +08:00
41 lines
1.1 KiB
Python
41 lines
1.1 KiB
Python
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
|
|
from __future__ import annotations
|
|
from .chatmessagecontentitem import (
|
|
ChatMessageContentItem,
|
|
ChatMessageContentItemTypedDict,
|
|
)
|
|
from openrouter.types import BaseModel
|
|
from openrouter.utils import validate_const
|
|
import pydantic
|
|
from pydantic.functional_validators import AfterValidator
|
|
from typing import List, Literal, Optional, Union
|
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
|
|
|
|
UserMessageContentTypedDict = TypeAliasType(
|
|
"UserMessageContentTypedDict", Union[str, List[ChatMessageContentItemTypedDict]]
|
|
)
|
|
|
|
|
|
UserMessageContent = TypeAliasType(
|
|
"UserMessageContent", Union[str, List[ChatMessageContentItem]]
|
|
)
|
|
|
|
|
|
class UserMessageTypedDict(TypedDict):
|
|
content: UserMessageContentTypedDict
|
|
role: Literal["user"]
|
|
name: NotRequired[str]
|
|
|
|
|
|
class UserMessage(BaseModel):
|
|
content: UserMessageContent
|
|
|
|
ROLE: Annotated[
|
|
Annotated[Literal["user"], AfterValidator(validate_const("user"))],
|
|
pydantic.Field(alias="role"),
|
|
] = "user"
|
|
|
|
name: Optional[str] = None
|