#[non_exhaustive]pub struct AttachmentConfig {
pub max_files: Option<usize>,
pub max_total_bytes: Option<usize>,
}Expand description
How much of a turn’s files reaches a model.
§Why nothing ships
A limit an adopter cannot raise is not configurable, so there is no shipped ceiling here either: an adopter who sets nothing sends every file the turn carried, which is what the user attached and what they expect to be looked at. Attachments are bounded by what one person put in one message, unlike a conversation or a briefing, so there is no runaway to protect anybody from.
What a budget buys, when one is set, is that the runtime says which files it left out — deterministically to the user and as a fact to the writing stage. A silently truncated request produces an answer about the wrong document, which is worse than an answer about none.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_files: Option<usize>How many files may go into one request, or None for all of them.
max_total_bytes: Option<usize>How many bytes of file may go into one request, or None for all.
Counted before encoding, which is what an application can reason about; the wire form is larger and the provider’s own limit is the one that finally applies.
Implementations§
Source§impl AttachmentConfig
impl AttachmentConfig
Sourcepub const fn conservative() -> Self
pub const fn conservative() -> Self
No limits, which is what ships.
Sourcepub const fn with_max_files(self, max_files: Option<usize>) -> Self
pub const fn with_max_files(self, max_files: Option<usize>) -> Self
Returns a copy taking at most max_files files per request.
Sourcepub const fn with_max_total_bytes(self, max_total_bytes: Option<usize>) -> Self
pub const fn with_max_total_bytes(self, max_total_bytes: Option<usize>) -> Self
Returns a copy taking at most max_total_bytes of file per request.
Trait Implementations§
Source§impl Clone for AttachmentConfig
impl Clone for AttachmentConfig
impl Copy for AttachmentConfig
Source§impl Debug for AttachmentConfig
impl Debug for AttachmentConfig
Source§impl Default for AttachmentConfig
impl Default for AttachmentConfig
Source§impl<'de> Deserialize<'de> for AttachmentConfig
impl<'de> Deserialize<'de> for AttachmentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for AttachmentConfig
Source§impl PartialEq for AttachmentConfig
impl PartialEq for AttachmentConfig
Source§impl Serialize for AttachmentConfig
impl Serialize for AttachmentConfig
impl StructuralPartialEq for AttachmentConfig
Auto Trait Implementations§
impl Freeze for AttachmentConfig
impl RefUnwindSafe for AttachmentConfig
impl Send for AttachmentConfig
impl Sync for AttachmentConfig
impl Unpin for AttachmentConfig
impl UnsafeUnpin for AttachmentConfig
impl UnwindSafe for AttachmentConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.