main
1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
3from typing import List, Union
4from typing_extensions import Literal, Annotated, TypeAlias
5
6from ..._utils import PropertyInfo
7from ..._models import BaseModel
8from .text_content import TextContent
9from .summary_text_content import SummaryTextContent
10from .computer_screenshot_content import ComputerScreenshotContent
11from ..responses.response_input_file import ResponseInputFile
12from ..responses.response_input_text import ResponseInputText
13from ..responses.response_input_image import ResponseInputImage
14from ..responses.response_output_text import ResponseOutputText
15from ..responses.response_output_refusal import ResponseOutputRefusal
16
17__all__ = ["Message", "Content", "ContentReasoningText"]
18
19
20class ContentReasoningText(BaseModel):
21 text: str
22 """The reasoning text from the model."""
23
24 type: Literal["reasoning_text"]
25 """The type of the reasoning text. Always `reasoning_text`."""
26
27
28Content: TypeAlias = Annotated[
29 Union[
30 ResponseInputText,
31 ResponseOutputText,
32 TextContent,
33 SummaryTextContent,
34 ContentReasoningText,
35 ResponseOutputRefusal,
36 ResponseInputImage,
37 ComputerScreenshotContent,
38 ResponseInputFile,
39 ],
40 PropertyInfo(discriminator="type"),
41]
42
43
44class Message(BaseModel):
45 id: str
46 """The unique ID of the message."""
47
48 content: List[Content]
49 """The content of the message"""
50
51 role: Literal["unknown", "user", "assistant", "system", "critic", "discriminator", "developer", "tool"]
52 """The role of the message.
53
54 One of `unknown`, `user`, `assistant`, `system`, `critic`, `discriminator`,
55 `developer`, or `tool`.
56 """
57
58 status: Literal["in_progress", "completed", "incomplete"]
59 """The status of item.
60
61 One of `in_progress`, `completed`, or `incomplete`. Populated when items are
62 returned via API.
63 """
64
65 type: Literal["message"]
66 """The type of the message. Always set to `message`."""