Skip to main content

openai_interface/containers/
mod.rs

1//! The Containers API: manage container objects via `/containers`.
2//!
3//! > ![warn] This module is untested!
4//! > If you encounter any issues, please report them on the repository.
5//!
6//! Containers provide a persistent filesystem for the Code Interpreter
7//! tool of the Responses API. See
8//! [the OpenAI Reusing your own knowledge and tools guide](https://platform.openai.com/docs/guides/reusing-your-own-knowledge-and-tools).
9//!
10//! Submodules: [`create`], [`retrieve`], [`delete`], [`list`] and
11//! [`files`] (per-container file management).
12
13pub mod create;
14pub mod delete;
15pub mod files;
16pub mod list;
17pub mod retrieve;
18
19/// A container object.
20#[derive(Debug, Clone, serde::Deserialize)]
21pub struct Container {
22    /// The container ID, e.g. `cntr_...`.
23    pub id: String,
24    /// The object type, always `container`.
25    #[serde(default)]
26    pub object: Option<String>,
27    /// Unix timestamp (seconds) of when the container was created.
28    #[serde(default)]
29    pub created_at: Option<u64>,
30    /// The container status (`running`, `paused`, `exited`).
31    #[serde(default)]
32    pub status: Option<String>,
33    /// Unix timestamp (seconds) of when the container expires.
34    #[serde(default)]
35    pub expires_at: Option<u64>,
36    /// The name of the container.
37    #[serde(default)]
38    pub name: Option<String>,
39}
40
41crate::impl_from_str!(Container);