assistant: Add health telemetry (#19928)

This PR adds a bit of telemetry for Anthropic models, in order to
understand model health. With this logging, we can monitor and diagnose
dips in performance, for example due to model rollouts.

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Boris Cherny 2024-10-31 16:21:26 -07:00 committed by GitHub
parent a0988508f0
commit b87c4a1e13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 354 additions and 144 deletions

View file

@ -47,6 +47,7 @@ pub struct EventWrapper {
pub enum AssistantKind {
Panel,
Inline,
InlineTerminal,
}
impl Display for AssistantKind {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
@ -56,6 +57,7 @@ impl Display for AssistantKind {
match self {
Self::Panel => "panel",
Self::Inline => "inline",
Self::InlineTerminal => "inline_terminal",
}
)
}
@ -140,6 +142,8 @@ pub struct CallEvent {
pub struct AssistantEvent {
/// Unique random identifier for each assistant tab (None for inline assist)
pub conversation_id: Option<String>,
/// Server-generated message ID (only supported for some providers)
pub message_id: Option<String>,
/// The kind of assistant (Panel, Inline)
pub kind: AssistantKind,
#[serde(default)]