Skip to main content

Files

Trait Files 

Source
pub trait Files: Send + Sync {
    // Required methods
    fn provider(&self) -> &str;
    fn upload_file<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: &'life1 UploadFileCallOptions,
    ) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, AiMuxError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn specification_version(&self) -> &'static str { ... }
}
Expand description

The unified file-management interface (provider-facing).

Aligned with V4 FilesV4. Named Files (dropping the V4 suffix) to match the established convention of crate::language_model::LanguageModel et al.

Required Methods§

Source

fn provider(&self) -> &str

Provider ID.

Source

fn upload_file<'life0, 'life1, 'async_trait>( &'life0 self, options: &'life1 UploadFileCallOptions, ) -> Pin<Box<dyn Future<Output = Result<UploadFileResult, AiMuxError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Upload a file to the provider and return a provider reference that can be used in subsequent API calls.

Note: this method has no do_ prefix, matching the TS FilesV4 spec.

Provided Methods§

Source

fn specification_version(&self) -> &'static str

Specification version (always "v4").

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§