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§
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".