pub struct AsyncChatCompletion<N, M, S = StreamOff>{
pub key: String,
/* private fields */
}Fields§
§key: StringImplementations§
Source§impl<N, M> AsyncChatCompletion<N, M, StreamOff>
impl<N, M> AsyncChatCompletion<N, M, StreamOff>
pub fn new(model: N, messages: M, key: String) -> Self
pub fn body_mut(&mut self) -> &mut ChatBody<N, M>
pub fn add_messages(self, messages: M) -> Self
pub fn with_request_id(self, request_id: impl Into<String>) -> Self
pub fn with_do_sample(self, do_sample: bool) -> Self
pub fn with_stream(self, stream: bool) -> Self
👎Deprecated: Use enable_stream()/disable_stream() for compile-time guarantees
pub fn with_tool_stream(self, tool_stream: bool) -> Selfwhere
N: ToolStreamEnable,
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn add_tool(self, tool: Tools) -> Self
pub fn add_tools(self, tools: Vec<Tools>) -> Self
pub fn with_user_id(self, user_id: impl Into<String>) -> Self
pub fn with_stop(self, stop: String) -> Self
pub fn with_thinking(self, thinking: ThinkingType) -> Selfwhere
N: ThinkEnable,
pub fn enable_stream(self) -> AsyncChatCompletion<N, M, StreamOn>
pub fn disable_stream(self) -> AsyncChatCompletion<N, M, StreamOff>
Source§impl<N, M> AsyncChatCompletion<N, M, StreamOn>
impl<N, M> AsyncChatCompletion<N, M, StreamOn>
pub fn with_tool_stream(self, tool_stream: bool) -> Selfwhere
N: ToolStreamEnable,
Trait Implementations§
Source§impl<N, M, S> HttpClient for AsyncChatCompletion<N, M, S>
impl<N, M, S> HttpClient for AsyncChatCompletion<N, M, S>
Source§impl<N, M> SseStreamable for AsyncChatCompletion<N, M, StreamOn>
impl<N, M> SseStreamable for AsyncChatCompletion<N, M, StreamOn>
Source§impl<N, M> StreamChatLikeExt for AsyncChatCompletion<N, M, StreamOn>
impl<N, M> StreamChatLikeExt for AsyncChatCompletion<N, M, StreamOn>
Auto Trait Implementations§
impl<N, M, S> Freeze for AsyncChatCompletion<N, M, S>where
N: Freeze,
impl<N, M, S> RefUnwindSafe for AsyncChatCompletion<N, M, S>
impl<N, M, S> Send for AsyncChatCompletion<N, M, S>
impl<N, M, S> Sync for AsyncChatCompletion<N, M, S>
impl<N, M, S> Unpin for AsyncChatCompletion<N, M, S>
impl<N, M, S> UnwindSafe for AsyncChatCompletion<N, M, S>
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