Writes the current context window to logs/current_context_window (uses a symlink to a session ID). This PR was unfortunately generated by a different LLM and did a ton of superficial reformating, it's actually a fairly small and benign change, but I don't want to roll back everything. Hope that's ok.
48 lines
1.1 KiB
Rust
48 lines
1.1 KiB
Rust
use chrono::{DateTime, Utc};
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ChatMessage {
|
|
pub id: String,
|
|
pub timestamp: DateTime<Utc>,
|
|
pub agent: AgentType,
|
|
pub content: String,
|
|
pub message_type: MessageType,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum AgentType {
|
|
Coach,
|
|
Player,
|
|
Single,
|
|
User,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
|
|
#[serde(rename_all = "lowercase")]
|
|
pub enum MessageType {
|
|
Text,
|
|
ToolCall,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct ToolCall {
|
|
pub id: String,
|
|
pub timestamp: DateTime<Utc>,
|
|
pub tool_name: String,
|
|
pub parameters: serde_json::Value,
|
|
pub result: Option<serde_json::Value>,
|
|
pub execution_time_ms: Option<u64>,
|
|
pub success: bool,
|
|
pub error: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct LogEntry {
|
|
pub timestamp: DateTime<Utc>,
|
|
pub level: String,
|
|
pub message: String,
|
|
pub fields: serde_json::Value,
|
|
}
|