pub struct App {
pub config: AppConfig,
pub conversation: Arc<Mutex<Conversation>>,
pub tool_executor: Arc<ToolExecutor>,
pub api_client: Client,
/* private fields */
}Fields§
§config: AppConfig§conversation: Arc<Mutex<Conversation>>§tool_executor: Arc<ToolExecutor>§api_client: ClientImplementations§
Source§impl App
impl App
pub async fn new_with_conversation( config: AppConfig, event_tx: Sender<AppEvent>, initial_model: ModelId, workspace: Arc<dyn Workspace>, tool_executor: Arc<ToolExecutor>, session_config: Option<SessionConfig>, conversation: Conversation, ) -> Result<Self>
pub async fn new( config: AppConfig, event_tx: Sender<AppEvent>, initial_model: ModelId, workspace: Arc<dyn Workspace>, tool_executor: Arc<ToolExecutor>, session_config: Option<SessionConfig>, ) -> Result<Self>
pub fn get_current_model(&self) -> ModelId
pub async fn set_model(&mut self, model: ModelId) -> Result<()>
pub async fn add_message(&self, message: Message)
pub async fn add_message_from_data(&self, message_data: MessageData)
pub async fn process_user_message( &mut self, message: String, ) -> Result<Option<Receiver<AgentEvent>>>
pub async fn handle_command( &mut self, command: AppCommandType, ) -> Result<Option<CommandResponse>>
pub async fn compact_conversation( &mut self, token: CancellationToken, ) -> Result<CompactResult>
pub async fn cancel_current_processing(&mut self)
Sourcepub async fn inject_cancelled_tool_results(&mut self)
pub async fn inject_cancelled_tool_results(&mut self)
Inject cancelled tool results for any incomplete tool calls in the conversation. This ensures that LLM APIs receive proper tool_result blocks for every tool_use block.
Auto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl !UnwindSafe for App
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request