Skip to main content

ConversationViewFactory

Type Alias ConversationViewFactory 

Source
pub type ConversationViewFactory = Box<dyn Fn() -> Box<dyn ConversationView> + Send + Sync>;
Expand description

Type alias for conversation view factory functions.

A factory is called to create a new ConversationView instance, typically when creating a new session or clearing the current one.

§Example

let factory: ConversationViewFactory = Box::new(|| {
    Box::new(ChatView::new()
        .with_title("My Agent")
        .with_initial_content(welcome_renderer))
});

Aliased Type§

pub struct ConversationViewFactory(/* private fields */);