pub struct OpenAIChunkParser {
pub id: String,
pub object: String,
pub created: u64,
pub model: String,
pub content: String,
pub think_content: String,
/* private fields */
}Fields§
§id: String§object: String§created: u64§model: String§content: String§think_content: StringImplementations§
Source§impl OpenAIChunkParser
impl OpenAIChunkParser
pub fn parse( &mut self, data: &str, ) -> Result<(Option<ChatCompletionResponse>, Option<ToolCall>), ParserError>
pub fn response(self) -> ChatCompletionResponse
pub fn update_id_if_empty(&mut self, id: &str)
pub fn update_model_if_empty(&mut self, model: &str)
pub fn set_system_fingerprint(&mut self, system_fingerprint: Option<String>)
pub fn set_finish_reason(&mut self, finish_reason: Option<FinishReason>)
pub fn push_content(&mut self, content: &str)
pub fn push_thinking(&mut self, content: &str)
pub fn push_tool_call(&mut self, tool_call: ToolCall)
Trait Implementations§
Source§impl Clone for OpenAIChunkParser
impl Clone for OpenAIChunkParser
Source§fn clone(&self) -> OpenAIChunkParser
fn clone(&self) -> OpenAIChunkParser
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 OpenAIChunkParser
impl Debug for OpenAIChunkParser
Source§impl Default for OpenAIChunkParser
impl Default for OpenAIChunkParser
Source§fn default() -> OpenAIChunkParser
fn default() -> OpenAIChunkParser
Returns the “default value” for a type. Read more
Source§impl PartialEq for OpenAIChunkParser
impl PartialEq for OpenAIChunkParser
impl StructuralPartialEq for OpenAIChunkParser
Auto Trait Implementations§
impl Freeze for OpenAIChunkParser
impl RefUnwindSafe for OpenAIChunkParser
impl Send for OpenAIChunkParser
impl Sync for OpenAIChunkParser
impl Unpin for OpenAIChunkParser
impl UnwindSafe for OpenAIChunkParser
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