|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from typing import List, Optional |
| 4 | +from typing_extensions import Literal |
| 5 | + |
| 6 | +from ...._models import BaseModel |
| 7 | +from .conversation_item_content import ConversationItemContent |
| 8 | + |
| 9 | +__all__ = ["ConversationItemWithReference"] |
| 10 | + |
| 11 | + |
| 12 | +class ConversationItemWithReference(BaseModel): |
| 13 | + id: Optional[str] = None |
| 14 | + """ |
| 15 | + For an item of type (`message` | `function_call` | `function_call_output`) this |
| 16 | + field allows the client to assign the unique ID of the item. It is not required |
| 17 | + because the server will generate one if not provided. |
| 18 | +
|
| 19 | + For an item of type `item_reference`, this field is required and is a reference |
| 20 | + to any item that has previously existed in the conversation. |
| 21 | + """ |
| 22 | + |
| 23 | + arguments: Optional[str] = None |
| 24 | + """The arguments of the function call (for `function_call` items).""" |
| 25 | + |
| 26 | + call_id: Optional[str] = None |
| 27 | + """ |
| 28 | + The ID of the function call (for `function_call` and `function_call_output` |
| 29 | + items). If passed on a `function_call_output` item, the server will check that a |
| 30 | + `function_call` item with the same ID exists in the conversation history. |
| 31 | + """ |
| 32 | + |
| 33 | + content: Optional[List[ConversationItemContent]] = None |
| 34 | + """The content of the message, applicable for `message` items. |
| 35 | +
|
| 36 | + - Message items of role `system` support only `input_text` content |
| 37 | + - Message items of role `user` support `input_text` and `input_audio` content |
| 38 | + - Message items of role `assistant` support `text` content. |
| 39 | + """ |
| 40 | + |
| 41 | + name: Optional[str] = None |
| 42 | + """The name of the function being called (for `function_call` items).""" |
| 43 | + |
| 44 | + object: Optional[Literal["realtime.item"]] = None |
| 45 | + """Identifier for the API object being returned - always `realtime.item`.""" |
| 46 | + |
| 47 | + output: Optional[str] = None |
| 48 | + """The output of the function call (for `function_call_output` items).""" |
| 49 | + |
| 50 | + role: Optional[Literal["user", "assistant", "system"]] = None |
| 51 | + """ |
| 52 | + The role of the message sender (`user`, `assistant`, `system`), only applicable |
| 53 | + for `message` items. |
| 54 | + """ |
| 55 | + |
| 56 | + status: Optional[Literal["completed", "incomplete"]] = None |
| 57 | + """The status of the item (`completed`, `incomplete`). |
| 58 | +
|
| 59 | + These have no effect on the conversation, but are accepted for consistency with |
| 60 | + the `conversation.item.created` event. |
| 61 | + """ |
| 62 | + |
| 63 | + type: Optional[Literal["message", "function_call", "function_call_output", "item_reference"]] = None |
| 64 | + """ |
| 65 | + The type of the item (`message`, `function_call`, `function_call_output`, |
| 66 | + `item_reference`). |
| 67 | + """ |
0 commit comments