pub struct AiCallbackHandler { /* private fields */ }Expand description
AI Callback Handler
Handles AI callback requests from external extension services.
Implementations§
Source§impl AiCallbackHandler
impl AiCallbackHandler
Sourcepub fn new(security: Arc<SecurityValidator>) -> Self
pub fn new(security: Arc<SecurityValidator>) -> Self
Create a new AI callback handler
Sourcepub fn with_default_model(self, model: impl Into<String>) -> Self
pub fn with_default_model(self, model: impl Into<String>) -> Self
Set default model
Sourcepub fn with_timeout(self, timeout_ms: u64) -> Self
pub fn with_timeout(self, timeout_ms: u64) -> Self
Set default timeout
Sourcepub fn with_max_tokens_limit(self, limit: u32) -> Self
pub fn with_max_tokens_limit(self, limit: u32) -> Self
Set max tokens limit
Sourcepub async fn handle(
&self,
request: AiCallbackRequest,
) -> Result<AiCallbackResult, AiCallbackError>
pub async fn handle( &self, request: AiCallbackRequest, ) -> Result<AiCallbackResult, AiCallbackError>
Handle an AI callback request
Sourcepub fn create_error_response(
&self,
error: AiCallbackError,
id: JsonRpcId,
) -> JsonRpcResponse
pub fn create_error_response( &self, error: AiCallbackError, id: JsonRpcId, ) -> JsonRpcResponse
Create a JSON-RPC error response for AI callback failures
Sourcepub fn is_model_available(&self, model: &str) -> bool
pub fn is_model_available(&self, model: &str) -> bool
Check if a model is available
Sourcepub fn get_available_models(&self) -> Vec<String>
pub fn get_available_models(&self) -> Vec<String>
Get available models
Auto Trait Implementations§
impl !RefUnwindSafe for AiCallbackHandler
impl !UnwindSafe for AiCallbackHandler
impl Freeze for AiCallbackHandler
impl Send for AiCallbackHandler
impl Sync for AiCallbackHandler
impl Unpin for AiCallbackHandler
impl UnsafeUnpin for AiCallbackHandler
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
Mutably borrows from an owned value. Read more