parent
eef44aff7f
commit
b43b800a54
6 changed files with 66 additions and 5 deletions
|
@ -44,7 +44,6 @@ pub enum AssistantKind {
|
|||
Panel,
|
||||
Inline,
|
||||
}
|
||||
|
||||
impl Display for AssistantKind {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
|
@ -58,6 +57,31 @@ impl Display for AssistantKind {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum AssistantPhase {
|
||||
#[default]
|
||||
Response,
|
||||
Invoked,
|
||||
Accepted,
|
||||
Rejected,
|
||||
}
|
||||
|
||||
impl Display for AssistantPhase {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(
|
||||
f,
|
||||
"{}",
|
||||
match self {
|
||||
Self::Response => "response",
|
||||
Self::Invoked => "invoked",
|
||||
Self::Accepted => "accepted",
|
||||
Self::Rejected => "rejected",
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(tag = "type")]
|
||||
pub enum Event {
|
||||
|
@ -121,6 +145,8 @@ pub struct AssistantEvent {
|
|||
pub conversation_id: Option<String>,
|
||||
/// The kind of assistant (Panel, Inline)
|
||||
pub kind: AssistantKind,
|
||||
#[serde(default)]
|
||||
pub phase: AssistantPhase,
|
||||
/// Name of the AI model used (gpt-4o, claude-3-5-sonnet, etc)
|
||||
pub model: String,
|
||||
pub response_latency: Option<Duration>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue