pub trait PlatformExt: Send + Sync {
// Required methods
fn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_path: &'life1 str,
media_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn send_media_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
file_url: &'life1 str,
file_name: &'life2 str,
media_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<SendResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Platform extension for file/media operations.
Exposed to tools via ToolContext.extensions under key "chatbot.platform_ext".
ChatbotFrontend implements this by delegating to its PlatformSender,
using the frontend’s own chat_id internally.
Required Methods§
Sourcefn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_path: &'life1 str,
media_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upload_file<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
file_path: &'life1 str,
media_type: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<UploadResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Upload a local file to the platform. Returns the platform identifier.
Sourcefn send_media_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
file_url: &'life1 str,
file_name: &'life2 str,
media_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<SendResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn send_media_message<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
file_url: &'life1 str,
file_name: &'life2 str,
media_type: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<SendResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Send an already-uploaded media file to the chat.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".