openai-interface 0.13.0

A low-level Rust interface for the OpenAI API
Documentation
//! The Conversations API: manage conversation state via `/conversations`.
//!
//! > ![warn] This module is untested!
//! > If you encounter any issues, please report them on the repository.
//!
//! Conversations are the stateful layer of the Responses API: a
//! conversation stores the input/output items of a multi-turn
//! interaction, and a Responses request can continue it via
//! `conversation: { "id": ... }` instead of `previous_response_id`.
//! See
//! [the OpenAI Conversations guide](https://platform.openai.com/docs/guides/conversations).
//!
//! Submodules: [`create`], [`retrieve`], [`update`], [`delete`],
//! [`list`] and [`items`] (per-conversation item management).

pub mod create;
pub mod delete;
pub mod items;
pub mod list;
pub mod retrieve;
pub mod update;

/// A conversation object.
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Conversation {
    /// The conversation ID, e.g. `conv_...`.
    pub id: String,
    /// The object type, always `conversation`.
    #[serde(default)]
    pub object: Option<String>,
    /// Unix timestamp (seconds) of when the conversation was created.
    #[serde(default)]
    pub created_at: Option<u64>,
    /// Arbitrary key-value metadata attached to the conversation.
    #[serde(default)]
    pub metadata: Option<std::collections::HashMap<String, String>>,
}

crate::impl_from_str!(Conversation);