PlatformSpecificClient

Trait PlatformSpecificClient 

Source
pub trait PlatformSpecificClient<E>{
    // Required methods
    fn create_chat_completion_with_search<'life0, 'async_trait>(
        &'life0 self,
        request: ChatCompletionRequest,
        search_config: SearchGroundingConfig,
    ) -> Pin<Box<dyn Future<Output = Result<CreateChatCompletionResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn search_and_ground<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
        context: Option<&'life2 str>,
        config: SearchGroundingConfig,
    ) -> Pin<Box<dyn Future<Output = Result<GroundedResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn execute_code<'life0, 'life1, 'async_trait>(
        &'life0 self,
        code: &'life1 str,
        config: CodeExecutionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<CodeExecutionResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_chat_completion_with_code_execution<'life0, 'async_trait>(
        &'life0 self,
        request: ChatCompletionRequest,
        execution_config: CodeExecutionConfig,
    ) -> Pin<Box<dyn Future<Output = Result<CreateChatCompletionResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn browse_url<'life0, 'life1, 'async_trait>(
        &'life0 self,
        url: &'life1 str,
        config: WebBrowsingConfig,
    ) -> Pin<Box<dyn Future<Output = Result<BrowsingResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn create_chat_completion_with_browsing<'life0, 'async_trait>(
        &'life0 self,
        request: ChatCompletionRequest,
        browsing_config: WebBrowsingConfig,
    ) -> Pin<Box<dyn Future<Output = Result<CreateChatCompletionResponse>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn generate_image<'life0, 'life1, 'async_trait>(
        &'life0 self,
        prompt: &'life1 str,
        config: ImageGenerationConfig,
    ) -> Pin<Box<dyn Future<Output = Result<ImageResult>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

Extension trait for platform-specific client methods.

Required Methods§

Creates a chat completion with search grounding integration.

§Errors

Returns error if search grounding fails or chat completion fails.

Source

fn search_and_ground<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, query: &'life1 str, context: Option<&'life2 str>, config: SearchGroundingConfig, ) -> Pin<Box<dyn Future<Output = Result<GroundedResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Performs search grounding for a query with optional context.

§Errors

Returns error if search operation fails.

Source

fn execute_code<'life0, 'life1, 'async_trait>( &'life0 self, code: &'life1 str, config: CodeExecutionConfig, ) -> Pin<Box<dyn Future<Output = Result<CodeExecutionResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Executes code in a secure environment.

§Errors

Returns error if code execution fails or times out.

Source

fn create_chat_completion_with_code_execution<'life0, 'async_trait>( &'life0 self, request: ChatCompletionRequest, execution_config: CodeExecutionConfig, ) -> Pin<Box<dyn Future<Output = Result<CreateChatCompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a chat completion with code execution capabilities.

§Errors

Returns error if code execution or chat completion fails.

Source

fn browse_url<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 str, config: WebBrowsingConfig, ) -> Pin<Box<dyn Future<Output = Result<BrowsingResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Browses a URL and extracts content.

§Errors

Returns error if URL cannot be accessed or content extraction fails.

Source

fn create_chat_completion_with_browsing<'life0, 'async_trait>( &'life0 self, request: ChatCompletionRequest, browsing_config: WebBrowsingConfig, ) -> Pin<Box<dyn Future<Output = Result<CreateChatCompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Creates a chat completion with web browsing capabilities.

§Errors

Returns error if browsing or chat completion fails.

Source

fn generate_image<'life0, 'life1, 'async_trait>( &'life0 self, prompt: &'life1 str, config: ImageGenerationConfig, ) -> Pin<Box<dyn Future<Output = Result<ImageResult>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Generates an image from a prompt.

§Errors

Returns error if image generation fails.

Implementors§