Download codex-rs/app-server-protocol/src/protocol/v2/thread_attachment.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 3.64 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/thread_attachment.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/app-server-protocol/src/protocol/v2/thread_attachment.rs
-
curl -L -o thread_attachment.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/thread_attachment.rs
3.64 kB
| //! Wire contracts for managing the current set of attachments on a thread. | |
| use crate::JsonSchema; | |
| use crate::TS; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| use serde_json::Value as JsonValue; | |
| /// An independently persisted attachment associated with a thread. | |
| pub struct ThreadAttachment { | |
| pub id: String, | |
| pub attachment_type: String, | |
| pub identity_key: String, | |
| pub payload: JsonValue, | |
| pub created_at: i64, | |
| } | |
| /// Parameters for creating or locating an attachment on its owning thread. | |
| pub struct ThreadAttachmentAddParams { | |
| pub thread_id: String, | |
| pub attachment_type: String, | |
| pub identity_key: String, | |
| pub payload: JsonValue, | |
| } | |
| /// Result of attempting to associate an attachment with a thread. | |
| pub enum ThreadAttachmentAddOutcome { | |
| Created, | |
| Existing, | |
| } | |
| /// The created or existing attachment. | |
| pub struct ThreadAttachmentAddResponse { | |
| pub outcome: ThreadAttachmentAddOutcome, | |
| pub attachment: ThreadAttachment, | |
| } | |
| /// Parameters for listing attachments from one thread. | |
| pub struct ThreadAttachmentListParams { | |
| pub thread_id: String, | |
| pub cursor: Option<String>, | |
| pub limit: Option<u32>, | |
| } | |
| /// One page of attachments associated with the requested thread. | |
| pub struct ThreadAttachmentListResponse { | |
| pub data: Vec<ThreadAttachment>, | |
| pub next_cursor: Option<String>, | |
| } | |
| /// Parameters for deleting an attachment by its stable thread-local identity. | |
| pub struct ThreadAttachmentRemoveParams { | |
| pub thread_id: String, | |
| pub attachment_type: String, | |
| pub identity_key: String, | |
| } | |
| /// Successful deletion does not return additional attachment data. | |
| pub struct ThreadAttachmentRemoveResponse {} | |
| /// The persisted attachment change represented by a notification. | |
| pub enum ThreadAttachmentOperation { | |
| Created, | |
| Deleted, | |
| } | |
| /// Notification published after a thread attachment is created or deleted. | |
| pub struct ThreadAttachmentUpdatedNotification { | |
| pub thread_id: String, | |
| pub attachment_type: String, | |
| pub identity_key: String, | |
| pub attachment_id: String, | |
| pub operation: ThreadAttachmentOperation, | |
| } | |