main
 1# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
 2
 3from typing import List, Optional
 4from typing_extensions import Literal
 5
 6from ..._models import BaseModel
 7from ..shared.metadata import Metadata
 8
 9__all__ = ["Thread", "ToolResources", "ToolResourcesCodeInterpreter", "ToolResourcesFileSearch"]
10
11
12class 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
21class 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
31class ToolResources(BaseModel):
32    code_interpreter: Optional[ToolResourcesCodeInterpreter] = None
33
34    file_search: Optional[ToolResourcesFileSearch] = None
35
36
37class 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    """