diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..70853177bd6d0899ec330b087307432a43c10f15 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__init__.py @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .run import Run as Run +from .text import Text as Text +from .message import Message as Message +from .image_url import ImageURL as ImageURL +from .annotation import Annotation as Annotation +from .image_file import ImageFile as ImageFile +from .run_status import RunStatus as RunStatus +from .text_delta import TextDelta as TextDelta +from .message_delta import MessageDelta as MessageDelta +from .image_url_delta import ImageURLDelta as ImageURLDelta +from .image_url_param import ImageURLParam as ImageURLParam +from .message_content import MessageContent as MessageContent +from .message_deleted import MessageDeleted as MessageDeleted +from .run_list_params import RunListParams as RunListParams +from .annotation_delta import AnnotationDelta as AnnotationDelta +from .image_file_delta import ImageFileDelta as ImageFileDelta +from .image_file_param import ImageFileParam as ImageFileParam +from .text_delta_block import TextDeltaBlock as TextDeltaBlock +from .run_create_params import RunCreateParams as RunCreateParams +from .run_update_params import RunUpdateParams as RunUpdateParams +from .text_content_block import TextContentBlock as TextContentBlock +from .message_delta_event import MessageDeltaEvent as MessageDeltaEvent +from .message_list_params import MessageListParams as MessageListParams +from .refusal_delta_block import RefusalDeltaBlock as RefusalDeltaBlock +from .file_path_annotation import FilePathAnnotation as FilePathAnnotation +from .image_url_delta_block import ImageURLDeltaBlock as ImageURLDeltaBlock +from .message_content_delta import MessageContentDelta as MessageContentDelta +from .message_create_params import MessageCreateParams as MessageCreateParams +from .message_update_params import MessageUpdateParams as MessageUpdateParams +from .refusal_content_block import RefusalContentBlock as RefusalContentBlock +from .image_file_delta_block import ImageFileDeltaBlock as ImageFileDeltaBlock +from .image_url_content_block import ImageURLContentBlock as ImageURLContentBlock +from .file_citation_annotation import FileCitationAnnotation as FileCitationAnnotation +from .image_file_content_block import ImageFileContentBlock as ImageFileContentBlock +from .text_content_block_param import TextContentBlockParam as TextContentBlockParam +from .file_path_delta_annotation import FilePathDeltaAnnotation as FilePathDeltaAnnotation +from .message_content_part_param import MessageContentPartParam as MessageContentPartParam +from .image_url_content_block_param import ImageURLContentBlockParam as ImageURLContentBlockParam +from .file_citation_delta_annotation import FileCitationDeltaAnnotation as FileCitationDeltaAnnotation +from .image_file_content_block_param import ImageFileContentBlockParam as ImageFileContentBlockParam +from .run_submit_tool_outputs_params import RunSubmitToolOutputsParams as RunSubmitToolOutputsParams +from .required_action_function_tool_call import RequiredActionFunctionToolCall as RequiredActionFunctionToolCall diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_file_content_block_param.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_file_content_block_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a1dda2cd1b7687b8ed8186da07d17395af5af6e5 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_file_content_block_param.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fe2e06c274d002593dcf017d6a1bec2d38acafb Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_param.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_param.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..10119915237bcaf5b8496a65f8f3a7ae6fbcabed Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/image_url_param.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/message_create_params.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/message_create_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1aaf12d5112e40a1259cda17bd744cc9aaf9aebf Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/message_create_params.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/refusal_delta_block.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/refusal_delta_block.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..18536f5a90cd53c69a5399666151d0d750d50904 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/refusal_delta_block.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_list_params.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..45a551fe40a23e906d0cc12292fcfeca63af151d Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_list_params.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_update_params.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_update_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ade8ff634b586fe4edb72d4fd76370862f89fd4 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/run_update_params.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_content_block.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_content_block.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..62ebeb3e371da9ea2c1d096621ca846e9698805b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_content_block.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0460210736de5b88be6a22f8b021f6df20008bb7 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta_block.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta_block.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5d2a8cb401b85c1820cbc9058a594005f5963451 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/__pycache__/text_delta_block.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/annotation_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/annotation_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..c7c6c89837c21f845c8b56a208627e6751c4b161 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/annotation_delta.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._utils import PropertyInfo +from .file_path_delta_annotation import FilePathDeltaAnnotation +from .file_citation_delta_annotation import FileCitationDeltaAnnotation + +__all__ = ["AnnotationDelta"] + +AnnotationDelta: TypeAlias = Annotated[ + Union[FileCitationDeltaAnnotation, FilePathDeltaAnnotation], PropertyInfo(discriminator="type") +] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_annotation.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_annotation.py new file mode 100644 index 0000000000000000000000000000000000000000..c3085aed9bfc7453f2dbe9de3f35e1992f19f9ed --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_annotation.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["FileCitationAnnotation", "FileCitation"] + + +class FileCitation(BaseModel): + file_id: str + """The ID of the specific File the citation is from.""" + + +class FileCitationAnnotation(BaseModel): + end_index: int + + file_citation: FileCitation + + start_index: int + + text: str + """The text in the message content that needs to be replaced.""" + + type: Literal["file_citation"] + """Always `file_citation`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_delta_annotation.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_delta_annotation.py new file mode 100644 index 0000000000000000000000000000000000000000..b40c0d123e7bf512863c4027a93503b1da31181d --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/file_citation_delta_annotation.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["FileCitationDeltaAnnotation", "FileCitation"] + + +class FileCitation(BaseModel): + file_id: Optional[str] = None + """The ID of the specific File the citation is from.""" + + quote: Optional[str] = None + """The specific quote in the file.""" + + +class FileCitationDeltaAnnotation(BaseModel): + index: int + """The index of the annotation in the text content part.""" + + type: Literal["file_citation"] + """Always `file_citation`.""" + + end_index: Optional[int] = None + + file_citation: Optional[FileCitation] = None + + start_index: Optional[int] = None + + text: Optional[str] = None + """The text in the message content that needs to be replaced.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py new file mode 100644 index 0000000000000000000000000000000000000000..a909999065653e17e9b7a919e2995867abb9d3c8 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel +from .image_file import ImageFile + +__all__ = ["ImageFileContentBlock"] + + +class ImageFileContentBlock(BaseModel): + image_file: ImageFile + + type: Literal["image_file"] + """Always `image_file`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block_param.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..48d94bee3621138170b473fee2c8b2395c526afb --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_content_block_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from .image_file_param import ImageFileParam + +__all__ = ["ImageFileContentBlockParam"] + + +class ImageFileContentBlockParam(TypedDict, total=False): + image_file: Required[ImageFileParam] + + type: Required[Literal["image_file"]] + """Always `image_file`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..4581184c7ae8df83168ea67bed1ff41e93d54f35 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_file_delta.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["ImageFileDelta"] + + +class ImageFileDelta(BaseModel): + detail: Optional[Literal["auto", "low", "high"]] = None + """Specifies the detail level of the image if specified by the user. + + `low` uses fewer tokens, you can opt in to high resolution using `high`. + """ + + file_id: Optional[str] = None + """ + The [File](https://platform.openai.com/docs/api-reference/files) ID of the image + in the message content. Set `purpose="vision"` when uploading the File if you + need to later display the file content. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url.py new file mode 100644 index 0000000000000000000000000000000000000000..d1fac147b244931b99c3fd1148e6c25cf3e027d2 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["ImageURL"] + + +class ImageURL(BaseModel): + url: str + """ + The external URL of the image, must be a supported image types: jpeg, jpg, png, + gif, webp. + """ + + detail: Optional[Literal["auto", "low", "high"]] = None + """Specifies the detail level of the image. + + `low` uses fewer tokens, you can opt in to high resolution using `high`. Default + value is `auto` + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block_param.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block_param.py new file mode 100644 index 0000000000000000000000000000000000000000..585b926c5833812b2e8b4abb687fbc4999fbad6c --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/image_url_content_block_param.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +from .image_url_param import ImageURLParam + +__all__ = ["ImageURLContentBlockParam"] + + +class ImageURLContentBlockParam(TypedDict, total=False): + image_url: Required[ImageURLParam] + + type: Required[Literal["image_url"]] + """The type of the content part.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_content_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_content_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..b6e7dfa45ad7a2cf013f9e0a2c41335a76c497b7 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_content_delta.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ...._utils import PropertyInfo +from .text_delta_block import TextDeltaBlock +from .refusal_delta_block import RefusalDeltaBlock +from .image_url_delta_block import ImageURLDeltaBlock +from .image_file_delta_block import ImageFileDeltaBlock + +__all__ = ["MessageContentDelta"] + +MessageContentDelta: TypeAlias = Annotated[ + Union[ImageFileDeltaBlock, TextDeltaBlock, RefusalDeltaBlock, ImageURLDeltaBlock], + PropertyInfo(discriminator="type"), +] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_create_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..b52386824acd3d3ac2b9c3b4cac24087f2f51a7b --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_create_params.py @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ...shared_params.metadata import Metadata +from .message_content_part_param import MessageContentPartParam +from ..code_interpreter_tool_param import CodeInterpreterToolParam + +__all__ = ["MessageCreateParams", "Attachment", "AttachmentTool", "AttachmentToolFileSearch"] + + +class MessageCreateParams(TypedDict, total=False): + content: Required[Union[str, Iterable[MessageContentPartParam]]] + """The text contents of the message.""" + + role: Required[Literal["user", "assistant"]] + """The role of the entity that is creating the message. Allowed values include: + + - `user`: Indicates the message is sent by an actual user and should be used in + most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this + value to insert messages from the assistant into the conversation. + """ + + attachments: Optional[Iterable[Attachment]] + """A list of files attached to the message, and the tools they should be added to.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class AttachmentToolFileSearch(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + +AttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, AttachmentToolFileSearch] + + +class Attachment(TypedDict, total=False): + file_id: str + """The ID of the file to attach to the message.""" + + tools: Iterable[AttachmentTool] + """The tools to add this file to.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_deleted.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_deleted.py new file mode 100644 index 0000000000000000000000000000000000000000..48210777fa5f79652a82c76a162bea1d728b107c --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_deleted.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["MessageDeleted"] + + +class MessageDeleted(BaseModel): + id: str + + deleted: bool + + object: Literal["thread.message.deleted"] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_delta_event.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..3811cef679607a4b0061119e7d0ca7d02b6a7f43 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_delta_event.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel +from .message_delta import MessageDelta + +__all__ = ["MessageDeltaEvent"] + + +class MessageDeltaEvent(BaseModel): + id: str + """The identifier of the message, which can be referenced in API endpoints.""" + + delta: MessageDelta + """The delta containing the fields that have changed on the Message.""" + + object: Literal["thread.message.delta"] + """The object type, which is always `thread.message.delta`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_list_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a7c22a66fb14e2c8c8aeb4409cdab69548b3f7dc --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_list_params.py @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["MessageListParams"] + + +class MessageListParams(TypedDict, total=False): + after: str + """A cursor for use in pagination. + + `after` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the + list. + """ + + before: str + """A cursor for use in pagination. + + `before` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, starting with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page + of the list. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """Sort order by the `created_at` timestamp of the objects. + + `asc` for ascending order and `desc` for descending order. + """ + + run_id: str + """Filter messages by the run ID that generated them.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_update_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..bb078281e6bbf8fd85ac45f15cd49435362b1570 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/message_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from ...shared_params.metadata import Metadata + +__all__ = ["MessageUpdateParams"] + + +class MessageUpdateParams(TypedDict, total=False): + thread_id: Required[str] + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/refusal_content_block.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/refusal_content_block.py new file mode 100644 index 0000000000000000000000000000000000000000..d54f948554aa86013830b7a485e177915c5dfefd --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/refusal_content_block.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RefusalContentBlock"] + + +class RefusalContentBlock(BaseModel): + refusal: str + + type: Literal["refusal"] + """Always `refusal`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..a24dfd068b568ade74527cca6b489e7e02a03689 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/required_action_function_tool_call.py @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ...._models import BaseModel + +__all__ = ["RequiredActionFunctionToolCall", "Function"] + + +class Function(BaseModel): + arguments: str + """The arguments that the model expects you to pass to the function.""" + + name: str + """The name of the function.""" + + +class RequiredActionFunctionToolCall(BaseModel): + id: str + """The ID of the tool call. + + This ID must be referenced when you submit the tool outputs in using the + [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + endpoint. + """ + + function: Function + """The function definition.""" + + type: Literal["function"] + """The type of tool call the output is required for. + + For now, this is always `function`. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run.py new file mode 100644 index 0000000000000000000000000000000000000000..da9418d6f9ae5e1e4cb07a49a56b2aee0f7c38c8 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run.py @@ -0,0 +1,245 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .run_status import RunStatus +from ..assistant_tool import AssistantTool +from ...shared.metadata import Metadata +from ..assistant_tool_choice_option import AssistantToolChoiceOption +from ..assistant_response_format_option import AssistantResponseFormatOption +from .required_action_function_tool_call import RequiredActionFunctionToolCall + +__all__ = [ + "Run", + "IncompleteDetails", + "LastError", + "RequiredAction", + "RequiredActionSubmitToolOutputs", + "TruncationStrategy", + "Usage", +] + + +class IncompleteDetails(BaseModel): + reason: Optional[Literal["max_completion_tokens", "max_prompt_tokens"]] = None + """The reason why the run is incomplete. + + This will point to which specific token limit was reached over the course of the + run. + """ + + +class LastError(BaseModel): + code: Literal["server_error", "rate_limit_exceeded", "invalid_prompt"] + """One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`.""" + + message: str + """A human-readable description of the error.""" + + +class RequiredActionSubmitToolOutputs(BaseModel): + tool_calls: List[RequiredActionFunctionToolCall] + """A list of the relevant tool calls.""" + + +class RequiredAction(BaseModel): + submit_tool_outputs: RequiredActionSubmitToolOutputs + """Details on the tool outputs needed for this run to continue.""" + + type: Literal["submit_tool_outputs"] + """For now, this is always `submit_tool_outputs`.""" + + +class TruncationStrategy(BaseModel): + type: Literal["auto", "last_messages"] + """The truncation strategy to use for the thread. + + The default is `auto`. If set to `last_messages`, the thread will be truncated + to the n most recent messages in the thread. When set to `auto`, messages in the + middle of the thread will be dropped to fit the context length of the model, + `max_prompt_tokens`. + """ + + last_messages: Optional[int] = None + """ + The number of most recent messages from the thread when constructing the context + for the run. + """ + + +class Usage(BaseModel): + completion_tokens: int + """Number of completion tokens used over the course of the run.""" + + prompt_tokens: int + """Number of prompt tokens used over the course of the run.""" + + total_tokens: int + """Total number of tokens used (prompt + completion).""" + + +class Run(BaseModel): + id: str + """The identifier, which can be referenced in API endpoints.""" + + assistant_id: str + """ + The ID of the + [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + execution of this run. + """ + + cancelled_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run was cancelled.""" + + completed_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run was completed.""" + + created_at: int + """The Unix timestamp (in seconds) for when the run was created.""" + + expires_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run will expire.""" + + failed_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run failed.""" + + incomplete_details: Optional[IncompleteDetails] = None + """Details on why the run is incomplete. + + Will be `null` if the run is not incomplete. + """ + + instructions: str + """ + The instructions that the + [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + this run. + """ + + last_error: Optional[LastError] = None + """The last error associated with this run. Will be `null` if there are no errors.""" + + max_completion_tokens: Optional[int] = None + """ + The maximum number of completion tokens specified to have been used over the + course of the run. + """ + + max_prompt_tokens: Optional[int] = None + """ + The maximum number of prompt tokens specified to have been used over the course + of the run. + """ + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: str + """ + The model that the + [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + this run. + """ + + object: Literal["thread.run"] + """The object type, which is always `thread.run`.""" + + parallel_tool_calls: bool + """ + Whether to enable + [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + during tool use. + """ + + required_action: Optional[RequiredAction] = None + """Details on the action required to continue the run. + + Will be `null` if no action is required. + """ + + response_format: Optional[AssistantResponseFormatOption] = None + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + started_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run was started.""" + + status: RunStatus + """ + The status of the run, which can be either `queued`, `in_progress`, + `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, + `incomplete`, or `expired`. + """ + + thread_id: str + """ + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + that was executed on as a part of this run. + """ + + tool_choice: Optional[AssistantToolChoiceOption] = None + """ + Controls which (if any) tool is called by the model. `none` means the model will + not call any tools and instead generates a message. `auto` is the default value + and means the model can pick between generating a message or calling one or more + tools. `required` means the model must call one or more tools before responding + to the user. Specifying a particular tool like `{"type": "file_search"}` or + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + """ + + tools: List[AssistantTool] + """ + The list of tools that the + [assistant](https://platform.openai.com/docs/api-reference/assistants) used for + this run. + """ + + truncation_strategy: Optional[TruncationStrategy] = None + """Controls for how a thread will be truncated prior to the run. + + Use this to control the intial context window of the run. + """ + + usage: Optional[Usage] = None + """Usage statistics related to the run. + + This value will be `null` if the run is not in a terminal state (i.e. + `in_progress`, `queued`, etc.). + """ + + temperature: Optional[float] = None + """The sampling temperature used for this run. If not set, defaults to 1.""" + + top_p: Optional[float] = None + """The nucleus sampling value used for this run. If not set, defaults to 1.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py new file mode 100644 index 0000000000000000000000000000000000000000..091dd3da66458c780e0c8dbc208fe49cfb861342 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_create_params.py @@ -0,0 +1,251 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List, Union, Iterable, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict + +from ...chat_model import ChatModel +from ..assistant_tool_param import AssistantToolParam +from .runs.run_step_include import RunStepInclude +from ...shared_params.metadata import Metadata +from .message_content_part_param import MessageContentPartParam +from ..code_interpreter_tool_param import CodeInterpreterToolParam +from ..assistant_tool_choice_option_param import AssistantToolChoiceOptionParam +from ..assistant_response_format_option_param import AssistantResponseFormatOptionParam + +__all__ = [ + "RunCreateParamsBase", + "AdditionalMessage", + "AdditionalMessageAttachment", + "AdditionalMessageAttachmentTool", + "AdditionalMessageAttachmentToolFileSearch", + "TruncationStrategy", + "RunCreateParamsNonStreaming", + "RunCreateParamsStreaming", +] + + +class RunCreateParamsBase(TypedDict, total=False): + assistant_id: Required[str] + """ + The ID of the + [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to + execute this run. + """ + + include: List[RunStepInclude] + """A list of additional fields to include in the response. + + Currently the only supported value is + `step_details.tool_calls[*].file_search.results[*].content` to fetch the file + search result content. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + additional_instructions: Optional[str] + """Appends additional instructions at the end of the instructions for the run. + + This is useful for modifying the behavior on a per-run basis without overriding + other instructions. + """ + + additional_messages: Optional[Iterable[AdditionalMessage]] + """Adds additional messages to the thread before creating the run.""" + + instructions: Optional[str] + """ + Overrides the + [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) + of the assistant. This is useful for modifying the behavior on a per-run basis. + """ + + max_completion_tokens: Optional[int] + """ + The maximum number of completion tokens that may be used over the course of the + run. The run will make a best effort to use only the number of completion tokens + specified, across multiple turns of the run. If the run exceeds the number of + completion tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + max_prompt_tokens: Optional[int] + """The maximum number of prompt tokens that may be used over the course of the run. + + The run will make a best effort to use only the number of prompt tokens + specified, across multiple turns of the run. If the run exceeds the number of + prompt tokens specified, the run will end with status `incomplete`. See + `incomplete_details` for more info. + """ + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + model: Union[str, ChatModel, None] + """ + The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to + be used to execute this run. If a value is provided here, it will override the + model associated with the assistant. If not, the model associated with the + assistant will be used. + """ + + parallel_tool_calls: bool + """ + Whether to enable + [parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling) + during tool use. + """ + + response_format: Optional[AssistantResponseFormatOptionParam] + """Specifies the format that the model must output. + + Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o), + [GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4), + and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`. + + Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured + Outputs which ensures the model will match your supplied JSON schema. Learn more + in the + [Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs). + + Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the + message the model generates is valid JSON. + + **Important:** when using JSON mode, you **must** also instruct the model to + produce JSON yourself via a system or user message. Without this, the model may + generate an unending stream of whitespace until the generation reaches the token + limit, resulting in a long-running and seemingly "stuck" request. Also note that + the message content may be partially cut off if `finish_reason="length"`, which + indicates the generation exceeded `max_tokens` or the conversation exceeded the + max context length. + """ + + temperature: Optional[float] + """What sampling temperature to use, between 0 and 2. + + Higher values like 0.8 will make the output more random, while lower values like + 0.2 will make it more focused and deterministic. + """ + + tool_choice: Optional[AssistantToolChoiceOptionParam] + """ + Controls which (if any) tool is called by the model. `none` means the model will + not call any tools and instead generates a message. `auto` is the default value + and means the model can pick between generating a message or calling one or more + tools. `required` means the model must call one or more tools before responding + to the user. Specifying a particular tool like `{"type": "file_search"}` or + `{"type": "function", "function": {"name": "my_function"}}` forces the model to + call that tool. + """ + + tools: Optional[Iterable[AssistantToolParam]] + """Override the tools the assistant can use for this run. + + This is useful for modifying the behavior on a per-run basis. + """ + + top_p: Optional[float] + """ + An alternative to sampling with temperature, called nucleus sampling, where the + model considers the results of the tokens with top_p probability mass. So 0.1 + means only the tokens comprising the top 10% probability mass are considered. + + We generally recommend altering this or temperature but not both. + """ + + truncation_strategy: Optional[TruncationStrategy] + """Controls for how a thread will be truncated prior to the run. + + Use this to control the intial context window of the run. + """ + + +class AdditionalMessageAttachmentToolFileSearch(TypedDict, total=False): + type: Required[Literal["file_search"]] + """The type of tool being defined: `file_search`""" + + +AdditionalMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, AdditionalMessageAttachmentToolFileSearch] + + +class AdditionalMessageAttachment(TypedDict, total=False): + file_id: str + """The ID of the file to attach to the message.""" + + tools: Iterable[AdditionalMessageAttachmentTool] + """The tools to add this file to.""" + + +class AdditionalMessage(TypedDict, total=False): + content: Required[Union[str, Iterable[MessageContentPartParam]]] + """The text contents of the message.""" + + role: Required[Literal["user", "assistant"]] + """The role of the entity that is creating the message. Allowed values include: + + - `user`: Indicates the message is sent by an actual user and should be used in + most cases to represent user-generated messages. + - `assistant`: Indicates the message is generated by the assistant. Use this + value to insert messages from the assistant into the conversation. + """ + + attachments: Optional[Iterable[AdditionalMessageAttachment]] + """A list of files attached to the message, and the tools they should be added to.""" + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + +class TruncationStrategy(TypedDict, total=False): + type: Required[Literal["auto", "last_messages"]] + """The truncation strategy to use for the thread. + + The default is `auto`. If set to `last_messages`, the thread will be truncated + to the n most recent messages in the thread. When set to `auto`, messages in the + middle of the thread will be dropped to fit the context length of the model, + `max_prompt_tokens`. + """ + + last_messages: Optional[int] + """ + The number of most recent messages from the thread when constructing the context + for the run. + """ + + +class RunCreateParamsNonStreaming(RunCreateParamsBase, total=False): + stream: Optional[Literal[False]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +class RunCreateParamsStreaming(RunCreateParamsBase): + stream: Required[Literal[True]] + """ + If `true`, returns a stream of events that happen during the Run as server-sent + events, terminating when the Run enters a terminal state with a `data: [DONE]` + message. + """ + + +RunCreateParams = Union[RunCreateParamsNonStreaming, RunCreateParamsStreaming] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_list_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..fbea54f6f206294891a8e2fa8a65690c84d4d051 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_list_params.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["RunListParams"] + + +class RunListParams(TypedDict, total=False): + after: str + """A cursor for use in pagination. + + `after` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the + list. + """ + + before: str + """A cursor for use in pagination. + + `before` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, starting with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page + of the list. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """Sort order by the `created_at` timestamp of the objects. + + `asc` for ascending order and `desc` for descending order. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_update_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_update_params.py new file mode 100644 index 0000000000000000000000000000000000000000..fbcbd3fb14e30d956d7a032f73cb7604cd89ac94 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/run_update_params.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import Required, TypedDict + +from ...shared_params.metadata import Metadata + +__all__ = ["RunUpdateParams"] + + +class RunUpdateParams(TypedDict, total=False): + thread_id: Required[str] + + metadata: Optional[Metadata] + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__init__.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..467d5d793dbad7150335722eaab0503d67ad456a --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__init__.py @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from .run_step import RunStep as RunStep +from .tool_call import ToolCall as ToolCall +from .run_step_delta import RunStepDelta as RunStepDelta +from .tool_call_delta import ToolCallDelta as ToolCallDelta +from .run_step_include import RunStepInclude as RunStepInclude +from .step_list_params import StepListParams as StepListParams +from .function_tool_call import FunctionToolCall as FunctionToolCall +from .run_step_delta_event import RunStepDeltaEvent as RunStepDeltaEvent +from .step_retrieve_params import StepRetrieveParams as StepRetrieveParams +from .code_interpreter_logs import CodeInterpreterLogs as CodeInterpreterLogs +from .file_search_tool_call import FileSearchToolCall as FileSearchToolCall +from .tool_call_delta_object import ToolCallDeltaObject as ToolCallDeltaObject +from .tool_calls_step_details import ToolCallsStepDetails as ToolCallsStepDetails +from .function_tool_call_delta import FunctionToolCallDelta as FunctionToolCallDelta +from .code_interpreter_tool_call import CodeInterpreterToolCall as CodeInterpreterToolCall +from .file_search_tool_call_delta import FileSearchToolCallDelta as FileSearchToolCallDelta +from .run_step_delta_message_delta import RunStepDeltaMessageDelta as RunStepDeltaMessageDelta +from .code_interpreter_output_image import CodeInterpreterOutputImage as CodeInterpreterOutputImage +from .message_creation_step_details import MessageCreationStepDetails as MessageCreationStepDetails +from .code_interpreter_tool_call_delta import CodeInterpreterToolCallDelta as CodeInterpreterToolCallDelta diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/__init__.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3f7bec6e699a373e189258e42cd36061766154eb Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/__init__.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_logs.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_logs.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d6e16ff9165d0f83672079287e172318d82b6249 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_logs.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_output_image.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_output_image.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e14aac8fa1a9e2acff282c418f2b6494f3086d8f Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_output_image.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_tool_call_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_tool_call_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c32b32f4e4e5dd2707af245e8c9052d86776754 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/code_interpreter_tool_call_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06e7fe0dd59b411ddc0cd7eca26d6666c781662e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bc2a761e5f1c8fdb0bdb80671401fccfb5d73aed Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/file_search_tool_call_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c3481ceb69ccff7ab55d4bbb1b0531ecb7fc1a7b Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..aa0cb65358c9df632bb73c3f80e1adcd56c4e29e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/function_tool_call_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/message_creation_step_details.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/message_creation_step_details.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..657bcc8b31a8660c130908fb274920aca303f0b1 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/message_creation_step_details.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..94179d431d1c79985df67d84490b9679befbe6b7 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29cb38ee43f5e9a2a5ef8354fd8d4425a5b783d1 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_event.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_event.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6ca3fff34cc719152a20f65658e615b4bb14639a Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_event.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_message_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_message_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a32915ffbba438884380ff9e5462cf5259278274 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_delta_message_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_include.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_include.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bf242ecdaaa1e63f64f5f25c8609c09437ad3db6 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/run_step_include.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_list_params.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_list_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7e4506a0b0e853b4ee33c0e8c38f4e7b23d84c73 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_list_params.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_retrieve_params.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_retrieve_params.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9d11f582b47ef4f2fbc20492f0f93c3a18b7790e Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/step_retrieve_params.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b134e037ba26a2ecc0c809b0116e146261946677 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..426dfc4e6b585445254d815889a7a2c80afeb4a8 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta_object.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta_object.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a8babe3fd2b430bb3fffb3b55def5a8dd49a25cd Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_call_delta_object.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_calls_step_details.cpython-311.pyc b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_calls_step_details.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..50012bf25997b560233c98cea42d1f71dc119035 Binary files /dev/null and b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/__pycache__/tool_calls_step_details.cpython-311.pyc differ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_logs.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_logs.py new file mode 100644 index 0000000000000000000000000000000000000000..0bf8c1dac2c1bc86fad2ee7212d36985271876f3 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_logs.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["CodeInterpreterLogs"] + + +class CodeInterpreterLogs(BaseModel): + index: int + """The index of the output in the outputs array.""" + + type: Literal["logs"] + """Always `logs`.""" + + logs: Optional[str] = None + """The text output from the Code Interpreter tool call.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_output_image.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_output_image.py new file mode 100644 index 0000000000000000000000000000000000000000..2257f37e41d53598831c1fb6db6ec4e1d292a12a --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_output_image.py @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["CodeInterpreterOutputImage", "Image"] + + +class Image(BaseModel): + file_id: Optional[str] = None + """ + The [file](https://platform.openai.com/docs/api-reference/files) ID of the + image. + """ + + +class CodeInterpreterOutputImage(BaseModel): + index: int + """The index of the output in the outputs array.""" + + type: Literal["image"] + """Always `image`.""" + + image: Optional[Image] = None diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..e7df4e19c49645306641a89d096e869f58769f7b --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call.py @@ -0,0 +1,70 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union +from typing_extensions import Literal, Annotated, TypeAlias + +from ....._utils import PropertyInfo +from ....._models import BaseModel + +__all__ = [ + "CodeInterpreterToolCall", + "CodeInterpreter", + "CodeInterpreterOutput", + "CodeInterpreterOutputLogs", + "CodeInterpreterOutputImage", + "CodeInterpreterOutputImageImage", +] + + +class CodeInterpreterOutputLogs(BaseModel): + logs: str + """The text output from the Code Interpreter tool call.""" + + type: Literal["logs"] + """Always `logs`.""" + + +class CodeInterpreterOutputImageImage(BaseModel): + file_id: str + """ + The [file](https://platform.openai.com/docs/api-reference/files) ID of the + image. + """ + + +class CodeInterpreterOutputImage(BaseModel): + image: CodeInterpreterOutputImageImage + + type: Literal["image"] + """Always `image`.""" + + +CodeInterpreterOutput: TypeAlias = Annotated[ + Union[CodeInterpreterOutputLogs, CodeInterpreterOutputImage], PropertyInfo(discriminator="type") +] + + +class CodeInterpreter(BaseModel): + input: str + """The input to the Code Interpreter tool call.""" + + outputs: List[CodeInterpreterOutput] + """The outputs from the Code Interpreter tool call. + + Code Interpreter can output one or more items, including text (`logs`) or images + (`image`). Each of these are represented by a different object type. + """ + + +class CodeInterpreterToolCall(BaseModel): + id: str + """The ID of the tool call.""" + + code_interpreter: CodeInterpreter + """The Code Interpreter tool call definition.""" + + type: Literal["code_interpreter"] + """The type of tool call. + + This is always going to be `code_interpreter` for this type of tool call. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..9d7a1563cdb6e90efe66e394ed74a951192e0fc3 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ....._utils import PropertyInfo +from ....._models import BaseModel +from .code_interpreter_logs import CodeInterpreterLogs +from .code_interpreter_output_image import CodeInterpreterOutputImage + +__all__ = ["CodeInterpreterToolCallDelta", "CodeInterpreter", "CodeInterpreterOutput"] + +CodeInterpreterOutput: TypeAlias = Annotated[ + Union[CodeInterpreterLogs, CodeInterpreterOutputImage], PropertyInfo(discriminator="type") +] + + +class CodeInterpreter(BaseModel): + input: Optional[str] = None + """The input to the Code Interpreter tool call.""" + + outputs: Optional[List[CodeInterpreterOutput]] = None + """The outputs from the Code Interpreter tool call. + + Code Interpreter can output one or more items, including text (`logs`) or images + (`image`). Each of these are represented by a different object type. + """ + + +class CodeInterpreterToolCallDelta(BaseModel): + index: int + """The index of the tool call in the tool calls array.""" + + type: Literal["code_interpreter"] + """The type of tool call. + + This is always going to be `code_interpreter` for this type of tool call. + """ + + id: Optional[str] = None + """The ID of the tool call.""" + + code_interpreter: Optional[CodeInterpreter] = None + """The Code Interpreter tool call definition.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..da4d58dc3736c33b3ce8d067922ba709c477b52a --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call.py @@ -0,0 +1,75 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = [ + "FileSearchToolCall", + "FileSearch", + "FileSearchRankingOptions", + "FileSearchResult", + "FileSearchResultContent", +] + + +class FileSearchRankingOptions(BaseModel): + ranker: Literal["default_2024_08_21"] + """The ranker used for the file search.""" + + score_threshold: float + """The score threshold for the file search. + + All values must be a floating point number between 0 and 1. + """ + + +class FileSearchResultContent(BaseModel): + text: Optional[str] = None + """The text content of the file.""" + + type: Optional[Literal["text"]] = None + """The type of the content.""" + + +class FileSearchResult(BaseModel): + file_id: str + """The ID of the file that result was found in.""" + + file_name: str + """The name of the file that result was found in.""" + + score: float + """The score of the result. + + All values must be a floating point number between 0 and 1. + """ + + content: Optional[List[FileSearchResultContent]] = None + """The content of the result that was found. + + The content is only included if requested via the include query parameter. + """ + + +class FileSearch(BaseModel): + ranking_options: Optional[FileSearchRankingOptions] = None + """The ranking options for the file search.""" + + results: Optional[List[FileSearchResult]] = None + """The results of the file search.""" + + +class FileSearchToolCall(BaseModel): + id: str + """The ID of the tool call object.""" + + file_search: FileSearch + """For now, this is always going to be an empty object.""" + + type: Literal["file_search"] + """The type of tool call. + + This is always going to be `file_search` for this type of tool call. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..df5ac217dc09bafacd8a4dbb764ffd9c05742c0c --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/file_search_tool_call_delta.py @@ -0,0 +1,25 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["FileSearchToolCallDelta"] + + +class FileSearchToolCallDelta(BaseModel): + file_search: object + """For now, this is always going to be an empty object.""" + + index: int + """The index of the tool call in the tool calls array.""" + + type: Literal["file_search"] + """The type of tool call. + + This is always going to be `file_search` for this type of tool call. + """ + + id: Optional[str] = None + """The ID of the tool call object.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..b1d354f894eb9c07f3123566c0b89c40e3d106ed --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["FunctionToolCall", "Function"] + + +class Function(BaseModel): + arguments: str + """The arguments passed to the function.""" + + name: str + """The name of the function.""" + + output: Optional[str] = None + """The output of the function. + + This will be `null` if the outputs have not been + [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + yet. + """ + + +class FunctionToolCall(BaseModel): + id: str + """The ID of the tool call object.""" + + function: Function + """The definition of the function that was called.""" + + type: Literal["function"] + """The type of tool call. + + This is always going to be `function` for this type of tool call. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..faaf026f7fdbd864cfa60695184b715a702db8a0 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/function_tool_call_delta.py @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["FunctionToolCallDelta", "Function"] + + +class Function(BaseModel): + arguments: Optional[str] = None + """The arguments passed to the function.""" + + name: Optional[str] = None + """The name of the function.""" + + output: Optional[str] = None + """The output of the function. + + This will be `null` if the outputs have not been + [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) + yet. + """ + + +class FunctionToolCallDelta(BaseModel): + index: int + """The index of the tool call in the tool calls array.""" + + type: Literal["function"] + """The type of tool call. + + This is always going to be `function` for this type of tool call. + """ + + id: Optional[str] = None + """The ID of the tool call object.""" + + function: Optional[Function] = None + """The definition of the function that was called.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/message_creation_step_details.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/message_creation_step_details.py new file mode 100644 index 0000000000000000000000000000000000000000..73439079d338c00893ef6aaf9606d0aeaf75ecc1 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/message_creation_step_details.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["MessageCreationStepDetails", "MessageCreation"] + + +class MessageCreation(BaseModel): + message_id: str + """The ID of the message that was created by this run step.""" + + +class MessageCreationStepDetails(BaseModel): + message_creation: MessageCreation + + type: Literal["message_creation"] + """Always `message_creation`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step.py new file mode 100644 index 0000000000000000000000000000000000000000..b5f380c7b1085d98a66053177ef126f4f2651ae6 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step.py @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Literal, Annotated, TypeAlias + +from ....._utils import PropertyInfo +from ....._models import BaseModel +from ....shared.metadata import Metadata +from .tool_calls_step_details import ToolCallsStepDetails +from .message_creation_step_details import MessageCreationStepDetails + +__all__ = ["RunStep", "LastError", "StepDetails", "Usage"] + + +class LastError(BaseModel): + code: Literal["server_error", "rate_limit_exceeded"] + """One of `server_error` or `rate_limit_exceeded`.""" + + message: str + """A human-readable description of the error.""" + + +StepDetails: TypeAlias = Annotated[ + Union[MessageCreationStepDetails, ToolCallsStepDetails], PropertyInfo(discriminator="type") +] + + +class Usage(BaseModel): + completion_tokens: int + """Number of completion tokens used over the course of the run step.""" + + prompt_tokens: int + """Number of prompt tokens used over the course of the run step.""" + + total_tokens: int + """Total number of tokens used (prompt + completion).""" + + +class RunStep(BaseModel): + id: str + """The identifier of the run step, which can be referenced in API endpoints.""" + + assistant_id: str + """ + The ID of the + [assistant](https://platform.openai.com/docs/api-reference/assistants) + associated with the run step. + """ + + cancelled_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run step was cancelled.""" + + completed_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run step completed.""" + + created_at: int + """The Unix timestamp (in seconds) for when the run step was created.""" + + expired_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run step expired. + + A step is considered expired if the parent run is expired. + """ + + failed_at: Optional[int] = None + """The Unix timestamp (in seconds) for when the run step failed.""" + + last_error: Optional[LastError] = None + """The last error associated with this run step. + + Will be `null` if there are no errors. + """ + + metadata: Optional[Metadata] = None + """Set of 16 key-value pairs that can be attached to an object. + + This can be useful for storing additional information about the object in a + structured format, and querying for objects via API or the dashboard. + + Keys are strings with a maximum length of 64 characters. Values are strings with + a maximum length of 512 characters. + """ + + object: Literal["thread.run.step"] + """The object type, which is always `thread.run.step`.""" + + run_id: str + """ + The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that + this run step is a part of. + """ + + status: Literal["in_progress", "cancelled", "failed", "completed", "expired"] + """ + The status of the run step, which can be either `in_progress`, `cancelled`, + `failed`, `completed`, or `expired`. + """ + + step_details: StepDetails + """The details of the run step.""" + + thread_id: str + """ + The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) + that was run. + """ + + type: Literal["message_creation", "tool_calls"] + """The type of run step, which can be either `message_creation` or `tool_calls`.""" + + usage: Optional[Usage] = None + """Usage statistics related to the run step. + + This value will be `null` while the run step's status is `in_progress`. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..1139088fb43182de3cb0959a4b47172625e08345 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union, Optional +from typing_extensions import Annotated, TypeAlias + +from ....._utils import PropertyInfo +from ....._models import BaseModel +from .tool_call_delta_object import ToolCallDeltaObject +from .run_step_delta_message_delta import RunStepDeltaMessageDelta + +__all__ = ["RunStepDelta", "StepDetails"] + +StepDetails: TypeAlias = Annotated[ + Union[RunStepDeltaMessageDelta, ToolCallDeltaObject], PropertyInfo(discriminator="type") +] + + +class RunStepDelta(BaseModel): + step_details: Optional[StepDetails] = None + """The details of the run step.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_event.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_event.py new file mode 100644 index 0000000000000000000000000000000000000000..7f3f92aabfcbdf69e9ba855ec72aa7489895c37c --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_event.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal + +from ....._models import BaseModel +from .run_step_delta import RunStepDelta + +__all__ = ["RunStepDeltaEvent"] + + +class RunStepDeltaEvent(BaseModel): + id: str + """The identifier of the run step, which can be referenced in API endpoints.""" + + delta: RunStepDelta + """The delta containing the fields that have changed on the run step.""" + + object: Literal["thread.run.step.delta"] + """The object type, which is always `thread.run.step.delta`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_message_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_message_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..f58ed3d96de257a5e7654a811df711462d8832f3 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_delta_message_delta.py @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ....._models import BaseModel + +__all__ = ["RunStepDeltaMessageDelta", "MessageCreation"] + + +class MessageCreation(BaseModel): + message_id: Optional[str] = None + """The ID of the message that was created by this run step.""" + + +class RunStepDeltaMessageDelta(BaseModel): + type: Literal["message_creation"] + """Always `message_creation`.""" + + message_creation: Optional[MessageCreation] = None diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_include.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_include.py new file mode 100644 index 0000000000000000000000000000000000000000..8e76c1b716a9e1efcb8b3727daee04c6927d870f --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/run_step_include.py @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["RunStepInclude"] + +RunStepInclude: TypeAlias = Literal["step_details.tool_calls[*].file_search.results[*].content"] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_list_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_list_params.py new file mode 100644 index 0000000000000000000000000000000000000000..a6be771d9f9e5d299bb31404c5b03a9d206ea8e0 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_list_params.py @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Literal, Required, TypedDict + +from .run_step_include import RunStepInclude + +__all__ = ["StepListParams"] + + +class StepListParams(TypedDict, total=False): + thread_id: Required[str] + + after: str + """A cursor for use in pagination. + + `after` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, ending with obj_foo, your + subsequent call can include after=obj_foo in order to fetch the next page of the + list. + """ + + before: str + """A cursor for use in pagination. + + `before` is an object ID that defines your place in the list. For instance, if + you make a list request and receive 100 objects, starting with obj_foo, your + subsequent call can include before=obj_foo in order to fetch the previous page + of the list. + """ + + include: List[RunStepInclude] + """A list of additional fields to include in the response. + + Currently the only supported value is + `step_details.tool_calls[*].file_search.results[*].content` to fetch the file + search result content. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ + + limit: int + """A limit on the number of objects to be returned. + + Limit can range between 1 and 100, and the default is 20. + """ + + order: Literal["asc", "desc"] + """Sort order by the `created_at` timestamp of the objects. + + `asc` for ascending order and `desc` for descending order. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_retrieve_params.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_retrieve_params.py new file mode 100644 index 0000000000000000000000000000000000000000..ecbb72edbd1dd8a82ef426fc2db04dc243778f63 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/step_retrieve_params.py @@ -0,0 +1,28 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import List +from typing_extensions import Required, TypedDict + +from .run_step_include import RunStepInclude + +__all__ = ["StepRetrieveParams"] + + +class StepRetrieveParams(TypedDict, total=False): + thread_id: Required[str] + + run_id: Required[str] + + include: List[RunStepInclude] + """A list of additional fields to include in the response. + + Currently the only supported value is + `step_details.tool_calls[*].file_search.results[*].content` to fetch the file + search result content. + + See the + [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) + for more information. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call.py new file mode 100644 index 0000000000000000000000000000000000000000..565e3109bec29bd8b7189ea2acfddc07b6438f09 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ....._utils import PropertyInfo +from .function_tool_call import FunctionToolCall +from .file_search_tool_call import FileSearchToolCall +from .code_interpreter_tool_call import CodeInterpreterToolCall + +__all__ = ["ToolCall"] + +ToolCall: TypeAlias = Annotated[ + Union[CodeInterpreterToolCall, FileSearchToolCall, FunctionToolCall], PropertyInfo(discriminator="type") +] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..f0b8070c9752e65008557f073e066a005b5f9f8e --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta.py @@ -0,0 +1,16 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Union +from typing_extensions import Annotated, TypeAlias + +from ....._utils import PropertyInfo +from .function_tool_call_delta import FunctionToolCallDelta +from .file_search_tool_call_delta import FileSearchToolCallDelta +from .code_interpreter_tool_call_delta import CodeInterpreterToolCallDelta + +__all__ = ["ToolCallDelta"] + +ToolCallDelta: TypeAlias = Annotated[ + Union[CodeInterpreterToolCallDelta, FileSearchToolCallDelta, FunctionToolCallDelta], + PropertyInfo(discriminator="type"), +] diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta_object.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta_object.py new file mode 100644 index 0000000000000000000000000000000000000000..189dce772c15660c504dbb2b37e1c6fa92df7ab3 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_call_delta_object.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from ....._models import BaseModel +from .tool_call_delta import ToolCallDelta + +__all__ = ["ToolCallDeltaObject"] + + +class ToolCallDeltaObject(BaseModel): + type: Literal["tool_calls"] + """Always `tool_calls`.""" + + tool_calls: Optional[List[ToolCallDelta]] = None + """An array of tool calls the run step was involved in. + + These can be associated with one of three types of tools: `code_interpreter`, + `file_search`, or `function`. + """ diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_calls_step_details.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_calls_step_details.py new file mode 100644 index 0000000000000000000000000000000000000000..a084d387c75bf2ff1cdba0ffb1fad4394d7de35a --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/runs/tool_calls_step_details.py @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List +from typing_extensions import Literal + +from .tool_call import ToolCall +from ....._models import BaseModel + +__all__ = ["ToolCallsStepDetails"] + + +class ToolCallsStepDetails(BaseModel): + tool_calls: List[ToolCall] + """An array of tool calls the run step was involved in. + + These can be associated with one of three types of tools: `code_interpreter`, + `file_search`, or `function`. + """ + + type: Literal["tool_calls"] + """Always `tool_calls`.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text.py new file mode 100644 index 0000000000000000000000000000000000000000..853bec29556cf8031185fe36eacbbc8f7864cc67 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from ...._models import BaseModel +from .annotation import Annotation + +__all__ = ["Text"] + + +class Text(BaseModel): + annotations: List[Annotation] + + value: str + """The data that makes up the text.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta.py new file mode 100644 index 0000000000000000000000000000000000000000..09cd357027867f15c24bff1ec59e0b059e6341c8 --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta.py @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ...._models import BaseModel +from .annotation_delta import AnnotationDelta + +__all__ = ["TextDelta"] + + +class TextDelta(BaseModel): + annotations: Optional[List[AnnotationDelta]] = None + + value: Optional[str] = None + """The data that makes up the text.""" diff --git a/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta_block.py b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta_block.py new file mode 100644 index 0000000000000000000000000000000000000000..586116e0d65e30ea156c3aad36c0fdb03f79366c --- /dev/null +++ b/.venv/lib/python3.11/site-packages/openai/types/beta/threads/text_delta_block.py @@ -0,0 +1,19 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from ...._models import BaseModel +from .text_delta import TextDelta + +__all__ = ["TextDeltaBlock"] + + +class TextDeltaBlock(BaseModel): + index: int + """The index of the content part in the message.""" + + type: Literal["text"] + """Always `text`.""" + + text: Optional[TextDelta] = None