pub struct EnvLessBridgeParams {Show 18 fields
pub base_url: String,
pub org_uuid: String,
pub title: String,
pub get_access_token: Arc<dyn Fn() -> Option<String> + Send + Sync>,
pub on_auth_401: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send + 'static>> + Send + Sync>>,
pub to_sdk_messages: Arc<dyn Fn(Vec<Message>) -> Vec<SDKMessage> + Send + Sync>,
pub initial_history_cap: u32,
pub initial_messages: Option<Vec<Message>>,
pub on_inbound_message: Option<Arc<dyn Fn(SDKMessage) + Send + Sync>>,
pub on_user_message: Option<Arc<dyn Fn(String, String) -> bool + Send + Sync>>,
pub on_permission_response: Option<Arc<dyn Fn(BridgeControlResponse) + Send + Sync>>,
pub on_interrupt: Option<Arc<dyn Fn() + Send + Sync>>,
pub on_set_model: Option<Arc<dyn Fn(Option<String>) + Send + Sync>>,
pub on_set_max_thinking_tokens: Option<Arc<dyn Fn(Option<u32>) + Send + Sync>>,
pub on_set_permission_mode: Option<Arc<dyn Fn(PermissionMode) -> Result<(), String> + Send + Sync>>,
pub on_state_change: Option<Arc<dyn Fn(BridgeState, Option<String>) + Send + Sync>>,
pub outbound_only: Option<bool>,
pub tags: Option<Vec<String>>,
}Expand description
Parameters for initializing the env-less bridge.
Fields§
§base_url: StringBase API URL.
org_uuid: StringOrganization UUID.
title: StringSession title.
get_access_token: Arc<dyn Fn() -> Option<String> + Send + Sync>Get the current OAuth access token.
on_auth_401: Option<Arc<dyn Fn(String) -> Pin<Box<dyn Future<Output = Result<bool, AgentError>> + Send + 'static>> + Send + Sync>>Handle OAuth 401 refresh.
to_sdk_messages: Arc<dyn Fn(Vec<Message>) -> Vec<SDKMessage> + Send + Sync>Convert internal messages to SDK format.
initial_history_cap: u32Max initial messages to replay on connect.
initial_messages: Option<Vec<Message>>Initial messages to flush on connect.
on_inbound_message: Option<Arc<dyn Fn(SDKMessage) + Send + Sync>>Callback for inbound messages.
on_user_message: Option<Arc<dyn Fn(String, String) -> bool + Send + Sync>>Callback for user messages (title derivation).
on_permission_response: Option<Arc<dyn Fn(BridgeControlResponse) + Send + Sync>>Callback for permission responses.
on_interrupt: Option<Arc<dyn Fn() + Send + Sync>>Callback for interrupt.
on_set_model: Option<Arc<dyn Fn(Option<String>) + Send + Sync>>Callback for model change.
on_set_max_thinking_tokens: Option<Arc<dyn Fn(Option<u32>) + Send + Sync>>Callback for max thinking tokens change.
on_set_permission_mode: Option<Arc<dyn Fn(PermissionMode) -> Result<(), String> + Send + Sync>>Callback for permission mode change.
on_state_change: Option<Arc<dyn Fn(BridgeState, Option<String>) + Send + Sync>>Callback for state changes.
outbound_only: Option<bool>When true, skip opening the SSE read stream.
Free-form tags for session categorization.
Trait Implementations§
Source§impl Clone for EnvLessBridgeParams
impl Clone for EnvLessBridgeParams
Source§fn clone(&self) -> EnvLessBridgeParams
fn clone(&self) -> EnvLessBridgeParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EnvLessBridgeParams
impl !RefUnwindSafe for EnvLessBridgeParams
impl Send for EnvLessBridgeParams
impl Sync for EnvLessBridgeParams
impl Unpin for EnvLessBridgeParams
impl UnsafeUnpin for EnvLessBridgeParams
impl !UnwindSafe for EnvLessBridgeParams
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