Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- lib/python3.12/site-packages/openai/types/beta/__init__.py +33 -0
- lib/python3.12/site-packages/openai/types/beta/assistant.py +134 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_create_params.py +212 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_deleted.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_list_params.py +39 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_response_format_option.py +14 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_response_format_option_param.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_stream_event.py +294 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function.py +11 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function_param.py +12 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_option.py +10 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_option_param.py +12 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_param.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_tool_param.py +14 -0
- lib/python3.12/site-packages/openai/types/beta/assistant_update_params.py +177 -0
- lib/python3.12/site-packages/openai/types/beta/code_interpreter_tool.py +12 -0
- lib/python3.12/site-packages/openai/types/beta/code_interpreter_tool_param.py +12 -0
- lib/python3.12/site-packages/openai/types/beta/file_search_tool.py +55 -0
- lib/python3.12/site-packages/openai/types/beta/file_search_tool_param.py +54 -0
- lib/python3.12/site-packages/openai/types/beta/function_tool.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/function_tool_param.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/thread.py +63 -0
- lib/python3.12/site-packages/openai/types/beta/thread_create_and_run_params.py +401 -0
- lib/python3.12/site-packages/openai/types/beta/thread_create_params.py +185 -0
- lib/python3.12/site-packages/openai/types/beta/thread_deleted.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/thread_update_params.py +55 -0
- lib/python3.12/site-packages/openai/types/beta/threads/__init__.py +46 -0
- lib/python3.12/site-packages/openai/types/beta/threads/annotation.py +12 -0
- lib/python3.12/site-packages/openai/types/beta/threads/annotation_delta.py +14 -0
- lib/python3.12/site-packages/openai/types/beta/threads/file_citation_annotation.py +26 -0
- lib/python3.12/site-packages/openai/types/beta/threads/file_citation_delta_annotation.py +33 -0
- lib/python3.12/site-packages/openai/types/beta/threads/file_path_annotation.py +26 -0
- lib/python3.12/site-packages/openai/types/beta/threads/file_path_delta_annotation.py +30 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file.py +23 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file_content_block.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file_content_block_param.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file_delta.py +23 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file_delta_block.py +19 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_file_param.py +22 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url.py +23 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url_content_block.py +15 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url_content_block_param.py +16 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url_delta.py +22 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url_delta_block.py +19 -0
- lib/python3.12/site-packages/openai/types/beta/threads/image_url_param.py +22 -0
- lib/python3.12/site-packages/openai/types/beta/threads/message.py +103 -0
- lib/python3.12/site-packages/openai/types/beta/threads/message_content.py +18 -0
- lib/python3.12/site-packages/openai/types/beta/threads/message_content_delta.py +17 -0
lib/python3.12/site-packages/openai/types/beta/__init__.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from .thread import Thread as Thread
|
| 6 |
+
from .assistant import Assistant as Assistant
|
| 7 |
+
from .function_tool import FunctionTool as FunctionTool
|
| 8 |
+
from .assistant_tool import AssistantTool as AssistantTool
|
| 9 |
+
from .thread_deleted import ThreadDeleted as ThreadDeleted
|
| 10 |
+
from .file_search_tool import FileSearchTool as FileSearchTool
|
| 11 |
+
from .assistant_deleted import AssistantDeleted as AssistantDeleted
|
| 12 |
+
from .function_tool_param import FunctionToolParam as FunctionToolParam
|
| 13 |
+
from .assistant_tool_param import AssistantToolParam as AssistantToolParam
|
| 14 |
+
from .thread_create_params import ThreadCreateParams as ThreadCreateParams
|
| 15 |
+
from .thread_update_params import ThreadUpdateParams as ThreadUpdateParams
|
| 16 |
+
from .assistant_list_params import AssistantListParams as AssistantListParams
|
| 17 |
+
from .assistant_tool_choice import AssistantToolChoice as AssistantToolChoice
|
| 18 |
+
from .code_interpreter_tool import CodeInterpreterTool as CodeInterpreterTool
|
| 19 |
+
from .assistant_stream_event import AssistantStreamEvent as AssistantStreamEvent
|
| 20 |
+
from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam
|
| 21 |
+
from .assistant_create_params import AssistantCreateParams as AssistantCreateParams
|
| 22 |
+
from .assistant_update_params import AssistantUpdateParams as AssistantUpdateParams
|
| 23 |
+
from .assistant_tool_choice_param import AssistantToolChoiceParam as AssistantToolChoiceParam
|
| 24 |
+
from .code_interpreter_tool_param import CodeInterpreterToolParam as CodeInterpreterToolParam
|
| 25 |
+
from .assistant_tool_choice_option import AssistantToolChoiceOption as AssistantToolChoiceOption
|
| 26 |
+
from .thread_create_and_run_params import ThreadCreateAndRunParams as ThreadCreateAndRunParams
|
| 27 |
+
from .assistant_tool_choice_function import AssistantToolChoiceFunction as AssistantToolChoiceFunction
|
| 28 |
+
from .assistant_response_format_option import AssistantResponseFormatOption as AssistantResponseFormatOption
|
| 29 |
+
from .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam as AssistantToolChoiceOptionParam
|
| 30 |
+
from .assistant_tool_choice_function_param import AssistantToolChoiceFunctionParam as AssistantToolChoiceFunctionParam
|
| 31 |
+
from .assistant_response_format_option_param import (
|
| 32 |
+
AssistantResponseFormatOptionParam as AssistantResponseFormatOptionParam,
|
| 33 |
+
)
|
lib/python3.12/site-packages/openai/types/beta/assistant.py
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 .assistant_tool import AssistantTool
|
| 8 |
+
from ..shared.metadata import Metadata
|
| 9 |
+
from .assistant_response_format_option import AssistantResponseFormatOption
|
| 10 |
+
|
| 11 |
+
__all__ = ["Assistant", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ToolResourcesCodeInterpreter(BaseModel):
|
| 15 |
+
file_ids: Optional[List[str]] = None
|
| 16 |
+
"""
|
| 17 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 18 |
+
available to the `code_interpreter`` tool. There can be a maximum of 20 files
|
| 19 |
+
associated with the tool.
|
| 20 |
+
"""
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
class ToolResourcesFileSearch(BaseModel):
|
| 24 |
+
vector_store_ids: Optional[List[str]] = None
|
| 25 |
+
"""
|
| 26 |
+
The ID of the
|
| 27 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 28 |
+
attached to this assistant. There can be a maximum of 1 vector store attached to
|
| 29 |
+
the assistant.
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class ToolResources(BaseModel):
|
| 34 |
+
code_interpreter: Optional[ToolResourcesCodeInterpreter] = None
|
| 35 |
+
|
| 36 |
+
file_search: Optional[ToolResourcesFileSearch] = None
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
class Assistant(BaseModel):
|
| 40 |
+
id: str
|
| 41 |
+
"""The identifier, which can be referenced in API endpoints."""
|
| 42 |
+
|
| 43 |
+
created_at: int
|
| 44 |
+
"""The Unix timestamp (in seconds) for when the assistant was created."""
|
| 45 |
+
|
| 46 |
+
description: Optional[str] = None
|
| 47 |
+
"""The description of the assistant. The maximum length is 512 characters."""
|
| 48 |
+
|
| 49 |
+
instructions: Optional[str] = None
|
| 50 |
+
"""The system instructions that the assistant uses.
|
| 51 |
+
|
| 52 |
+
The maximum length is 256,000 characters.
|
| 53 |
+
"""
|
| 54 |
+
|
| 55 |
+
metadata: Optional[Metadata] = None
|
| 56 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 57 |
+
|
| 58 |
+
This can be useful for storing additional information about the object in a
|
| 59 |
+
structured format, and querying for objects via API or the dashboard.
|
| 60 |
+
|
| 61 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 62 |
+
a maximum length of 512 characters.
|
| 63 |
+
"""
|
| 64 |
+
|
| 65 |
+
model: str
|
| 66 |
+
"""ID of the model to use.
|
| 67 |
+
|
| 68 |
+
You can use the
|
| 69 |
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
| 70 |
+
see all of your available models, or see our
|
| 71 |
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
| 72 |
+
them.
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
name: Optional[str] = None
|
| 76 |
+
"""The name of the assistant. The maximum length is 256 characters."""
|
| 77 |
+
|
| 78 |
+
object: Literal["assistant"]
|
| 79 |
+
"""The object type, which is always `assistant`."""
|
| 80 |
+
|
| 81 |
+
tools: List[AssistantTool]
|
| 82 |
+
"""A list of tool enabled on the assistant.
|
| 83 |
+
|
| 84 |
+
There can be a maximum of 128 tools per assistant. Tools can be of types
|
| 85 |
+
`code_interpreter`, `file_search`, or `function`.
|
| 86 |
+
"""
|
| 87 |
+
|
| 88 |
+
response_format: Optional[AssistantResponseFormatOption] = None
|
| 89 |
+
"""Specifies the format that the model must output.
|
| 90 |
+
|
| 91 |
+
Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
| 92 |
+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
| 93 |
+
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
| 94 |
+
|
| 95 |
+
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
| 96 |
+
Outputs which ensures the model will match your supplied JSON schema. Learn more
|
| 97 |
+
in the
|
| 98 |
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
| 99 |
+
|
| 100 |
+
Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
| 101 |
+
message the model generates is valid JSON.
|
| 102 |
+
|
| 103 |
+
**Important:** when using JSON mode, you **must** also instruct the model to
|
| 104 |
+
produce JSON yourself via a system or user message. Without this, the model may
|
| 105 |
+
generate an unending stream of whitespace until the generation reaches the token
|
| 106 |
+
limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
| 107 |
+
the message content may be partially cut off if `finish_reason="length"`, which
|
| 108 |
+
indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
| 109 |
+
max context length.
|
| 110 |
+
"""
|
| 111 |
+
|
| 112 |
+
temperature: Optional[float] = None
|
| 113 |
+
"""What sampling temperature to use, between 0 and 2.
|
| 114 |
+
|
| 115 |
+
Higher values like 0.8 will make the output more random, while lower values like
|
| 116 |
+
0.2 will make it more focused and deterministic.
|
| 117 |
+
"""
|
| 118 |
+
|
| 119 |
+
tool_resources: Optional[ToolResources] = None
|
| 120 |
+
"""A set of resources that are used by the assistant's tools.
|
| 121 |
+
|
| 122 |
+
The resources are specific to the type of tool. For example, the
|
| 123 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 124 |
+
tool requires a list of vector store IDs.
|
| 125 |
+
"""
|
| 126 |
+
|
| 127 |
+
top_p: Optional[float] = None
|
| 128 |
+
"""
|
| 129 |
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
| 130 |
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
| 131 |
+
means only the tokens comprising the top 10% probability mass are considered.
|
| 132 |
+
|
| 133 |
+
We generally recommend altering this or temperature but not both.
|
| 134 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/assistant_create_params.py
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import List, Union, Iterable, Optional
|
| 6 |
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
| 7 |
+
|
| 8 |
+
from ..shared.chat_model import ChatModel
|
| 9 |
+
from .assistant_tool_param import AssistantToolParam
|
| 10 |
+
from ..shared_params.metadata import Metadata
|
| 11 |
+
from ..shared.reasoning_effort import ReasoningEffort
|
| 12 |
+
from .assistant_response_format_option_param import AssistantResponseFormatOptionParam
|
| 13 |
+
|
| 14 |
+
__all__ = [
|
| 15 |
+
"AssistantCreateParams",
|
| 16 |
+
"ToolResources",
|
| 17 |
+
"ToolResourcesCodeInterpreter",
|
| 18 |
+
"ToolResourcesFileSearch",
|
| 19 |
+
"ToolResourcesFileSearchVectorStore",
|
| 20 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategy",
|
| 21 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyAuto",
|
| 22 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyStatic",
|
| 23 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic",
|
| 24 |
+
]
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
class AssistantCreateParams(TypedDict, total=False):
|
| 28 |
+
model: Required[Union[str, ChatModel]]
|
| 29 |
+
"""ID of the model to use.
|
| 30 |
+
|
| 31 |
+
You can use the
|
| 32 |
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
| 33 |
+
see all of your available models, or see our
|
| 34 |
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
| 35 |
+
them.
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
description: Optional[str]
|
| 39 |
+
"""The description of the assistant. The maximum length is 512 characters."""
|
| 40 |
+
|
| 41 |
+
instructions: Optional[str]
|
| 42 |
+
"""The system instructions that the assistant uses.
|
| 43 |
+
|
| 44 |
+
The maximum length is 256,000 characters.
|
| 45 |
+
"""
|
| 46 |
+
|
| 47 |
+
metadata: Optional[Metadata]
|
| 48 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 49 |
+
|
| 50 |
+
This can be useful for storing additional information about the object in a
|
| 51 |
+
structured format, and querying for objects via API or the dashboard.
|
| 52 |
+
|
| 53 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 54 |
+
a maximum length of 512 characters.
|
| 55 |
+
"""
|
| 56 |
+
|
| 57 |
+
name: Optional[str]
|
| 58 |
+
"""The name of the assistant. The maximum length is 256 characters."""
|
| 59 |
+
|
| 60 |
+
reasoning_effort: Optional[ReasoningEffort]
|
| 61 |
+
"""**o-series models only**
|
| 62 |
+
|
| 63 |
+
Constrains effort on reasoning for
|
| 64 |
+
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
| 65 |
+
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
|
| 66 |
+
result in faster responses and fewer tokens used on reasoning in a response.
|
| 67 |
+
"""
|
| 68 |
+
|
| 69 |
+
response_format: Optional[AssistantResponseFormatOptionParam]
|
| 70 |
+
"""Specifies the format that the model must output.
|
| 71 |
+
|
| 72 |
+
Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
| 73 |
+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
| 74 |
+
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
| 75 |
+
|
| 76 |
+
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
| 77 |
+
Outputs which ensures the model will match your supplied JSON schema. Learn more
|
| 78 |
+
in the
|
| 79 |
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
| 80 |
+
|
| 81 |
+
Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
| 82 |
+
message the model generates is valid JSON.
|
| 83 |
+
|
| 84 |
+
**Important:** when using JSON mode, you **must** also instruct the model to
|
| 85 |
+
produce JSON yourself via a system or user message. Without this, the model may
|
| 86 |
+
generate an unending stream of whitespace until the generation reaches the token
|
| 87 |
+
limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
| 88 |
+
the message content may be partially cut off if `finish_reason="length"`, which
|
| 89 |
+
indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
| 90 |
+
max context length.
|
| 91 |
+
"""
|
| 92 |
+
|
| 93 |
+
temperature: Optional[float]
|
| 94 |
+
"""What sampling temperature to use, between 0 and 2.
|
| 95 |
+
|
| 96 |
+
Higher values like 0.8 will make the output more random, while lower values like
|
| 97 |
+
0.2 will make it more focused and deterministic.
|
| 98 |
+
"""
|
| 99 |
+
|
| 100 |
+
tool_resources: Optional[ToolResources]
|
| 101 |
+
"""A set of resources that are used by the assistant's tools.
|
| 102 |
+
|
| 103 |
+
The resources are specific to the type of tool. For example, the
|
| 104 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 105 |
+
tool requires a list of vector store IDs.
|
| 106 |
+
"""
|
| 107 |
+
|
| 108 |
+
tools: Iterable[AssistantToolParam]
|
| 109 |
+
"""A list of tool enabled on the assistant.
|
| 110 |
+
|
| 111 |
+
There can be a maximum of 128 tools per assistant. Tools can be of types
|
| 112 |
+
`code_interpreter`, `file_search`, or `function`.
|
| 113 |
+
"""
|
| 114 |
+
|
| 115 |
+
top_p: Optional[float]
|
| 116 |
+
"""
|
| 117 |
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
| 118 |
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
| 119 |
+
means only the tokens comprising the top 10% probability mass are considered.
|
| 120 |
+
|
| 121 |
+
We generally recommend altering this or temperature but not both.
|
| 122 |
+
"""
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 126 |
+
file_ids: List[str]
|
| 127 |
+
"""
|
| 128 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 129 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 130 |
+
associated with the tool.
|
| 131 |
+
"""
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False):
|
| 135 |
+
type: Required[Literal["auto"]]
|
| 136 |
+
"""Always `auto`."""
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False):
|
| 140 |
+
chunk_overlap_tokens: Required[int]
|
| 141 |
+
"""The number of tokens that overlap between chunks. The default value is `400`.
|
| 142 |
+
|
| 143 |
+
Note that the overlap must not exceed half of `max_chunk_size_tokens`.
|
| 144 |
+
"""
|
| 145 |
+
|
| 146 |
+
max_chunk_size_tokens: Required[int]
|
| 147 |
+
"""The maximum number of tokens in each chunk.
|
| 148 |
+
|
| 149 |
+
The default value is `800`. The minimum value is `100` and the maximum value is
|
| 150 |
+
`4096`.
|
| 151 |
+
"""
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False):
|
| 155 |
+
static: Required[ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic]
|
| 156 |
+
|
| 157 |
+
type: Required[Literal["static"]]
|
| 158 |
+
"""Always `static`."""
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
|
| 162 |
+
ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic
|
| 163 |
+
]
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
class ToolResourcesFileSearchVectorStore(TypedDict, total=False):
|
| 167 |
+
chunking_strategy: ToolResourcesFileSearchVectorStoreChunkingStrategy
|
| 168 |
+
"""The chunking strategy used to chunk the file(s).
|
| 169 |
+
|
| 170 |
+
If not set, will use the `auto` strategy.
|
| 171 |
+
"""
|
| 172 |
+
|
| 173 |
+
file_ids: List[str]
|
| 174 |
+
"""
|
| 175 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
|
| 176 |
+
add to the vector store. There can be a maximum of 10000 files in a vector
|
| 177 |
+
store.
|
| 178 |
+
"""
|
| 179 |
+
|
| 180 |
+
metadata: Optional[Metadata]
|
| 181 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 182 |
+
|
| 183 |
+
This can be useful for storing additional information about the object in a
|
| 184 |
+
structured format, and querying for objects via API or the dashboard.
|
| 185 |
+
|
| 186 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 187 |
+
a maximum length of 512 characters.
|
| 188 |
+
"""
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
class ToolResourcesFileSearch(TypedDict, total=False):
|
| 192 |
+
vector_store_ids: List[str]
|
| 193 |
+
"""
|
| 194 |
+
The
|
| 195 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 196 |
+
attached to this assistant. There can be a maximum of 1 vector store attached to
|
| 197 |
+
the assistant.
|
| 198 |
+
"""
|
| 199 |
+
|
| 200 |
+
vector_stores: Iterable[ToolResourcesFileSearchVectorStore]
|
| 201 |
+
"""
|
| 202 |
+
A helper to create a
|
| 203 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 204 |
+
with file_ids and attach it to this assistant. There can be a maximum of 1
|
| 205 |
+
vector store attached to the assistant.
|
| 206 |
+
"""
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
class ToolResources(TypedDict, total=False):
|
| 210 |
+
code_interpreter: ToolResourcesCodeInterpreter
|
| 211 |
+
|
| 212 |
+
file_search: ToolResourcesFileSearch
|
lib/python3.12/site-packages/openai/types/beta/assistant_deleted.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ..._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["AssistantDeleted"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class AssistantDeleted(BaseModel):
|
| 11 |
+
id: str
|
| 12 |
+
|
| 13 |
+
deleted: bool
|
| 14 |
+
|
| 15 |
+
object: Literal["assistant.deleted"]
|
lib/python3.12/site-packages/openai/types/beta/assistant_list_params.py
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["AssistantListParams"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class AssistantListParams(TypedDict, total=False):
|
| 11 |
+
after: str
|
| 12 |
+
"""A cursor for use in pagination.
|
| 13 |
+
|
| 14 |
+
`after` is an object ID that defines your place in the list. For instance, if
|
| 15 |
+
you make a list request and receive 100 objects, ending with obj_foo, your
|
| 16 |
+
subsequent call can include after=obj_foo in order to fetch the next page of the
|
| 17 |
+
list.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
before: str
|
| 21 |
+
"""A cursor for use in pagination.
|
| 22 |
+
|
| 23 |
+
`before` is an object ID that defines your place in the list. For instance, if
|
| 24 |
+
you make a list request and receive 100 objects, starting with obj_foo, your
|
| 25 |
+
subsequent call can include before=obj_foo in order to fetch the previous page
|
| 26 |
+
of the list.
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
limit: int
|
| 30 |
+
"""A limit on the number of objects to be returned.
|
| 31 |
+
|
| 32 |
+
Limit can range between 1 and 100, and the default is 20.
|
| 33 |
+
"""
|
| 34 |
+
|
| 35 |
+
order: Literal["asc", "desc"]
|
| 36 |
+
"""Sort order by the `created_at` timestamp of the objects.
|
| 37 |
+
|
| 38 |
+
`asc` for ascending order and `desc` for descending order.
|
| 39 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/assistant_response_format_option.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Literal, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ..shared.response_format_text import ResponseFormatText
|
| 7 |
+
from ..shared.response_format_json_object import ResponseFormatJSONObject
|
| 8 |
+
from ..shared.response_format_json_schema import ResponseFormatJSONSchema
|
| 9 |
+
|
| 10 |
+
__all__ = ["AssistantResponseFormatOption"]
|
| 11 |
+
|
| 12 |
+
AssistantResponseFormatOption: TypeAlias = Union[
|
| 13 |
+
Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema
|
| 14 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/assistant_response_format_option_param.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Union
|
| 6 |
+
from typing_extensions import Literal, TypeAlias
|
| 7 |
+
|
| 8 |
+
from ..shared_params.response_format_text import ResponseFormatText
|
| 9 |
+
from ..shared_params.response_format_json_object import ResponseFormatJSONObject
|
| 10 |
+
from ..shared_params.response_format_json_schema import ResponseFormatJSONSchema
|
| 11 |
+
|
| 12 |
+
__all__ = ["AssistantResponseFormatOptionParam"]
|
| 13 |
+
|
| 14 |
+
AssistantResponseFormatOptionParam: TypeAlias = Union[
|
| 15 |
+
Literal["auto"], ResponseFormatText, ResponseFormatJSONObject, ResponseFormatJSONSchema
|
| 16 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/assistant_stream_event.py
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union, Optional
|
| 4 |
+
from typing_extensions import Literal, Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from .thread import Thread
|
| 7 |
+
from ..._utils import PropertyInfo
|
| 8 |
+
from ..._models import BaseModel
|
| 9 |
+
from .threads.run import Run
|
| 10 |
+
from .threads.message import Message
|
| 11 |
+
from ..shared.error_object import ErrorObject
|
| 12 |
+
from .threads.runs.run_step import RunStep
|
| 13 |
+
from .threads.message_delta_event import MessageDeltaEvent
|
| 14 |
+
from .threads.runs.run_step_delta_event import RunStepDeltaEvent
|
| 15 |
+
|
| 16 |
+
__all__ = [
|
| 17 |
+
"AssistantStreamEvent",
|
| 18 |
+
"ThreadCreated",
|
| 19 |
+
"ThreadRunCreated",
|
| 20 |
+
"ThreadRunQueued",
|
| 21 |
+
"ThreadRunInProgress",
|
| 22 |
+
"ThreadRunRequiresAction",
|
| 23 |
+
"ThreadRunCompleted",
|
| 24 |
+
"ThreadRunIncomplete",
|
| 25 |
+
"ThreadRunFailed",
|
| 26 |
+
"ThreadRunCancelling",
|
| 27 |
+
"ThreadRunCancelled",
|
| 28 |
+
"ThreadRunExpired",
|
| 29 |
+
"ThreadRunStepCreated",
|
| 30 |
+
"ThreadRunStepInProgress",
|
| 31 |
+
"ThreadRunStepDelta",
|
| 32 |
+
"ThreadRunStepCompleted",
|
| 33 |
+
"ThreadRunStepFailed",
|
| 34 |
+
"ThreadRunStepCancelled",
|
| 35 |
+
"ThreadRunStepExpired",
|
| 36 |
+
"ThreadMessageCreated",
|
| 37 |
+
"ThreadMessageInProgress",
|
| 38 |
+
"ThreadMessageDelta",
|
| 39 |
+
"ThreadMessageCompleted",
|
| 40 |
+
"ThreadMessageIncomplete",
|
| 41 |
+
"ErrorEvent",
|
| 42 |
+
]
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
class ThreadCreated(BaseModel):
|
| 46 |
+
data: Thread
|
| 47 |
+
"""
|
| 48 |
+
Represents a thread that contains
|
| 49 |
+
[messages](https://platform.openai.com/docs/api-reference/messages).
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
event: Literal["thread.created"]
|
| 53 |
+
|
| 54 |
+
enabled: Optional[bool] = None
|
| 55 |
+
"""Whether to enable input audio transcription."""
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
class ThreadRunCreated(BaseModel):
|
| 59 |
+
data: Run
|
| 60 |
+
"""
|
| 61 |
+
Represents an execution run on a
|
| 62 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 63 |
+
"""
|
| 64 |
+
|
| 65 |
+
event: Literal["thread.run.created"]
|
| 66 |
+
|
| 67 |
+
|
| 68 |
+
class ThreadRunQueued(BaseModel):
|
| 69 |
+
data: Run
|
| 70 |
+
"""
|
| 71 |
+
Represents an execution run on a
|
| 72 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 73 |
+
"""
|
| 74 |
+
|
| 75 |
+
event: Literal["thread.run.queued"]
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
class ThreadRunInProgress(BaseModel):
|
| 79 |
+
data: Run
|
| 80 |
+
"""
|
| 81 |
+
Represents an execution run on a
|
| 82 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 83 |
+
"""
|
| 84 |
+
|
| 85 |
+
event: Literal["thread.run.in_progress"]
|
| 86 |
+
|
| 87 |
+
|
| 88 |
+
class ThreadRunRequiresAction(BaseModel):
|
| 89 |
+
data: Run
|
| 90 |
+
"""
|
| 91 |
+
Represents an execution run on a
|
| 92 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 93 |
+
"""
|
| 94 |
+
|
| 95 |
+
event: Literal["thread.run.requires_action"]
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
class ThreadRunCompleted(BaseModel):
|
| 99 |
+
data: Run
|
| 100 |
+
"""
|
| 101 |
+
Represents an execution run on a
|
| 102 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 103 |
+
"""
|
| 104 |
+
|
| 105 |
+
event: Literal["thread.run.completed"]
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
class ThreadRunIncomplete(BaseModel):
|
| 109 |
+
data: Run
|
| 110 |
+
"""
|
| 111 |
+
Represents an execution run on a
|
| 112 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 113 |
+
"""
|
| 114 |
+
|
| 115 |
+
event: Literal["thread.run.incomplete"]
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
class ThreadRunFailed(BaseModel):
|
| 119 |
+
data: Run
|
| 120 |
+
"""
|
| 121 |
+
Represents an execution run on a
|
| 122 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 123 |
+
"""
|
| 124 |
+
|
| 125 |
+
event: Literal["thread.run.failed"]
|
| 126 |
+
|
| 127 |
+
|
| 128 |
+
class ThreadRunCancelling(BaseModel):
|
| 129 |
+
data: Run
|
| 130 |
+
"""
|
| 131 |
+
Represents an execution run on a
|
| 132 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 133 |
+
"""
|
| 134 |
+
|
| 135 |
+
event: Literal["thread.run.cancelling"]
|
| 136 |
+
|
| 137 |
+
|
| 138 |
+
class ThreadRunCancelled(BaseModel):
|
| 139 |
+
data: Run
|
| 140 |
+
"""
|
| 141 |
+
Represents an execution run on a
|
| 142 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 143 |
+
"""
|
| 144 |
+
|
| 145 |
+
event: Literal["thread.run.cancelled"]
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
class ThreadRunExpired(BaseModel):
|
| 149 |
+
data: Run
|
| 150 |
+
"""
|
| 151 |
+
Represents an execution run on a
|
| 152 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 153 |
+
"""
|
| 154 |
+
|
| 155 |
+
event: Literal["thread.run.expired"]
|
| 156 |
+
|
| 157 |
+
|
| 158 |
+
class ThreadRunStepCreated(BaseModel):
|
| 159 |
+
data: RunStep
|
| 160 |
+
"""Represents a step in execution of a run."""
|
| 161 |
+
|
| 162 |
+
event: Literal["thread.run.step.created"]
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
class ThreadRunStepInProgress(BaseModel):
|
| 166 |
+
data: RunStep
|
| 167 |
+
"""Represents a step in execution of a run."""
|
| 168 |
+
|
| 169 |
+
event: Literal["thread.run.step.in_progress"]
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
class ThreadRunStepDelta(BaseModel):
|
| 173 |
+
data: RunStepDeltaEvent
|
| 174 |
+
"""Represents a run step delta i.e.
|
| 175 |
+
|
| 176 |
+
any changed fields on a run step during streaming.
|
| 177 |
+
"""
|
| 178 |
+
|
| 179 |
+
event: Literal["thread.run.step.delta"]
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
class ThreadRunStepCompleted(BaseModel):
|
| 183 |
+
data: RunStep
|
| 184 |
+
"""Represents a step in execution of a run."""
|
| 185 |
+
|
| 186 |
+
event: Literal["thread.run.step.completed"]
|
| 187 |
+
|
| 188 |
+
|
| 189 |
+
class ThreadRunStepFailed(BaseModel):
|
| 190 |
+
data: RunStep
|
| 191 |
+
"""Represents a step in execution of a run."""
|
| 192 |
+
|
| 193 |
+
event: Literal["thread.run.step.failed"]
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
class ThreadRunStepCancelled(BaseModel):
|
| 197 |
+
data: RunStep
|
| 198 |
+
"""Represents a step in execution of a run."""
|
| 199 |
+
|
| 200 |
+
event: Literal["thread.run.step.cancelled"]
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
class ThreadRunStepExpired(BaseModel):
|
| 204 |
+
data: RunStep
|
| 205 |
+
"""Represents a step in execution of a run."""
|
| 206 |
+
|
| 207 |
+
event: Literal["thread.run.step.expired"]
|
| 208 |
+
|
| 209 |
+
|
| 210 |
+
class ThreadMessageCreated(BaseModel):
|
| 211 |
+
data: Message
|
| 212 |
+
"""
|
| 213 |
+
Represents a message within a
|
| 214 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 215 |
+
"""
|
| 216 |
+
|
| 217 |
+
event: Literal["thread.message.created"]
|
| 218 |
+
|
| 219 |
+
|
| 220 |
+
class ThreadMessageInProgress(BaseModel):
|
| 221 |
+
data: Message
|
| 222 |
+
"""
|
| 223 |
+
Represents a message within a
|
| 224 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 225 |
+
"""
|
| 226 |
+
|
| 227 |
+
event: Literal["thread.message.in_progress"]
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
class ThreadMessageDelta(BaseModel):
|
| 231 |
+
data: MessageDeltaEvent
|
| 232 |
+
"""Represents a message delta i.e.
|
| 233 |
+
|
| 234 |
+
any changed fields on a message during streaming.
|
| 235 |
+
"""
|
| 236 |
+
|
| 237 |
+
event: Literal["thread.message.delta"]
|
| 238 |
+
|
| 239 |
+
|
| 240 |
+
class ThreadMessageCompleted(BaseModel):
|
| 241 |
+
data: Message
|
| 242 |
+
"""
|
| 243 |
+
Represents a message within a
|
| 244 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 245 |
+
"""
|
| 246 |
+
|
| 247 |
+
event: Literal["thread.message.completed"]
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
class ThreadMessageIncomplete(BaseModel):
|
| 251 |
+
data: Message
|
| 252 |
+
"""
|
| 253 |
+
Represents a message within a
|
| 254 |
+
[thread](https://platform.openai.com/docs/api-reference/threads).
|
| 255 |
+
"""
|
| 256 |
+
|
| 257 |
+
event: Literal["thread.message.incomplete"]
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
class ErrorEvent(BaseModel):
|
| 261 |
+
data: ErrorObject
|
| 262 |
+
|
| 263 |
+
event: Literal["error"]
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
AssistantStreamEvent: TypeAlias = Annotated[
|
| 267 |
+
Union[
|
| 268 |
+
ThreadCreated,
|
| 269 |
+
ThreadRunCreated,
|
| 270 |
+
ThreadRunQueued,
|
| 271 |
+
ThreadRunInProgress,
|
| 272 |
+
ThreadRunRequiresAction,
|
| 273 |
+
ThreadRunCompleted,
|
| 274 |
+
ThreadRunIncomplete,
|
| 275 |
+
ThreadRunFailed,
|
| 276 |
+
ThreadRunCancelling,
|
| 277 |
+
ThreadRunCancelled,
|
| 278 |
+
ThreadRunExpired,
|
| 279 |
+
ThreadRunStepCreated,
|
| 280 |
+
ThreadRunStepInProgress,
|
| 281 |
+
ThreadRunStepDelta,
|
| 282 |
+
ThreadRunStepCompleted,
|
| 283 |
+
ThreadRunStepFailed,
|
| 284 |
+
ThreadRunStepCancelled,
|
| 285 |
+
ThreadRunStepExpired,
|
| 286 |
+
ThreadMessageCreated,
|
| 287 |
+
ThreadMessageInProgress,
|
| 288 |
+
ThreadMessageDelta,
|
| 289 |
+
ThreadMessageCompleted,
|
| 290 |
+
ThreadMessageIncomplete,
|
| 291 |
+
ErrorEvent,
|
| 292 |
+
],
|
| 293 |
+
PropertyInfo(discriminator="event"),
|
| 294 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ..._utils import PropertyInfo
|
| 7 |
+
from .function_tool import FunctionTool
|
| 8 |
+
from .file_search_tool import FileSearchTool
|
| 9 |
+
from .code_interpreter_tool import CodeInterpreterTool
|
| 10 |
+
|
| 11 |
+
__all__ = ["AssistantTool"]
|
| 12 |
+
|
| 13 |
+
AssistantTool: TypeAlias = Annotated[
|
| 14 |
+
Union[CodeInterpreterTool, FileSearchTool, FunctionTool], PropertyInfo(discriminator="type")
|
| 15 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ..._models import BaseModel
|
| 7 |
+
from .assistant_tool_choice_function import AssistantToolChoiceFunction
|
| 8 |
+
|
| 9 |
+
__all__ = ["AssistantToolChoice"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class AssistantToolChoice(BaseModel):
|
| 13 |
+
type: Literal["function", "code_interpreter", "file_search"]
|
| 14 |
+
"""The type of the tool. If type is `function`, the function name must be set"""
|
| 15 |
+
|
| 16 |
+
function: Optional[AssistantToolChoiceFunction] = None
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function.py
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
from ..._models import BaseModel
|
| 5 |
+
|
| 6 |
+
__all__ = ["AssistantToolChoiceFunction"]
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
class AssistantToolChoiceFunction(BaseModel):
|
| 10 |
+
name: str
|
| 11 |
+
"""The name of the function to call."""
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_function_param.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["AssistantToolChoiceFunctionParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class AssistantToolChoiceFunctionParam(TypedDict, total=False):
|
| 11 |
+
name: Required[str]
|
| 12 |
+
"""The name of the function to call."""
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_option.py
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Literal, TypeAlias
|
| 5 |
+
|
| 6 |
+
from .assistant_tool_choice import AssistantToolChoice
|
| 7 |
+
|
| 8 |
+
__all__ = ["AssistantToolChoiceOption"]
|
| 9 |
+
|
| 10 |
+
AssistantToolChoiceOption: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoice]
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_option_param.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Union
|
| 6 |
+
from typing_extensions import Literal, TypeAlias
|
| 7 |
+
|
| 8 |
+
from .assistant_tool_choice_param import AssistantToolChoiceParam
|
| 9 |
+
|
| 10 |
+
__all__ = ["AssistantToolChoiceOptionParam"]
|
| 11 |
+
|
| 12 |
+
AssistantToolChoiceOptionParam: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoiceParam]
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_choice_param.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
from .assistant_tool_choice_function_param import AssistantToolChoiceFunctionParam
|
| 8 |
+
|
| 9 |
+
__all__ = ["AssistantToolChoiceParam"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class AssistantToolChoiceParam(TypedDict, total=False):
|
| 13 |
+
type: Required[Literal["function", "code_interpreter", "file_search"]]
|
| 14 |
+
"""The type of the tool. If type is `function`, the function name must be set"""
|
| 15 |
+
|
| 16 |
+
function: AssistantToolChoiceFunctionParam
|
lib/python3.12/site-packages/openai/types/beta/assistant_tool_param.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import Union
|
| 6 |
+
from typing_extensions import TypeAlias
|
| 7 |
+
|
| 8 |
+
from .function_tool_param import FunctionToolParam
|
| 9 |
+
from .file_search_tool_param import FileSearchToolParam
|
| 10 |
+
from .code_interpreter_tool_param import CodeInterpreterToolParam
|
| 11 |
+
|
| 12 |
+
__all__ = ["AssistantToolParam"]
|
| 13 |
+
|
| 14 |
+
AssistantToolParam: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]
|
lib/python3.12/site-packages/openai/types/beta/assistant_update_params.py
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import List, Union, Iterable, Optional
|
| 6 |
+
from typing_extensions import Literal, TypedDict
|
| 7 |
+
|
| 8 |
+
from .assistant_tool_param import AssistantToolParam
|
| 9 |
+
from ..shared_params.metadata import Metadata
|
| 10 |
+
from ..shared.reasoning_effort import ReasoningEffort
|
| 11 |
+
from .assistant_response_format_option_param import AssistantResponseFormatOptionParam
|
| 12 |
+
|
| 13 |
+
__all__ = ["AssistantUpdateParams", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class AssistantUpdateParams(TypedDict, total=False):
|
| 17 |
+
description: Optional[str]
|
| 18 |
+
"""The description of the assistant. The maximum length is 512 characters."""
|
| 19 |
+
|
| 20 |
+
instructions: Optional[str]
|
| 21 |
+
"""The system instructions that the assistant uses.
|
| 22 |
+
|
| 23 |
+
The maximum length is 256,000 characters.
|
| 24 |
+
"""
|
| 25 |
+
|
| 26 |
+
metadata: Optional[Metadata]
|
| 27 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 28 |
+
|
| 29 |
+
This can be useful for storing additional information about the object in a
|
| 30 |
+
structured format, and querying for objects via API or the dashboard.
|
| 31 |
+
|
| 32 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 33 |
+
a maximum length of 512 characters.
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
model: Union[
|
| 37 |
+
str,
|
| 38 |
+
Literal[
|
| 39 |
+
"gpt-4.1",
|
| 40 |
+
"gpt-4.1-mini",
|
| 41 |
+
"gpt-4.1-nano",
|
| 42 |
+
"gpt-4.1-2025-04-14",
|
| 43 |
+
"gpt-4.1-mini-2025-04-14",
|
| 44 |
+
"gpt-4.1-nano-2025-04-14",
|
| 45 |
+
"o3-mini",
|
| 46 |
+
"o3-mini-2025-01-31",
|
| 47 |
+
"o1",
|
| 48 |
+
"o1-2024-12-17",
|
| 49 |
+
"gpt-4o",
|
| 50 |
+
"gpt-4o-2024-11-20",
|
| 51 |
+
"gpt-4o-2024-08-06",
|
| 52 |
+
"gpt-4o-2024-05-13",
|
| 53 |
+
"gpt-4o-mini",
|
| 54 |
+
"gpt-4o-mini-2024-07-18",
|
| 55 |
+
"gpt-4.5-preview",
|
| 56 |
+
"gpt-4.5-preview-2025-02-27",
|
| 57 |
+
"gpt-4-turbo",
|
| 58 |
+
"gpt-4-turbo-2024-04-09",
|
| 59 |
+
"gpt-4-0125-preview",
|
| 60 |
+
"gpt-4-turbo-preview",
|
| 61 |
+
"gpt-4-1106-preview",
|
| 62 |
+
"gpt-4-vision-preview",
|
| 63 |
+
"gpt-4",
|
| 64 |
+
"gpt-4-0314",
|
| 65 |
+
"gpt-4-0613",
|
| 66 |
+
"gpt-4-32k",
|
| 67 |
+
"gpt-4-32k-0314",
|
| 68 |
+
"gpt-4-32k-0613",
|
| 69 |
+
"gpt-3.5-turbo",
|
| 70 |
+
"gpt-3.5-turbo-16k",
|
| 71 |
+
"gpt-3.5-turbo-0613",
|
| 72 |
+
"gpt-3.5-turbo-1106",
|
| 73 |
+
"gpt-3.5-turbo-0125",
|
| 74 |
+
"gpt-3.5-turbo-16k-0613",
|
| 75 |
+
],
|
| 76 |
+
]
|
| 77 |
+
"""ID of the model to use.
|
| 78 |
+
|
| 79 |
+
You can use the
|
| 80 |
+
[List models](https://platform.openai.com/docs/api-reference/models/list) API to
|
| 81 |
+
see all of your available models, or see our
|
| 82 |
+
[Model overview](https://platform.openai.com/docs/models) for descriptions of
|
| 83 |
+
them.
|
| 84 |
+
"""
|
| 85 |
+
|
| 86 |
+
name: Optional[str]
|
| 87 |
+
"""The name of the assistant. The maximum length is 256 characters."""
|
| 88 |
+
|
| 89 |
+
reasoning_effort: Optional[ReasoningEffort]
|
| 90 |
+
"""**o-series models only**
|
| 91 |
+
|
| 92 |
+
Constrains effort on reasoning for
|
| 93 |
+
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
|
| 94 |
+
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
|
| 95 |
+
result in faster responses and fewer tokens used on reasoning in a response.
|
| 96 |
+
"""
|
| 97 |
+
|
| 98 |
+
response_format: Optional[AssistantResponseFormatOptionParam]
|
| 99 |
+
"""Specifies the format that the model must output.
|
| 100 |
+
|
| 101 |
+
Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
| 102 |
+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
| 103 |
+
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
| 104 |
+
|
| 105 |
+
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
| 106 |
+
Outputs which ensures the model will match your supplied JSON schema. Learn more
|
| 107 |
+
in the
|
| 108 |
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
| 109 |
+
|
| 110 |
+
Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
| 111 |
+
message the model generates is valid JSON.
|
| 112 |
+
|
| 113 |
+
**Important:** when using JSON mode, you **must** also instruct the model to
|
| 114 |
+
produce JSON yourself via a system or user message. Without this, the model may
|
| 115 |
+
generate an unending stream of whitespace until the generation reaches the token
|
| 116 |
+
limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
| 117 |
+
the message content may be partially cut off if `finish_reason="length"`, which
|
| 118 |
+
indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
| 119 |
+
max context length.
|
| 120 |
+
"""
|
| 121 |
+
|
| 122 |
+
temperature: Optional[float]
|
| 123 |
+
"""What sampling temperature to use, between 0 and 2.
|
| 124 |
+
|
| 125 |
+
Higher values like 0.8 will make the output more random, while lower values like
|
| 126 |
+
0.2 will make it more focused and deterministic.
|
| 127 |
+
"""
|
| 128 |
+
|
| 129 |
+
tool_resources: Optional[ToolResources]
|
| 130 |
+
"""A set of resources that are used by the assistant's tools.
|
| 131 |
+
|
| 132 |
+
The resources are specific to the type of tool. For example, the
|
| 133 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 134 |
+
tool requires a list of vector store IDs.
|
| 135 |
+
"""
|
| 136 |
+
|
| 137 |
+
tools: Iterable[AssistantToolParam]
|
| 138 |
+
"""A list of tool enabled on the assistant.
|
| 139 |
+
|
| 140 |
+
There can be a maximum of 128 tools per assistant. Tools can be of types
|
| 141 |
+
`code_interpreter`, `file_search`, or `function`.
|
| 142 |
+
"""
|
| 143 |
+
|
| 144 |
+
top_p: Optional[float]
|
| 145 |
+
"""
|
| 146 |
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
| 147 |
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
| 148 |
+
means only the tokens comprising the top 10% probability mass are considered.
|
| 149 |
+
|
| 150 |
+
We generally recommend altering this or temperature but not both.
|
| 151 |
+
"""
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 155 |
+
file_ids: List[str]
|
| 156 |
+
"""
|
| 157 |
+
Overrides the list of
|
| 158 |
+
[file](https://platform.openai.com/docs/api-reference/files) IDs made available
|
| 159 |
+
to the `code_interpreter` tool. There can be a maximum of 20 files associated
|
| 160 |
+
with the tool.
|
| 161 |
+
"""
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
class ToolResourcesFileSearch(TypedDict, total=False):
|
| 165 |
+
vector_store_ids: List[str]
|
| 166 |
+
"""
|
| 167 |
+
Overrides the
|
| 168 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 169 |
+
attached to this assistant. There can be a maximum of 1 vector store attached to
|
| 170 |
+
the assistant.
|
| 171 |
+
"""
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
class ToolResources(TypedDict, total=False):
|
| 175 |
+
code_interpreter: ToolResourcesCodeInterpreter
|
| 176 |
+
|
| 177 |
+
file_search: ToolResourcesFileSearch
|
lib/python3.12/site-packages/openai/types/beta/code_interpreter_tool.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ..._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["CodeInterpreterTool"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class CodeInterpreterTool(BaseModel):
|
| 11 |
+
type: Literal["code_interpreter"]
|
| 12 |
+
"""The type of tool being defined: `code_interpreter`"""
|
lib/python3.12/site-packages/openai/types/beta/code_interpreter_tool_param.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["CodeInterpreterToolParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class CodeInterpreterToolParam(TypedDict, total=False):
|
| 11 |
+
type: Required[Literal["code_interpreter"]]
|
| 12 |
+
"""The type of tool being defined: `code_interpreter`"""
|
lib/python3.12/site-packages/openai/types/beta/file_search_tool.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ..._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["FileSearchTool", "FileSearch", "FileSearchRankingOptions"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class FileSearchRankingOptions(BaseModel):
|
| 12 |
+
score_threshold: float
|
| 13 |
+
"""The score threshold for the file search.
|
| 14 |
+
|
| 15 |
+
All values must be a floating point number between 0 and 1.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
ranker: Optional[Literal["auto", "default_2024_08_21"]] = None
|
| 19 |
+
"""The ranker to use for the file search.
|
| 20 |
+
|
| 21 |
+
If not specified will use the `auto` ranker.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
class FileSearch(BaseModel):
|
| 26 |
+
max_num_results: Optional[int] = None
|
| 27 |
+
"""The maximum number of results the file search tool should output.
|
| 28 |
+
|
| 29 |
+
The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number
|
| 30 |
+
should be between 1 and 50 inclusive.
|
| 31 |
+
|
| 32 |
+
Note that the file search tool may output fewer than `max_num_results` results.
|
| 33 |
+
See the
|
| 34 |
+
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
| 35 |
+
for more information.
|
| 36 |
+
"""
|
| 37 |
+
|
| 38 |
+
ranking_options: Optional[FileSearchRankingOptions] = None
|
| 39 |
+
"""The ranking options for the file search.
|
| 40 |
+
|
| 41 |
+
If not specified, the file search tool will use the `auto` ranker and a
|
| 42 |
+
score_threshold of 0.
|
| 43 |
+
|
| 44 |
+
See the
|
| 45 |
+
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
| 46 |
+
for more information.
|
| 47 |
+
"""
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
class FileSearchTool(BaseModel):
|
| 51 |
+
type: Literal["file_search"]
|
| 52 |
+
"""The type of tool being defined: `file_search`"""
|
| 53 |
+
|
| 54 |
+
file_search: Optional[FileSearch] = None
|
| 55 |
+
"""Overrides for the file search tool."""
|
lib/python3.12/site-packages/openai/types/beta/file_search_tool_param.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["FileSearchToolParam", "FileSearch", "FileSearchRankingOptions"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class FileSearchRankingOptions(TypedDict, total=False):
|
| 11 |
+
score_threshold: Required[float]
|
| 12 |
+
"""The score threshold for the file search.
|
| 13 |
+
|
| 14 |
+
All values must be a floating point number between 0 and 1.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
ranker: Literal["auto", "default_2024_08_21"]
|
| 18 |
+
"""The ranker to use for the file search.
|
| 19 |
+
|
| 20 |
+
If not specified will use the `auto` ranker.
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
class FileSearch(TypedDict, total=False):
|
| 25 |
+
max_num_results: int
|
| 26 |
+
"""The maximum number of results the file search tool should output.
|
| 27 |
+
|
| 28 |
+
The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number
|
| 29 |
+
should be between 1 and 50 inclusive.
|
| 30 |
+
|
| 31 |
+
Note that the file search tool may output fewer than `max_num_results` results.
|
| 32 |
+
See the
|
| 33 |
+
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
| 34 |
+
for more information.
|
| 35 |
+
"""
|
| 36 |
+
|
| 37 |
+
ranking_options: FileSearchRankingOptions
|
| 38 |
+
"""The ranking options for the file search.
|
| 39 |
+
|
| 40 |
+
If not specified, the file search tool will use the `auto` ranker and a
|
| 41 |
+
score_threshold of 0.
|
| 42 |
+
|
| 43 |
+
See the
|
| 44 |
+
[file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings)
|
| 45 |
+
for more information.
|
| 46 |
+
"""
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
class FileSearchToolParam(TypedDict, total=False):
|
| 50 |
+
type: Required[Literal["file_search"]]
|
| 51 |
+
"""The type of tool being defined: `file_search`"""
|
| 52 |
+
|
| 53 |
+
file_search: FileSearch
|
| 54 |
+
"""Overrides for the file search tool."""
|
lib/python3.12/site-packages/openai/types/beta/function_tool.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ..._models import BaseModel
|
| 6 |
+
from ..shared.function_definition import FunctionDefinition
|
| 7 |
+
|
| 8 |
+
__all__ = ["FunctionTool"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class FunctionTool(BaseModel):
|
| 12 |
+
function: FunctionDefinition
|
| 13 |
+
|
| 14 |
+
type: Literal["function"]
|
| 15 |
+
"""The type of tool being defined: `function`"""
|
lib/python3.12/site-packages/openai/types/beta/function_tool_param.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
from ..shared_params.function_definition import FunctionDefinition
|
| 8 |
+
|
| 9 |
+
__all__ = ["FunctionToolParam"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class FunctionToolParam(TypedDict, total=False):
|
| 13 |
+
function: Required[FunctionDefinition]
|
| 14 |
+
|
| 15 |
+
type: Required[Literal["function"]]
|
| 16 |
+
"""The type of tool being defined: `function`"""
|
lib/python3.12/site-packages/openai/types/beta/thread.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 ..shared.metadata import Metadata
|
| 8 |
+
|
| 9 |
+
__all__ = ["Thread", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ToolResourcesCodeInterpreter(BaseModel):
|
| 13 |
+
file_ids: Optional[List[str]] = None
|
| 14 |
+
"""
|
| 15 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 16 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 17 |
+
associated with the tool.
|
| 18 |
+
"""
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
class ToolResourcesFileSearch(BaseModel):
|
| 22 |
+
vector_store_ids: Optional[List[str]] = None
|
| 23 |
+
"""
|
| 24 |
+
The
|
| 25 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 26 |
+
attached to this thread. There can be a maximum of 1 vector store attached to
|
| 27 |
+
the thread.
|
| 28 |
+
"""
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
class ToolResources(BaseModel):
|
| 32 |
+
code_interpreter: Optional[ToolResourcesCodeInterpreter] = None
|
| 33 |
+
|
| 34 |
+
file_search: Optional[ToolResourcesFileSearch] = None
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class Thread(BaseModel):
|
| 38 |
+
id: str
|
| 39 |
+
"""The identifier, which can be referenced in API endpoints."""
|
| 40 |
+
|
| 41 |
+
created_at: int
|
| 42 |
+
"""The Unix timestamp (in seconds) for when the thread was created."""
|
| 43 |
+
|
| 44 |
+
metadata: Optional[Metadata] = None
|
| 45 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 46 |
+
|
| 47 |
+
This can be useful for storing additional information about the object in a
|
| 48 |
+
structured format, and querying for objects via API or the dashboard.
|
| 49 |
+
|
| 50 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 51 |
+
a maximum length of 512 characters.
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
object: Literal["thread"]
|
| 55 |
+
"""The object type, which is always `thread`."""
|
| 56 |
+
|
| 57 |
+
tool_resources: Optional[ToolResources] = None
|
| 58 |
+
"""
|
| 59 |
+
A set of resources that are made available to the assistant's tools in this
|
| 60 |
+
thread. The resources are specific to the type of tool. For example, the
|
| 61 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 62 |
+
tool requires a list of vector store IDs.
|
| 63 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/thread_create_and_run_params.py
ADDED
|
@@ -0,0 +1,401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import List, Union, Iterable, Optional
|
| 6 |
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
| 7 |
+
|
| 8 |
+
from ..shared.chat_model import ChatModel
|
| 9 |
+
from .function_tool_param import FunctionToolParam
|
| 10 |
+
from .file_search_tool_param import FileSearchToolParam
|
| 11 |
+
from ..shared_params.metadata import Metadata
|
| 12 |
+
from .code_interpreter_tool_param import CodeInterpreterToolParam
|
| 13 |
+
from .assistant_tool_choice_option_param import AssistantToolChoiceOptionParam
|
| 14 |
+
from .threads.message_content_part_param import MessageContentPartParam
|
| 15 |
+
from .assistant_response_format_option_param import AssistantResponseFormatOptionParam
|
| 16 |
+
|
| 17 |
+
__all__ = [
|
| 18 |
+
"ThreadCreateAndRunParamsBase",
|
| 19 |
+
"Thread",
|
| 20 |
+
"ThreadMessage",
|
| 21 |
+
"ThreadMessageAttachment",
|
| 22 |
+
"ThreadMessageAttachmentTool",
|
| 23 |
+
"ThreadMessageAttachmentToolFileSearch",
|
| 24 |
+
"ThreadToolResources",
|
| 25 |
+
"ThreadToolResourcesCodeInterpreter",
|
| 26 |
+
"ThreadToolResourcesFileSearch",
|
| 27 |
+
"ThreadToolResourcesFileSearchVectorStore",
|
| 28 |
+
"ThreadToolResourcesFileSearchVectorStoreChunkingStrategy",
|
| 29 |
+
"ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto",
|
| 30 |
+
"ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic",
|
| 31 |
+
"ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic",
|
| 32 |
+
"ToolResources",
|
| 33 |
+
"ToolResourcesCodeInterpreter",
|
| 34 |
+
"ToolResourcesFileSearch",
|
| 35 |
+
"Tool",
|
| 36 |
+
"TruncationStrategy",
|
| 37 |
+
"ThreadCreateAndRunParamsNonStreaming",
|
| 38 |
+
"ThreadCreateAndRunParamsStreaming",
|
| 39 |
+
]
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class ThreadCreateAndRunParamsBase(TypedDict, total=False):
|
| 43 |
+
assistant_id: Required[str]
|
| 44 |
+
"""
|
| 45 |
+
The ID of the
|
| 46 |
+
[assistant](https://platform.openai.com/docs/api-reference/assistants) to use to
|
| 47 |
+
execute this run.
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
instructions: Optional[str]
|
| 51 |
+
"""Override the default system message of the assistant.
|
| 52 |
+
|
| 53 |
+
This is useful for modifying the behavior on a per-run basis.
|
| 54 |
+
"""
|
| 55 |
+
|
| 56 |
+
max_completion_tokens: Optional[int]
|
| 57 |
+
"""
|
| 58 |
+
The maximum number of completion tokens that may be used over the course of the
|
| 59 |
+
run. The run will make a best effort to use only the number of completion tokens
|
| 60 |
+
specified, across multiple turns of the run. If the run exceeds the number of
|
| 61 |
+
completion tokens specified, the run will end with status `incomplete`. See
|
| 62 |
+
`incomplete_details` for more info.
|
| 63 |
+
"""
|
| 64 |
+
|
| 65 |
+
max_prompt_tokens: Optional[int]
|
| 66 |
+
"""The maximum number of prompt tokens that may be used over the course of the run.
|
| 67 |
+
|
| 68 |
+
The run will make a best effort to use only the number of prompt tokens
|
| 69 |
+
specified, across multiple turns of the run. If the run exceeds the number of
|
| 70 |
+
prompt tokens specified, the run will end with status `incomplete`. See
|
| 71 |
+
`incomplete_details` for more info.
|
| 72 |
+
"""
|
| 73 |
+
|
| 74 |
+
metadata: Optional[Metadata]
|
| 75 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 76 |
+
|
| 77 |
+
This can be useful for storing additional information about the object in a
|
| 78 |
+
structured format, and querying for objects via API or the dashboard.
|
| 79 |
+
|
| 80 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 81 |
+
a maximum length of 512 characters.
|
| 82 |
+
"""
|
| 83 |
+
|
| 84 |
+
model: Union[str, ChatModel, None]
|
| 85 |
+
"""
|
| 86 |
+
The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to
|
| 87 |
+
be used to execute this run. If a value is provided here, it will override the
|
| 88 |
+
model associated with the assistant. If not, the model associated with the
|
| 89 |
+
assistant will be used.
|
| 90 |
+
"""
|
| 91 |
+
|
| 92 |
+
parallel_tool_calls: bool
|
| 93 |
+
"""
|
| 94 |
+
Whether to enable
|
| 95 |
+
[parallel function calling](https://platform.openai.com/docs/guides/function-calling#configuring-parallel-function-calling)
|
| 96 |
+
during tool use.
|
| 97 |
+
"""
|
| 98 |
+
|
| 99 |
+
response_format: Optional[AssistantResponseFormatOptionParam]
|
| 100 |
+
"""Specifies the format that the model must output.
|
| 101 |
+
|
| 102 |
+
Compatible with [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
|
| 103 |
+
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
|
| 104 |
+
and all GPT-3.5 Turbo models since `gpt-3.5-turbo-1106`.
|
| 105 |
+
|
| 106 |
+
Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured
|
| 107 |
+
Outputs which ensures the model will match your supplied JSON schema. Learn more
|
| 108 |
+
in the
|
| 109 |
+
[Structured Outputs guide](https://platform.openai.com/docs/guides/structured-outputs).
|
| 110 |
+
|
| 111 |
+
Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the
|
| 112 |
+
message the model generates is valid JSON.
|
| 113 |
+
|
| 114 |
+
**Important:** when using JSON mode, you **must** also instruct the model to
|
| 115 |
+
produce JSON yourself via a system or user message. Without this, the model may
|
| 116 |
+
generate an unending stream of whitespace until the generation reaches the token
|
| 117 |
+
limit, resulting in a long-running and seemingly "stuck" request. Also note that
|
| 118 |
+
the message content may be partially cut off if `finish_reason="length"`, which
|
| 119 |
+
indicates the generation exceeded `max_tokens` or the conversation exceeded the
|
| 120 |
+
max context length.
|
| 121 |
+
"""
|
| 122 |
+
|
| 123 |
+
temperature: Optional[float]
|
| 124 |
+
"""What sampling temperature to use, between 0 and 2.
|
| 125 |
+
|
| 126 |
+
Higher values like 0.8 will make the output more random, while lower values like
|
| 127 |
+
0.2 will make it more focused and deterministic.
|
| 128 |
+
"""
|
| 129 |
+
|
| 130 |
+
thread: Thread
|
| 131 |
+
"""Options to create a new thread.
|
| 132 |
+
|
| 133 |
+
If no thread is provided when running a request, an empty thread will be
|
| 134 |
+
created.
|
| 135 |
+
"""
|
| 136 |
+
|
| 137 |
+
tool_choice: Optional[AssistantToolChoiceOptionParam]
|
| 138 |
+
"""
|
| 139 |
+
Controls which (if any) tool is called by the model. `none` means the model will
|
| 140 |
+
not call any tools and instead generates a message. `auto` is the default value
|
| 141 |
+
and means the model can pick between generating a message or calling one or more
|
| 142 |
+
tools. `required` means the model must call one or more tools before responding
|
| 143 |
+
to the user. Specifying a particular tool like `{"type": "file_search"}` or
|
| 144 |
+
`{"type": "function", "function": {"name": "my_function"}}` forces the model to
|
| 145 |
+
call that tool.
|
| 146 |
+
"""
|
| 147 |
+
|
| 148 |
+
tool_resources: Optional[ToolResources]
|
| 149 |
+
"""A set of resources that are used by the assistant's tools.
|
| 150 |
+
|
| 151 |
+
The resources are specific to the type of tool. For example, the
|
| 152 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 153 |
+
tool requires a list of vector store IDs.
|
| 154 |
+
"""
|
| 155 |
+
|
| 156 |
+
tools: Optional[Iterable[Tool]]
|
| 157 |
+
"""Override the tools the assistant can use for this run.
|
| 158 |
+
|
| 159 |
+
This is useful for modifying the behavior on a per-run basis.
|
| 160 |
+
"""
|
| 161 |
+
|
| 162 |
+
top_p: Optional[float]
|
| 163 |
+
"""
|
| 164 |
+
An alternative to sampling with temperature, called nucleus sampling, where the
|
| 165 |
+
model considers the results of the tokens with top_p probability mass. So 0.1
|
| 166 |
+
means only the tokens comprising the top 10% probability mass are considered.
|
| 167 |
+
|
| 168 |
+
We generally recommend altering this or temperature but not both.
|
| 169 |
+
"""
|
| 170 |
+
|
| 171 |
+
truncation_strategy: Optional[TruncationStrategy]
|
| 172 |
+
"""Controls for how a thread will be truncated prior to the run.
|
| 173 |
+
|
| 174 |
+
Use this to control the intial context window of the run.
|
| 175 |
+
"""
|
| 176 |
+
|
| 177 |
+
|
| 178 |
+
class ThreadMessageAttachmentToolFileSearch(TypedDict, total=False):
|
| 179 |
+
type: Required[Literal["file_search"]]
|
| 180 |
+
"""The type of tool being defined: `file_search`"""
|
| 181 |
+
|
| 182 |
+
|
| 183 |
+
ThreadMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, ThreadMessageAttachmentToolFileSearch]
|
| 184 |
+
|
| 185 |
+
|
| 186 |
+
class ThreadMessageAttachment(TypedDict, total=False):
|
| 187 |
+
file_id: str
|
| 188 |
+
"""The ID of the file to attach to the message."""
|
| 189 |
+
|
| 190 |
+
tools: Iterable[ThreadMessageAttachmentTool]
|
| 191 |
+
"""The tools to add this file to."""
|
| 192 |
+
|
| 193 |
+
|
| 194 |
+
class ThreadMessage(TypedDict, total=False):
|
| 195 |
+
content: Required[Union[str, Iterable[MessageContentPartParam]]]
|
| 196 |
+
"""The text contents of the message."""
|
| 197 |
+
|
| 198 |
+
role: Required[Literal["user", "assistant"]]
|
| 199 |
+
"""The role of the entity that is creating the message. Allowed values include:
|
| 200 |
+
|
| 201 |
+
- `user`: Indicates the message is sent by an actual user and should be used in
|
| 202 |
+
most cases to represent user-generated messages.
|
| 203 |
+
- `assistant`: Indicates the message is generated by the assistant. Use this
|
| 204 |
+
value to insert messages from the assistant into the conversation.
|
| 205 |
+
"""
|
| 206 |
+
|
| 207 |
+
attachments: Optional[Iterable[ThreadMessageAttachment]]
|
| 208 |
+
"""A list of files attached to the message, and the tools they should be added to."""
|
| 209 |
+
|
| 210 |
+
metadata: Optional[Metadata]
|
| 211 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 212 |
+
|
| 213 |
+
This can be useful for storing additional information about the object in a
|
| 214 |
+
structured format, and querying for objects via API or the dashboard.
|
| 215 |
+
|
| 216 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 217 |
+
a maximum length of 512 characters.
|
| 218 |
+
"""
|
| 219 |
+
|
| 220 |
+
|
| 221 |
+
class ThreadToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 222 |
+
file_ids: List[str]
|
| 223 |
+
"""
|
| 224 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 225 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 226 |
+
associated with the tool.
|
| 227 |
+
"""
|
| 228 |
+
|
| 229 |
+
|
| 230 |
+
class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False):
|
| 231 |
+
type: Required[Literal["auto"]]
|
| 232 |
+
"""Always `auto`."""
|
| 233 |
+
|
| 234 |
+
|
| 235 |
+
class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False):
|
| 236 |
+
chunk_overlap_tokens: Required[int]
|
| 237 |
+
"""The number of tokens that overlap between chunks. The default value is `400`.
|
| 238 |
+
|
| 239 |
+
Note that the overlap must not exceed half of `max_chunk_size_tokens`.
|
| 240 |
+
"""
|
| 241 |
+
|
| 242 |
+
max_chunk_size_tokens: Required[int]
|
| 243 |
+
"""The maximum number of tokens in each chunk.
|
| 244 |
+
|
| 245 |
+
The default value is `800`. The minimum value is `100` and the maximum value is
|
| 246 |
+
`4096`.
|
| 247 |
+
"""
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False):
|
| 251 |
+
static: Required[ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic]
|
| 252 |
+
|
| 253 |
+
type: Required[Literal["static"]]
|
| 254 |
+
"""Always `static`."""
|
| 255 |
+
|
| 256 |
+
|
| 257 |
+
ThreadToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
|
| 258 |
+
ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto,
|
| 259 |
+
ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic,
|
| 260 |
+
]
|
| 261 |
+
|
| 262 |
+
|
| 263 |
+
class ThreadToolResourcesFileSearchVectorStore(TypedDict, total=False):
|
| 264 |
+
chunking_strategy: ThreadToolResourcesFileSearchVectorStoreChunkingStrategy
|
| 265 |
+
"""The chunking strategy used to chunk the file(s).
|
| 266 |
+
|
| 267 |
+
If not set, will use the `auto` strategy.
|
| 268 |
+
"""
|
| 269 |
+
|
| 270 |
+
file_ids: List[str]
|
| 271 |
+
"""
|
| 272 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
|
| 273 |
+
add to the vector store. There can be a maximum of 10000 files in a vector
|
| 274 |
+
store.
|
| 275 |
+
"""
|
| 276 |
+
|
| 277 |
+
metadata: Optional[Metadata]
|
| 278 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 279 |
+
|
| 280 |
+
This can be useful for storing additional information about the object in a
|
| 281 |
+
structured format, and querying for objects via API or the dashboard.
|
| 282 |
+
|
| 283 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 284 |
+
a maximum length of 512 characters.
|
| 285 |
+
"""
|
| 286 |
+
|
| 287 |
+
|
| 288 |
+
class ThreadToolResourcesFileSearch(TypedDict, total=False):
|
| 289 |
+
vector_store_ids: List[str]
|
| 290 |
+
"""
|
| 291 |
+
The
|
| 292 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 293 |
+
attached to this thread. There can be a maximum of 1 vector store attached to
|
| 294 |
+
the thread.
|
| 295 |
+
"""
|
| 296 |
+
|
| 297 |
+
vector_stores: Iterable[ThreadToolResourcesFileSearchVectorStore]
|
| 298 |
+
"""
|
| 299 |
+
A helper to create a
|
| 300 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 301 |
+
with file_ids and attach it to this thread. There can be a maximum of 1 vector
|
| 302 |
+
store attached to the thread.
|
| 303 |
+
"""
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
class ThreadToolResources(TypedDict, total=False):
|
| 307 |
+
code_interpreter: ThreadToolResourcesCodeInterpreter
|
| 308 |
+
|
| 309 |
+
file_search: ThreadToolResourcesFileSearch
|
| 310 |
+
|
| 311 |
+
|
| 312 |
+
class Thread(TypedDict, total=False):
|
| 313 |
+
messages: Iterable[ThreadMessage]
|
| 314 |
+
"""
|
| 315 |
+
A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
|
| 316 |
+
start the thread with.
|
| 317 |
+
"""
|
| 318 |
+
|
| 319 |
+
metadata: Optional[Metadata]
|
| 320 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 321 |
+
|
| 322 |
+
This can be useful for storing additional information about the object in a
|
| 323 |
+
structured format, and querying for objects via API or the dashboard.
|
| 324 |
+
|
| 325 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 326 |
+
a maximum length of 512 characters.
|
| 327 |
+
"""
|
| 328 |
+
|
| 329 |
+
tool_resources: Optional[ThreadToolResources]
|
| 330 |
+
"""
|
| 331 |
+
A set of resources that are made available to the assistant's tools in this
|
| 332 |
+
thread. The resources are specific to the type of tool. For example, the
|
| 333 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 334 |
+
tool requires a list of vector store IDs.
|
| 335 |
+
"""
|
| 336 |
+
|
| 337 |
+
|
| 338 |
+
class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 339 |
+
file_ids: List[str]
|
| 340 |
+
"""
|
| 341 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 342 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 343 |
+
associated with the tool.
|
| 344 |
+
"""
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
class ToolResourcesFileSearch(TypedDict, total=False):
|
| 348 |
+
vector_store_ids: List[str]
|
| 349 |
+
"""
|
| 350 |
+
The ID of the
|
| 351 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 352 |
+
attached to this assistant. There can be a maximum of 1 vector store attached to
|
| 353 |
+
the assistant.
|
| 354 |
+
"""
|
| 355 |
+
|
| 356 |
+
|
| 357 |
+
class ToolResources(TypedDict, total=False):
|
| 358 |
+
code_interpreter: ToolResourcesCodeInterpreter
|
| 359 |
+
|
| 360 |
+
file_search: ToolResourcesFileSearch
|
| 361 |
+
|
| 362 |
+
|
| 363 |
+
Tool: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]
|
| 364 |
+
|
| 365 |
+
|
| 366 |
+
class TruncationStrategy(TypedDict, total=False):
|
| 367 |
+
type: Required[Literal["auto", "last_messages"]]
|
| 368 |
+
"""The truncation strategy to use for the thread.
|
| 369 |
+
|
| 370 |
+
The default is `auto`. If set to `last_messages`, the thread will be truncated
|
| 371 |
+
to the n most recent messages in the thread. When set to `auto`, messages in the
|
| 372 |
+
middle of the thread will be dropped to fit the context length of the model,
|
| 373 |
+
`max_prompt_tokens`.
|
| 374 |
+
"""
|
| 375 |
+
|
| 376 |
+
last_messages: Optional[int]
|
| 377 |
+
"""
|
| 378 |
+
The number of most recent messages from the thread when constructing the context
|
| 379 |
+
for the run.
|
| 380 |
+
"""
|
| 381 |
+
|
| 382 |
+
|
| 383 |
+
class ThreadCreateAndRunParamsNonStreaming(ThreadCreateAndRunParamsBase, total=False):
|
| 384 |
+
stream: Optional[Literal[False]]
|
| 385 |
+
"""
|
| 386 |
+
If `true`, returns a stream of events that happen during the Run as server-sent
|
| 387 |
+
events, terminating when the Run enters a terminal state with a `data: [DONE]`
|
| 388 |
+
message.
|
| 389 |
+
"""
|
| 390 |
+
|
| 391 |
+
|
| 392 |
+
class ThreadCreateAndRunParamsStreaming(ThreadCreateAndRunParamsBase):
|
| 393 |
+
stream: Required[Literal[True]]
|
| 394 |
+
"""
|
| 395 |
+
If `true`, returns a stream of events that happen during the Run as server-sent
|
| 396 |
+
events, terminating when the Run enters a terminal state with a `data: [DONE]`
|
| 397 |
+
message.
|
| 398 |
+
"""
|
| 399 |
+
|
| 400 |
+
|
| 401 |
+
ThreadCreateAndRunParams = Union[ThreadCreateAndRunParamsNonStreaming, ThreadCreateAndRunParamsStreaming]
|
lib/python3.12/site-packages/openai/types/beta/thread_create_params.py
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import List, Union, Iterable, Optional
|
| 6 |
+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
|
| 7 |
+
|
| 8 |
+
from ..shared_params.metadata import Metadata
|
| 9 |
+
from .code_interpreter_tool_param import CodeInterpreterToolParam
|
| 10 |
+
from .threads.message_content_part_param import MessageContentPartParam
|
| 11 |
+
|
| 12 |
+
__all__ = [
|
| 13 |
+
"ThreadCreateParams",
|
| 14 |
+
"Message",
|
| 15 |
+
"MessageAttachment",
|
| 16 |
+
"MessageAttachmentTool",
|
| 17 |
+
"MessageAttachmentToolFileSearch",
|
| 18 |
+
"ToolResources",
|
| 19 |
+
"ToolResourcesCodeInterpreter",
|
| 20 |
+
"ToolResourcesFileSearch",
|
| 21 |
+
"ToolResourcesFileSearchVectorStore",
|
| 22 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategy",
|
| 23 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyAuto",
|
| 24 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyStatic",
|
| 25 |
+
"ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic",
|
| 26 |
+
]
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
class ThreadCreateParams(TypedDict, total=False):
|
| 30 |
+
messages: Iterable[Message]
|
| 31 |
+
"""
|
| 32 |
+
A list of [messages](https://platform.openai.com/docs/api-reference/messages) to
|
| 33 |
+
start the thread with.
|
| 34 |
+
"""
|
| 35 |
+
|
| 36 |
+
metadata: Optional[Metadata]
|
| 37 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 38 |
+
|
| 39 |
+
This can be useful for storing additional information about the object in a
|
| 40 |
+
structured format, and querying for objects via API or the dashboard.
|
| 41 |
+
|
| 42 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 43 |
+
a maximum length of 512 characters.
|
| 44 |
+
"""
|
| 45 |
+
|
| 46 |
+
tool_resources: Optional[ToolResources]
|
| 47 |
+
"""
|
| 48 |
+
A set of resources that are made available to the assistant's tools in this
|
| 49 |
+
thread. The resources are specific to the type of tool. For example, the
|
| 50 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 51 |
+
tool requires a list of vector store IDs.
|
| 52 |
+
"""
|
| 53 |
+
|
| 54 |
+
|
| 55 |
+
class MessageAttachmentToolFileSearch(TypedDict, total=False):
|
| 56 |
+
type: Required[Literal["file_search"]]
|
| 57 |
+
"""The type of tool being defined: `file_search`"""
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
MessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, MessageAttachmentToolFileSearch]
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
class MessageAttachment(TypedDict, total=False):
|
| 64 |
+
file_id: str
|
| 65 |
+
"""The ID of the file to attach to the message."""
|
| 66 |
+
|
| 67 |
+
tools: Iterable[MessageAttachmentTool]
|
| 68 |
+
"""The tools to add this file to."""
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
class Message(TypedDict, total=False):
|
| 72 |
+
content: Required[Union[str, Iterable[MessageContentPartParam]]]
|
| 73 |
+
"""The text contents of the message."""
|
| 74 |
+
|
| 75 |
+
role: Required[Literal["user", "assistant"]]
|
| 76 |
+
"""The role of the entity that is creating the message. Allowed values include:
|
| 77 |
+
|
| 78 |
+
- `user`: Indicates the message is sent by an actual user and should be used in
|
| 79 |
+
most cases to represent user-generated messages.
|
| 80 |
+
- `assistant`: Indicates the message is generated by the assistant. Use this
|
| 81 |
+
value to insert messages from the assistant into the conversation.
|
| 82 |
+
"""
|
| 83 |
+
|
| 84 |
+
attachments: Optional[Iterable[MessageAttachment]]
|
| 85 |
+
"""A list of files attached to the message, and the tools they should be added to."""
|
| 86 |
+
|
| 87 |
+
metadata: Optional[Metadata]
|
| 88 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 89 |
+
|
| 90 |
+
This can be useful for storing additional information about the object in a
|
| 91 |
+
structured format, and querying for objects via API or the dashboard.
|
| 92 |
+
|
| 93 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 94 |
+
a maximum length of 512 characters.
|
| 95 |
+
"""
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 99 |
+
file_ids: List[str]
|
| 100 |
+
"""
|
| 101 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 102 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 103 |
+
associated with the tool.
|
| 104 |
+
"""
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyAuto(TypedDict, total=False):
|
| 108 |
+
type: Required[Literal["auto"]]
|
| 109 |
+
"""Always `auto`."""
|
| 110 |
+
|
| 111 |
+
|
| 112 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic(TypedDict, total=False):
|
| 113 |
+
chunk_overlap_tokens: Required[int]
|
| 114 |
+
"""The number of tokens that overlap between chunks. The default value is `400`.
|
| 115 |
+
|
| 116 |
+
Note that the overlap must not exceed half of `max_chunk_size_tokens`.
|
| 117 |
+
"""
|
| 118 |
+
|
| 119 |
+
max_chunk_size_tokens: Required[int]
|
| 120 |
+
"""The maximum number of tokens in each chunk.
|
| 121 |
+
|
| 122 |
+
The default value is `800`. The minimum value is `100` and the maximum value is
|
| 123 |
+
`4096`.
|
| 124 |
+
"""
|
| 125 |
+
|
| 126 |
+
|
| 127 |
+
class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=False):
|
| 128 |
+
static: Required[ToolResourcesFileSearchVectorStoreChunkingStrategyStaticStatic]
|
| 129 |
+
|
| 130 |
+
type: Required[Literal["static"]]
|
| 131 |
+
"""Always `static`."""
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
|
| 135 |
+
ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic
|
| 136 |
+
]
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
class ToolResourcesFileSearchVectorStore(TypedDict, total=False):
|
| 140 |
+
chunking_strategy: ToolResourcesFileSearchVectorStoreChunkingStrategy
|
| 141 |
+
"""The chunking strategy used to chunk the file(s).
|
| 142 |
+
|
| 143 |
+
If not set, will use the `auto` strategy.
|
| 144 |
+
"""
|
| 145 |
+
|
| 146 |
+
file_ids: List[str]
|
| 147 |
+
"""
|
| 148 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs to
|
| 149 |
+
add to the vector store. There can be a maximum of 10000 files in a vector
|
| 150 |
+
store.
|
| 151 |
+
"""
|
| 152 |
+
|
| 153 |
+
metadata: Optional[Metadata]
|
| 154 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 155 |
+
|
| 156 |
+
This can be useful for storing additional information about the object in a
|
| 157 |
+
structured format, and querying for objects via API or the dashboard.
|
| 158 |
+
|
| 159 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 160 |
+
a maximum length of 512 characters.
|
| 161 |
+
"""
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
class ToolResourcesFileSearch(TypedDict, total=False):
|
| 165 |
+
vector_store_ids: List[str]
|
| 166 |
+
"""
|
| 167 |
+
The
|
| 168 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 169 |
+
attached to this thread. There can be a maximum of 1 vector store attached to
|
| 170 |
+
the thread.
|
| 171 |
+
"""
|
| 172 |
+
|
| 173 |
+
vector_stores: Iterable[ToolResourcesFileSearchVectorStore]
|
| 174 |
+
"""
|
| 175 |
+
A helper to create a
|
| 176 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 177 |
+
with file_ids and attach it to this thread. There can be a maximum of 1 vector
|
| 178 |
+
store attached to the thread.
|
| 179 |
+
"""
|
| 180 |
+
|
| 181 |
+
|
| 182 |
+
class ToolResources(TypedDict, total=False):
|
| 183 |
+
code_interpreter: ToolResourcesCodeInterpreter
|
| 184 |
+
|
| 185 |
+
file_search: ToolResourcesFileSearch
|
lib/python3.12/site-packages/openai/types/beta/thread_deleted.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ..._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["ThreadDeleted"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ThreadDeleted(BaseModel):
|
| 11 |
+
id: str
|
| 12 |
+
|
| 13 |
+
deleted: bool
|
| 14 |
+
|
| 15 |
+
object: Literal["thread.deleted"]
|
lib/python3.12/site-packages/openai/types/beta/thread_update_params.py
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing import List, Optional
|
| 6 |
+
from typing_extensions import TypedDict
|
| 7 |
+
|
| 8 |
+
from ..shared_params.metadata import Metadata
|
| 9 |
+
|
| 10 |
+
__all__ = ["ThreadUpdateParams", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
class ThreadUpdateParams(TypedDict, total=False):
|
| 14 |
+
metadata: Optional[Metadata]
|
| 15 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 16 |
+
|
| 17 |
+
This can be useful for storing additional information about the object in a
|
| 18 |
+
structured format, and querying for objects via API or the dashboard.
|
| 19 |
+
|
| 20 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 21 |
+
a maximum length of 512 characters.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
tool_resources: Optional[ToolResources]
|
| 25 |
+
"""
|
| 26 |
+
A set of resources that are made available to the assistant's tools in this
|
| 27 |
+
thread. The resources are specific to the type of tool. For example, the
|
| 28 |
+
`code_interpreter` tool requires a list of file IDs, while the `file_search`
|
| 29 |
+
tool requires a list of vector store IDs.
|
| 30 |
+
"""
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
class ToolResourcesCodeInterpreter(TypedDict, total=False):
|
| 34 |
+
file_ids: List[str]
|
| 35 |
+
"""
|
| 36 |
+
A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made
|
| 37 |
+
available to the `code_interpreter` tool. There can be a maximum of 20 files
|
| 38 |
+
associated with the tool.
|
| 39 |
+
"""
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
class ToolResourcesFileSearch(TypedDict, total=False):
|
| 43 |
+
vector_store_ids: List[str]
|
| 44 |
+
"""
|
| 45 |
+
The
|
| 46 |
+
[vector store](https://platform.openai.com/docs/api-reference/vector-stores/object)
|
| 47 |
+
attached to this thread. There can be a maximum of 1 vector store attached to
|
| 48 |
+
the thread.
|
| 49 |
+
"""
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
class ToolResources(TypedDict, total=False):
|
| 53 |
+
code_interpreter: ToolResourcesCodeInterpreter
|
| 54 |
+
|
| 55 |
+
file_search: ToolResourcesFileSearch
|
lib/python3.12/site-packages/openai/types/beta/threads/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from .run import Run as Run
|
| 6 |
+
from .text import Text as Text
|
| 7 |
+
from .message import Message as Message
|
| 8 |
+
from .image_url import ImageURL as ImageURL
|
| 9 |
+
from .annotation import Annotation as Annotation
|
| 10 |
+
from .image_file import ImageFile as ImageFile
|
| 11 |
+
from .run_status import RunStatus as RunStatus
|
| 12 |
+
from .text_delta import TextDelta as TextDelta
|
| 13 |
+
from .message_delta import MessageDelta as MessageDelta
|
| 14 |
+
from .image_url_delta import ImageURLDelta as ImageURLDelta
|
| 15 |
+
from .image_url_param import ImageURLParam as ImageURLParam
|
| 16 |
+
from .message_content import MessageContent as MessageContent
|
| 17 |
+
from .message_deleted import MessageDeleted as MessageDeleted
|
| 18 |
+
from .run_list_params import RunListParams as RunListParams
|
| 19 |
+
from .annotation_delta import AnnotationDelta as AnnotationDelta
|
| 20 |
+
from .image_file_delta import ImageFileDelta as ImageFileDelta
|
| 21 |
+
from .image_file_param import ImageFileParam as ImageFileParam
|
| 22 |
+
from .text_delta_block import TextDeltaBlock as TextDeltaBlock
|
| 23 |
+
from .run_create_params import RunCreateParams as RunCreateParams
|
| 24 |
+
from .run_update_params import RunUpdateParams as RunUpdateParams
|
| 25 |
+
from .text_content_block import TextContentBlock as TextContentBlock
|
| 26 |
+
from .message_delta_event import MessageDeltaEvent as MessageDeltaEvent
|
| 27 |
+
from .message_list_params import MessageListParams as MessageListParams
|
| 28 |
+
from .refusal_delta_block import RefusalDeltaBlock as RefusalDeltaBlock
|
| 29 |
+
from .file_path_annotation import FilePathAnnotation as FilePathAnnotation
|
| 30 |
+
from .image_url_delta_block import ImageURLDeltaBlock as ImageURLDeltaBlock
|
| 31 |
+
from .message_content_delta import MessageContentDelta as MessageContentDelta
|
| 32 |
+
from .message_create_params import MessageCreateParams as MessageCreateParams
|
| 33 |
+
from .message_update_params import MessageUpdateParams as MessageUpdateParams
|
| 34 |
+
from .refusal_content_block import RefusalContentBlock as RefusalContentBlock
|
| 35 |
+
from .image_file_delta_block import ImageFileDeltaBlock as ImageFileDeltaBlock
|
| 36 |
+
from .image_url_content_block import ImageURLContentBlock as ImageURLContentBlock
|
| 37 |
+
from .file_citation_annotation import FileCitationAnnotation as FileCitationAnnotation
|
| 38 |
+
from .image_file_content_block import ImageFileContentBlock as ImageFileContentBlock
|
| 39 |
+
from .text_content_block_param import TextContentBlockParam as TextContentBlockParam
|
| 40 |
+
from .file_path_delta_annotation import FilePathDeltaAnnotation as FilePathDeltaAnnotation
|
| 41 |
+
from .message_content_part_param import MessageContentPartParam as MessageContentPartParam
|
| 42 |
+
from .image_url_content_block_param import ImageURLContentBlockParam as ImageURLContentBlockParam
|
| 43 |
+
from .file_citation_delta_annotation import FileCitationDeltaAnnotation as FileCitationDeltaAnnotation
|
| 44 |
+
from .image_file_content_block_param import ImageFileContentBlockParam as ImageFileContentBlockParam
|
| 45 |
+
from .run_submit_tool_outputs_params import RunSubmitToolOutputsParams as RunSubmitToolOutputsParams
|
| 46 |
+
from .required_action_function_tool_call import RequiredActionFunctionToolCall as RequiredActionFunctionToolCall
|
lib/python3.12/site-packages/openai/types/beta/threads/annotation.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .file_path_annotation import FilePathAnnotation
|
| 8 |
+
from .file_citation_annotation import FileCitationAnnotation
|
| 9 |
+
|
| 10 |
+
__all__ = ["Annotation"]
|
| 11 |
+
|
| 12 |
+
Annotation: TypeAlias = Annotated[Union[FileCitationAnnotation, FilePathAnnotation], PropertyInfo(discriminator="type")]
|
lib/python3.12/site-packages/openai/types/beta/threads/annotation_delta.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .file_path_delta_annotation import FilePathDeltaAnnotation
|
| 8 |
+
from .file_citation_delta_annotation import FileCitationDeltaAnnotation
|
| 9 |
+
|
| 10 |
+
__all__ = ["AnnotationDelta"]
|
| 11 |
+
|
| 12 |
+
AnnotationDelta: TypeAlias = Annotated[
|
| 13 |
+
Union[FileCitationDeltaAnnotation, FilePathDeltaAnnotation], PropertyInfo(discriminator="type")
|
| 14 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/threads/file_citation_annotation.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["FileCitationAnnotation", "FileCitation"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class FileCitation(BaseModel):
|
| 11 |
+
file_id: str
|
| 12 |
+
"""The ID of the specific File the citation is from."""
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class FileCitationAnnotation(BaseModel):
|
| 16 |
+
end_index: int
|
| 17 |
+
|
| 18 |
+
file_citation: FileCitation
|
| 19 |
+
|
| 20 |
+
start_index: int
|
| 21 |
+
|
| 22 |
+
text: str
|
| 23 |
+
"""The text in the message content that needs to be replaced."""
|
| 24 |
+
|
| 25 |
+
type: Literal["file_citation"]
|
| 26 |
+
"""Always `file_citation`."""
|
lib/python3.12/site-packages/openai/types/beta/threads/file_citation_delta_annotation.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["FileCitationDeltaAnnotation", "FileCitation"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class FileCitation(BaseModel):
|
| 12 |
+
file_id: Optional[str] = None
|
| 13 |
+
"""The ID of the specific File the citation is from."""
|
| 14 |
+
|
| 15 |
+
quote: Optional[str] = None
|
| 16 |
+
"""The specific quote in the file."""
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class FileCitationDeltaAnnotation(BaseModel):
|
| 20 |
+
index: int
|
| 21 |
+
"""The index of the annotation in the text content part."""
|
| 22 |
+
|
| 23 |
+
type: Literal["file_citation"]
|
| 24 |
+
"""Always `file_citation`."""
|
| 25 |
+
|
| 26 |
+
end_index: Optional[int] = None
|
| 27 |
+
|
| 28 |
+
file_citation: Optional[FileCitation] = None
|
| 29 |
+
|
| 30 |
+
start_index: Optional[int] = None
|
| 31 |
+
|
| 32 |
+
text: Optional[str] = None
|
| 33 |
+
"""The text in the message content that needs to be replaced."""
|
lib/python3.12/site-packages/openai/types/beta/threads/file_path_annotation.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
|
| 7 |
+
__all__ = ["FilePathAnnotation", "FilePath"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class FilePath(BaseModel):
|
| 11 |
+
file_id: str
|
| 12 |
+
"""The ID of the file that was generated."""
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class FilePathAnnotation(BaseModel):
|
| 16 |
+
end_index: int
|
| 17 |
+
|
| 18 |
+
file_path: FilePath
|
| 19 |
+
|
| 20 |
+
start_index: int
|
| 21 |
+
|
| 22 |
+
text: str
|
| 23 |
+
"""The text in the message content that needs to be replaced."""
|
| 24 |
+
|
| 25 |
+
type: Literal["file_path"]
|
| 26 |
+
"""Always `file_path`."""
|
lib/python3.12/site-packages/openai/types/beta/threads/file_path_delta_annotation.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["FilePathDeltaAnnotation", "FilePath"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class FilePath(BaseModel):
|
| 12 |
+
file_id: Optional[str] = None
|
| 13 |
+
"""The ID of the file that was generated."""
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
class FilePathDeltaAnnotation(BaseModel):
|
| 17 |
+
index: int
|
| 18 |
+
"""The index of the annotation in the text content part."""
|
| 19 |
+
|
| 20 |
+
type: Literal["file_path"]
|
| 21 |
+
"""Always `file_path`."""
|
| 22 |
+
|
| 23 |
+
end_index: Optional[int] = None
|
| 24 |
+
|
| 25 |
+
file_path: Optional[FilePath] = None
|
| 26 |
+
|
| 27 |
+
start_index: Optional[int] = None
|
| 28 |
+
|
| 29 |
+
text: Optional[str] = None
|
| 30 |
+
"""The text in the message content that needs to be replaced."""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageFile"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageFile(BaseModel):
|
| 12 |
+
file_id: str
|
| 13 |
+
"""
|
| 14 |
+
The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
| 15 |
+
in the message content. Set `purpose="vision"` when uploading the File if you
|
| 16 |
+
need to later display the file content.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
detail: Optional[Literal["auto", "low", "high"]] = None
|
| 20 |
+
"""Specifies the detail level of the image if specified by the user.
|
| 21 |
+
|
| 22 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`.
|
| 23 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file_content_block.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from ...._models import BaseModel
|
| 6 |
+
from .image_file import ImageFile
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageFileContentBlock"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageFileContentBlock(BaseModel):
|
| 12 |
+
image_file: ImageFile
|
| 13 |
+
|
| 14 |
+
type: Literal["image_file"]
|
| 15 |
+
"""Always `image_file`."""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file_content_block_param.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
from .image_file_param import ImageFileParam
|
| 8 |
+
|
| 9 |
+
__all__ = ["ImageFileContentBlockParam"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ImageFileContentBlockParam(TypedDict, total=False):
|
| 13 |
+
image_file: Required[ImageFileParam]
|
| 14 |
+
|
| 15 |
+
type: Required[Literal["image_file"]]
|
| 16 |
+
"""Always `image_file`."""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file_delta.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageFileDelta"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageFileDelta(BaseModel):
|
| 12 |
+
detail: Optional[Literal["auto", "low", "high"]] = None
|
| 13 |
+
"""Specifies the detail level of the image if specified by the user.
|
| 14 |
+
|
| 15 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
file_id: Optional[str] = None
|
| 19 |
+
"""
|
| 20 |
+
The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
| 21 |
+
in the message content. Set `purpose="vision"` when uploading the File if you
|
| 22 |
+
need to later display the file content.
|
| 23 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file_delta_block.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .image_file_delta import ImageFileDelta
|
| 8 |
+
|
| 9 |
+
__all__ = ["ImageFileDeltaBlock"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ImageFileDeltaBlock(BaseModel):
|
| 13 |
+
index: int
|
| 14 |
+
"""The index of the content part in the message."""
|
| 15 |
+
|
| 16 |
+
type: Literal["image_file"]
|
| 17 |
+
"""Always `image_file`."""
|
| 18 |
+
|
| 19 |
+
image_file: Optional[ImageFileDelta] = None
|
lib/python3.12/site-packages/openai/types/beta/threads/image_file_param.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ImageFileParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ImageFileParam(TypedDict, total=False):
|
| 11 |
+
file_id: Required[str]
|
| 12 |
+
"""
|
| 13 |
+
The [File](https://platform.openai.com/docs/api-reference/files) ID of the image
|
| 14 |
+
in the message content. Set `purpose="vision"` when uploading the File if you
|
| 15 |
+
need to later display the file content.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
detail: Literal["auto", "low", "high"]
|
| 19 |
+
"""Specifies the detail level of the image if specified by the user.
|
| 20 |
+
|
| 21 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`.
|
| 22 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageURL"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageURL(BaseModel):
|
| 12 |
+
url: str
|
| 13 |
+
"""
|
| 14 |
+
The external URL of the image, must be a supported image types: jpeg, jpg, png,
|
| 15 |
+
gif, webp.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
detail: Optional[Literal["auto", "low", "high"]] = None
|
| 19 |
+
"""Specifies the detail level of the image.
|
| 20 |
+
|
| 21 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`. Default
|
| 22 |
+
value is `auto`
|
| 23 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url_content_block.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing_extensions import Literal
|
| 4 |
+
|
| 5 |
+
from .image_url import ImageURL
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageURLContentBlock"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageURLContentBlock(BaseModel):
|
| 12 |
+
image_url: ImageURL
|
| 13 |
+
|
| 14 |
+
type: Literal["image_url"]
|
| 15 |
+
"""The type of the content part."""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url_content_block_param.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
from .image_url_param import ImageURLParam
|
| 8 |
+
|
| 9 |
+
__all__ = ["ImageURLContentBlockParam"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ImageURLContentBlockParam(TypedDict, total=False):
|
| 13 |
+
image_url: Required[ImageURLParam]
|
| 14 |
+
|
| 15 |
+
type: Required[Literal["image_url"]]
|
| 16 |
+
"""The type of the content part."""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url_delta.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
|
| 8 |
+
__all__ = ["ImageURLDelta"]
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
class ImageURLDelta(BaseModel):
|
| 12 |
+
detail: Optional[Literal["auto", "low", "high"]] = None
|
| 13 |
+
"""Specifies the detail level of the image.
|
| 14 |
+
|
| 15 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
url: Optional[str] = None
|
| 19 |
+
"""
|
| 20 |
+
The URL of the image, must be a supported image types: jpeg, jpg, png, gif,
|
| 21 |
+
webp.
|
| 22 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url_delta_block.py
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Optional
|
| 4 |
+
from typing_extensions import Literal
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .image_url_delta import ImageURLDelta
|
| 8 |
+
|
| 9 |
+
__all__ = ["ImageURLDeltaBlock"]
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
class ImageURLDeltaBlock(BaseModel):
|
| 13 |
+
index: int
|
| 14 |
+
"""The index of the content part in the message."""
|
| 15 |
+
|
| 16 |
+
type: Literal["image_url"]
|
| 17 |
+
"""Always `image_url`."""
|
| 18 |
+
|
| 19 |
+
image_url: Optional[ImageURLDelta] = None
|
lib/python3.12/site-packages/openai/types/beta/threads/image_url_param.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
from typing_extensions import Literal, Required, TypedDict
|
| 6 |
+
|
| 7 |
+
__all__ = ["ImageURLParam"]
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class ImageURLParam(TypedDict, total=False):
|
| 11 |
+
url: Required[str]
|
| 12 |
+
"""
|
| 13 |
+
The external URL of the image, must be a supported image types: jpeg, jpg, png,
|
| 14 |
+
gif, webp.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
detail: Literal["auto", "low", "high"]
|
| 18 |
+
"""Specifies the detail level of the image.
|
| 19 |
+
|
| 20 |
+
`low` uses fewer tokens, you can opt in to high resolution using `high`. Default
|
| 21 |
+
value is `auto`
|
| 22 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/message.py
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import List, Union, Optional
|
| 4 |
+
from typing_extensions import Literal, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._models import BaseModel
|
| 7 |
+
from .message_content import MessageContent
|
| 8 |
+
from ...shared.metadata import Metadata
|
| 9 |
+
from ..code_interpreter_tool import CodeInterpreterTool
|
| 10 |
+
|
| 11 |
+
__all__ = [
|
| 12 |
+
"Message",
|
| 13 |
+
"Attachment",
|
| 14 |
+
"AttachmentTool",
|
| 15 |
+
"AttachmentToolAssistantToolsFileSearchTypeOnly",
|
| 16 |
+
"IncompleteDetails",
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
class AttachmentToolAssistantToolsFileSearchTypeOnly(BaseModel):
|
| 21 |
+
type: Literal["file_search"]
|
| 22 |
+
"""The type of tool being defined: `file_search`"""
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
AttachmentTool: TypeAlias = Union[CodeInterpreterTool, AttachmentToolAssistantToolsFileSearchTypeOnly]
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class Attachment(BaseModel):
|
| 29 |
+
file_id: Optional[str] = None
|
| 30 |
+
"""The ID of the file to attach to the message."""
|
| 31 |
+
|
| 32 |
+
tools: Optional[List[AttachmentTool]] = None
|
| 33 |
+
"""The tools to add this file to."""
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
class IncompleteDetails(BaseModel):
|
| 37 |
+
reason: Literal["content_filter", "max_tokens", "run_cancelled", "run_expired", "run_failed"]
|
| 38 |
+
"""The reason the message is incomplete."""
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
class Message(BaseModel):
|
| 42 |
+
id: str
|
| 43 |
+
"""The identifier, which can be referenced in API endpoints."""
|
| 44 |
+
|
| 45 |
+
assistant_id: Optional[str] = None
|
| 46 |
+
"""
|
| 47 |
+
If applicable, the ID of the
|
| 48 |
+
[assistant](https://platform.openai.com/docs/api-reference/assistants) that
|
| 49 |
+
authored this message.
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
attachments: Optional[List[Attachment]] = None
|
| 53 |
+
"""A list of files attached to the message, and the tools they were added to."""
|
| 54 |
+
|
| 55 |
+
completed_at: Optional[int] = None
|
| 56 |
+
"""The Unix timestamp (in seconds) for when the message was completed."""
|
| 57 |
+
|
| 58 |
+
content: List[MessageContent]
|
| 59 |
+
"""The content of the message in array of text and/or images."""
|
| 60 |
+
|
| 61 |
+
created_at: int
|
| 62 |
+
"""The Unix timestamp (in seconds) for when the message was created."""
|
| 63 |
+
|
| 64 |
+
incomplete_at: Optional[int] = None
|
| 65 |
+
"""The Unix timestamp (in seconds) for when the message was marked as incomplete."""
|
| 66 |
+
|
| 67 |
+
incomplete_details: Optional[IncompleteDetails] = None
|
| 68 |
+
"""On an incomplete message, details about why the message is incomplete."""
|
| 69 |
+
|
| 70 |
+
metadata: Optional[Metadata] = None
|
| 71 |
+
"""Set of 16 key-value pairs that can be attached to an object.
|
| 72 |
+
|
| 73 |
+
This can be useful for storing additional information about the object in a
|
| 74 |
+
structured format, and querying for objects via API or the dashboard.
|
| 75 |
+
|
| 76 |
+
Keys are strings with a maximum length of 64 characters. Values are strings with
|
| 77 |
+
a maximum length of 512 characters.
|
| 78 |
+
"""
|
| 79 |
+
|
| 80 |
+
object: Literal["thread.message"]
|
| 81 |
+
"""The object type, which is always `thread.message`."""
|
| 82 |
+
|
| 83 |
+
role: Literal["user", "assistant"]
|
| 84 |
+
"""The entity that produced the message. One of `user` or `assistant`."""
|
| 85 |
+
|
| 86 |
+
run_id: Optional[str] = None
|
| 87 |
+
"""
|
| 88 |
+
The ID of the [run](https://platform.openai.com/docs/api-reference/runs)
|
| 89 |
+
associated with the creation of this message. Value is `null` when messages are
|
| 90 |
+
created manually using the create message or create thread endpoints.
|
| 91 |
+
"""
|
| 92 |
+
|
| 93 |
+
status: Literal["in_progress", "incomplete", "completed"]
|
| 94 |
+
"""
|
| 95 |
+
The status of the message, which can be either `in_progress`, `incomplete`, or
|
| 96 |
+
`completed`.
|
| 97 |
+
"""
|
| 98 |
+
|
| 99 |
+
thread_id: str
|
| 100 |
+
"""
|
| 101 |
+
The [thread](https://platform.openai.com/docs/api-reference/threads) ID that
|
| 102 |
+
this message belongs to.
|
| 103 |
+
"""
|
lib/python3.12/site-packages/openai/types/beta/threads/message_content.py
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .text_content_block import TextContentBlock
|
| 8 |
+
from .refusal_content_block import RefusalContentBlock
|
| 9 |
+
from .image_url_content_block import ImageURLContentBlock
|
| 10 |
+
from .image_file_content_block import ImageFileContentBlock
|
| 11 |
+
|
| 12 |
+
__all__ = ["MessageContent"]
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
MessageContent: TypeAlias = Annotated[
|
| 16 |
+
Union[ImageFileContentBlock, ImageURLContentBlock, TextContentBlock, RefusalContentBlock],
|
| 17 |
+
PropertyInfo(discriminator="type"),
|
| 18 |
+
]
|
lib/python3.12/site-packages/openai/types/beta/threads/message_content_delta.py
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
| 2 |
+
|
| 3 |
+
from typing import Union
|
| 4 |
+
from typing_extensions import Annotated, TypeAlias
|
| 5 |
+
|
| 6 |
+
from ...._utils import PropertyInfo
|
| 7 |
+
from .text_delta_block import TextDeltaBlock
|
| 8 |
+
from .refusal_delta_block import RefusalDeltaBlock
|
| 9 |
+
from .image_url_delta_block import ImageURLDeltaBlock
|
| 10 |
+
from .image_file_delta_block import ImageFileDeltaBlock
|
| 11 |
+
|
| 12 |
+
__all__ = ["MessageContentDelta"]
|
| 13 |
+
|
| 14 |
+
MessageContentDelta: TypeAlias = Annotated[
|
| 15 |
+
Union[ImageFileDeltaBlock, TextDeltaBlock, RefusalDeltaBlock, ImageURLDeltaBlock],
|
| 16 |
+
PropertyInfo(discriminator="type"),
|
| 17 |
+
]
|