pub struct ChatSession { /* private fields */ }Expand description
Chat 会话。
Implementations§
Source§impl ChatSession
impl ChatSession
Sourcepub async fn send_message(
&self,
message: impl Into<String>,
) -> Result<GenerateContentResponse>
pub async fn send_message( &self, message: impl Into<String>, ) -> Result<GenerateContentResponse>
Sourcepub async fn send_message_stream(
&self,
message: impl Into<String>,
) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
pub async fn send_message_stream( &self, message: impl Into<String>, ) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
Sourcepub async fn send_stream(
&self,
message: impl Into<String>,
) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
pub async fn send_stream( &self, message: impl Into<String>, ) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
Sourcepub async fn send_message_with_callable_tools(
&self,
message: impl Into<String>,
callable_tools: Vec<Box<dyn CallableTool>>,
) -> Result<GenerateContentResponse>
pub async fn send_message_with_callable_tools( &self, message: impl Into<String>, callable_tools: Vec<Box<dyn CallableTool>>, ) -> Result<GenerateContentResponse>
Sourcepub async fn send_message_stream_with_callable_tools(
&self,
message: impl Into<String>,
callable_tools: Vec<Box<dyn CallableTool>>,
) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
pub async fn send_message_stream_with_callable_tools( &self, message: impl Into<String>, callable_tools: Vec<Box<dyn CallableTool>>, ) -> Result<impl Stream<Item = Result<GenerateContentResponse>>>
Sourcepub async fn clear_history(&self)
pub async fn clear_history(&self)
清空历史。
Trait Implementations§
Source§impl Clone for ChatSession
impl Clone for ChatSession
Source§fn clone(&self) -> ChatSession
fn clone(&self) -> ChatSession
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 ChatSession
impl !RefUnwindSafe for ChatSession
impl Send for ChatSession
impl Sync for ChatSession
impl Unpin for ChatSession
impl UnsafeUnpin for ChatSession
impl !UnwindSafe for ChatSession
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