pub struct ChatCompletionRunner { /* private fields */ }Available on crate feature
tool-runner only.Expand description
表示非流式工具调用运行 trace。
Implementations§
Source§impl ChatCompletionRunner
impl ChatCompletionRunner
Sourcepub fn messages(&self) -> &[ChatCompletionMessage]
pub fn messages(&self) -> &[ChatCompletionMessage]
返回运行过程中累积的全部消息。
Sourcepub fn all_chat_completions(&self) -> &[ChatCompletion]
pub fn all_chat_completions(&self) -> &[ChatCompletion]
返回运行过程中累积的全部聊天补全。
Sourcepub fn tool_results(&self) -> &[ChatCompletionToolResult]
pub fn tool_results(&self) -> &[ChatCompletionToolResult]
返回运行过程中累积的全部工具调用结果。
Sourcepub fn final_chat_completion(&self) -> Option<&ChatCompletion>
pub fn final_chat_completion(&self) -> Option<&ChatCompletion>
返回最终聊天补全结果。
Sourcepub fn final_message(&self) -> Option<&ChatCompletionMessage>
pub fn final_message(&self) -> Option<&ChatCompletionMessage>
返回最终 assistant 消息。
Sourcepub fn final_content(&self) -> Option<&str>
pub fn final_content(&self) -> Option<&str>
返回最终 assistant 文本。
Sourcepub fn final_function_tool_call(&self) -> Option<&ChatCompletionToolCall>
pub fn final_function_tool_call(&self) -> Option<&ChatCompletionToolCall>
返回最终工具调用。
Sourcepub fn final_function_tool_call_result(&self) -> Option<&str>
pub fn final_function_tool_call_result(&self) -> Option<&str>
返回最终工具调用结果。
Sourcepub fn total_usage(&self) -> Option<CompletionUsage>
pub fn total_usage(&self) -> Option<CompletionUsage>
汇总所有补全响应中的 usage 字段。
Trait Implementations§
Source§impl Clone for ChatCompletionRunner
impl Clone for ChatCompletionRunner
Source§fn clone(&self) -> ChatCompletionRunner
fn clone(&self) -> ChatCompletionRunner
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 moreSource§impl Debug for ChatCompletionRunner
impl Debug for ChatCompletionRunner
Source§impl Default for ChatCompletionRunner
impl Default for ChatCompletionRunner
Source§fn default() -> ChatCompletionRunner
fn default() -> ChatCompletionRunner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChatCompletionRunner
impl RefUnwindSafe for ChatCompletionRunner
impl Send for ChatCompletionRunner
impl Sync for ChatCompletionRunner
impl Unpin for ChatCompletionRunner
impl UnsafeUnpin for ChatCompletionRunner
impl UnwindSafe for ChatCompletionRunner
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