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:
Marshall Bowers 2024-10-04 13:19:18 -04:00 committed by GitHub
parent 07e808d16f
commit e3a6f89e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 44 additions and 59 deletions

View file

@ -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?;