Make report_assistant_event
take an AssistantEvent
struct (#18741)
This PR makes the `report_assistant_event` method take an `AssistantEvent` struct instead of all of the struct fields as individual parameters. Release Notes: - N/A
This commit is contained in:
parent
07e808d16f
commit
e3a6f89e2d
4 changed files with 44 additions and 59 deletions
|
@ -25,6 +25,7 @@ use std::{
|
|||
sync::Arc,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
use telemetry_events::{AssistantEvent, AssistantKind, AssistantPhase};
|
||||
use terminal::Terminal;
|
||||
use terminal_view::TerminalView;
|
||||
use theme::ThemeSettings;
|
||||
|
@ -1063,14 +1064,14 @@ impl Codegen {
|
|||
|
||||
let error_message = result.as_ref().err().map(|error| error.to_string());
|
||||
if let Some(telemetry) = telemetry {
|
||||
telemetry.report_assistant_event(
|
||||
None,
|
||||
telemetry_events::AssistantKind::Inline,
|
||||
telemetry_events::AssistantPhase::Response,
|
||||
model_telemetry_id,
|
||||
telemetry.report_assistant_event(AssistantEvent {
|
||||
conversation_id: None,
|
||||
kind: AssistantKind::Inline,
|
||||
phase: AssistantPhase::Response,
|
||||
model: model_telemetry_id,
|
||||
response_latency,
|
||||
error_message,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
result?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue