pub struct LlmCallRecord {
pub call_type: String,
pub prompt: String,
pub response: String,
pub model: String,
pub endpoint: String,
pub lora: Option<String>,
pub latency_ms: u64,
pub timestamp_ms: u64,
pub worker_id: Option<usize>,
pub error: Option<String>,
}Expand description
LLM呼び出しの記録
LlmDebugEvent から変換可能(swarm-engine-llm crate で実装)。
Fields§
§call_type: String呼び出し種別(“decide”, “call_raw” 等)
prompt: Stringプロンプト
response: Stringレスポンス
model: Stringモデル名
endpoint: Stringエンドポイント
lora: Option<String>LoRAアダプター名
latency_ms: u64レイテンシ(ミリ秒)
timestamp_ms: u64タイムスタンプ(Unix epoch ms)
worker_id: Option<usize>Worker ID
error: Option<String>エラー(あれば)
Implementations§
Source§impl LlmCallRecord
impl LlmCallRecord
pub fn new(call_type: impl Into<String>, model: impl Into<String>) -> Self
pub fn prompt(self, prompt: impl Into<String>) -> Self
pub fn response(self, response: impl Into<String>) -> Self
pub fn endpoint(self, endpoint: impl Into<String>) -> Self
pub fn lora(self, lora: impl Into<String>) -> Self
pub fn latency_ms(self, latency: u64) -> Self
pub fn worker_id(self, id: usize) -> Self
pub fn error(self, error: impl Into<String>) -> Self
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
成功したか(エラーがなく、レスポンスがある)
Trait Implementations§
Source§impl Clone for LlmCallRecord
impl Clone for LlmCallRecord
Source§fn clone(&self) -> LlmCallRecord
fn clone(&self) -> LlmCallRecord
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 LlmCallRecord
impl Debug for LlmCallRecord
Source§impl<'de> Deserialize<'de> for LlmCallRecord
impl<'de> Deserialize<'de> for LlmCallRecord
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
Source§impl From<LlmCallRecord> for Record
impl From<LlmCallRecord> for Record
Source§fn from(record: LlmCallRecord) -> Self
fn from(record: LlmCallRecord) -> Self
Converts to this type from the input type.
Source§impl FromRecord for LlmCallRecord
impl FromRecord for LlmCallRecord
fn from_record(record: &Record) -> Option<&Self>
Auto Trait Implementations§
impl Freeze for LlmCallRecord
impl RefUnwindSafe for LlmCallRecord
impl Send for LlmCallRecord
impl Sync for LlmCallRecord
impl Unpin for LlmCallRecord
impl UnwindSafe for LlmCallRecord
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more