pub enum Event {
Ping(PingEvent),
Usage(UsageEvent),
Status(StatusEvent),
Error(ErrorEvent),
BlockStart(BlockStart),
BlockDelta(BlockDelta),
BlockStop(BlockStop),
BlockAbort(BlockAbort),
}Expand description
Variants§
Ping(PingEvent)
ハートビート
Usage(UsageEvent)
トークン使用量
Status(StatusEvent)
ストリームのステータス変化
Error(ErrorEvent)
エラー発生
BlockStart(BlockStart)
ブロック開始(テキスト、ツール使用等)
BlockDelta(BlockDelta)
ブロックの差分データ
BlockStop(BlockStop)
ブロック正常終了
BlockAbort(BlockAbort)
ブロック中断
Implementations§
Source§impl Event
impl Event
Sourcepub fn text_block_start(index: usize) -> Self
pub fn text_block_start(index: usize) -> Self
テキストブロック開始イベントを作成
Sourcepub fn text_delta(index: usize, text: impl Into<String>) -> Self
pub fn text_delta(index: usize, text: impl Into<String>) -> Self
テキストデルタイベントを作成
Sourcepub fn text_block_stop(index: usize, stop_reason: Option<StopReason>) -> Self
pub fn text_block_stop(index: usize, stop_reason: Option<StopReason>) -> Self
テキストブロック停止イベントを作成
Sourcepub fn tool_use_start(
index: usize,
id: impl Into<String>,
name: impl Into<String>,
) -> Self
pub fn tool_use_start( index: usize, id: impl Into<String>, name: impl Into<String>, ) -> Self
ツール使用ブロック開始イベントを作成
Sourcepub fn tool_input_delta(index: usize, json: impl Into<String>) -> Self
pub fn tool_input_delta(index: usize, json: impl Into<String>) -> Self
ツール引数デルタイベントを作成
Sourcepub fn tool_use_stop(index: usize) -> Self
pub fn tool_use_stop(index: usize) -> Self
ツール使用ブロック停止イベントを作成
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnwindSafe for Event
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