async_openai/types/
assistant_file.rs

1use serde::{Deserialize, Serialize};
2
3/// A list of [Files](https://platform.openai.com/docs/api-reference/files) attached to an `assistant`.
4#[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)]
5pub struct AssistantFileObject {
6    /// The identifier, which can be referenced in API endpoints.
7    pub id: String,
8
9    /// The object type, which is always `assistant.file`.
10    pub object: String,
11
12    /// The Unix timestamp (in seconds) for when the assistant file was created.
13    pub created_at: i32,
14
15    ///  The assistant ID that the file is attached to.
16    pub assistant_id: String,
17}
18
19#[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)]
20pub struct CreateAssistantFileRequest {
21    /// A [File](https://platform.openai.com/docs/api-reference/files) ID (with `purpose="assistants"`) that the assistant should use. Useful for tools like `retrieval` and `code_interpreter` that can access files.
22    pub file_id: String,
23}
24
25/// Deletes the association between the assistant and the file, but does not delete the [File](https://platform.openai.com/docs/api-reference/files) object itself.
26#[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)]
27pub struct DeleteAssistantFileResponse {
28    pub id: String,
29    pub deleted: bool,
30    pub object: String,
31}
32
33#[derive(Clone, Serialize, Default, Debug, Deserialize, PartialEq)]
34pub struct ListAssistantFilesResponse {
35    pub object: String,
36    pub data: Vec<AssistantFileObject>,
37    pub first_id: Option<String>,
38    pub last_id: Option<String>,
39    pub has_more: bool,
40}