Skip to main content

Candidate

Trait Candidate 

Source
pub trait Candidate {
    type Chat: Send + Sync + 'static;

    // Required methods
    fn open(
        runtime: Arc<dyn Runtime>,
        initial_primary: String,
        llm: Arc<dyn Llm>,
    ) -> (Self::Chat, UnboundedReceiver<ChatEvent>);
    fn append(
        chat: &Self::Chat,
        text: String,
    ) -> impl Future<Output = Result<(), ChatError>> + Send;
    fn restart(
        chat: &Self::Chat,
    ) -> impl Future<Output = Result<(), ChatError>> + Send;
    fn view(
        chat: &Self::Chat,
    ) -> impl Future<Output = Result<ChatView, ChatError>> + Send;
    fn finalize(
        chat: Self::Chat,
    ) -> impl Future<Output = Result<ChatView, ChatError>> + Send + 'static;
}

Required Associated Types§

Source

type Chat: Send + Sync + 'static

Required Methods§

Source

fn open( runtime: Arc<dyn Runtime>, initial_primary: String, llm: Arc<dyn Llm>, ) -> (Self::Chat, UnboundedReceiver<ChatEvent>)

Source

fn append( chat: &Self::Chat, text: String, ) -> impl Future<Output = Result<(), ChatError>> + Send

Source

fn restart( chat: &Self::Chat, ) -> impl Future<Output = Result<(), ChatError>> + Send

Source

fn view( chat: &Self::Chat, ) -> impl Future<Output = Result<ChatView, ChatError>> + Send

Source

fn finalize( chat: Self::Chat, ) -> impl Future<Output = Result<ChatView, ChatError>> + Send + 'static

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§