telemetry: Add language_name and model_provider (#18640)

This PR adds a bit more metadata for assistant logging.

Release Notes:

- Assistant: Added `language_name` and `model_provider` fields to
telemetry events.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
This commit is contained in:
Boris Cherny 2024-10-04 11:37:27 -07:00 committed by GitHub
parent dfe1e43832
commit 01ad22683d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 83 additions and 29 deletions

View file

@ -12,5 +12,6 @@ workspace = true
path = "src/telemetry_events.rs"
[dependencies]
language.workspace = true
semantic_version.workspace = true
serde.workspace = true

View file

@ -1,5 +1,6 @@
//! See [Telemetry in Zed](https://zed.dev/docs/telemetry) for additional information.
use language::LanguageName;
use semantic_version::SemanticVersion;
use serde::{Deserialize, Serialize};
use std::{fmt::Display, sync::Arc, time::Duration};
@ -153,8 +154,10 @@ pub struct AssistantEvent {
pub phase: AssistantPhase,
/// Name of the AI model used (gpt-4o, claude-3-5-sonnet, etc)
pub model: String,
pub model_provider: String,
pub response_latency: Option<Duration>,
pub error_message: Option<String>,
pub language_name: Option<LanguageName>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]