refactor editor agent structures
This commit is contained in:
@@ -63,8 +63,9 @@ pub enum EditorAgentToolName {
|
||||
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum EditorAgentGenerationStatus {
|
||||
Generating,
|
||||
pub enum EditorAgentToolCallStatus {
|
||||
PendingConfirmation,
|
||||
Executing,
|
||||
Completed,
|
||||
Failed,
|
||||
}
|
||||
@@ -107,16 +108,12 @@ pub struct EditorAgentGeneratedImage {
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct EditorAgentGenerationRecord {
|
||||
pub tool_call_id: String,
|
||||
pub tool_name: EditorAgentToolName,
|
||||
pub struct EditorAgentToolCall {
|
||||
pub tool_name: String,
|
||||
#[serde(default)]
|
||||
pub summary: Option<String>,
|
||||
#[serde(default)]
|
||||
pub task_id: Option<String>,
|
||||
pub status: EditorAgentGenerationStatus,
|
||||
#[serde(default)]
|
||||
pub model: Option<String>,
|
||||
pub summary: String,
|
||||
pub status: EditorAgentToolCallStatus,
|
||||
pub args: serde_json::Value,
|
||||
#[serde(default)]
|
||||
pub images: Vec<EditorAgentGeneratedImage>,
|
||||
#[serde(default)]
|
||||
@@ -128,13 +125,11 @@ pub struct EditorAgentGenerationRecord {
|
||||
pub struct EditorAgentMessage {
|
||||
pub id: String,
|
||||
pub role: EditorAgentMessageRole,
|
||||
pub kind: EditorAgentMessageKind,
|
||||
pub text: String,
|
||||
#[serde(default)]
|
||||
pub attachments: Vec<EditorAgentAttachmentRef>,
|
||||
#[serde(default)]
|
||||
pub generations: Vec<EditorAgentGenerationRecord>,
|
||||
pub status: EditorAgentMessageStatus,
|
||||
// one tool call is inside one system message.
|
||||
pub tool_call: Option<EditorAgentToolCall>,
|
||||
pub created_at: String,
|
||||
}
|
||||
|
||||
@@ -143,8 +138,6 @@ pub struct EditorAgentMessage {
|
||||
pub struct EditorAgentConversationSummary {
|
||||
pub conversation_id: String,
|
||||
pub project_id: String,
|
||||
pub title: String,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
@@ -245,7 +238,7 @@ pub struct EditorAgentToolEvent {
|
||||
#[serde(default)]
|
||||
pub model: Option<String>,
|
||||
#[serde(default)]
|
||||
pub status: Option<EditorAgentGenerationStatus>,
|
||||
pub status: Option<EditorAgentToolCallStatus>,
|
||||
#[serde(default)]
|
||||
pub error: Option<String>,
|
||||
}
|
||||
@@ -308,7 +301,7 @@ mod tests {
|
||||
width: Some(1024),
|
||||
height: Some(768),
|
||||
}],
|
||||
generations: vec![],
|
||||
tool_calls: vec![],
|
||||
status: EditorAgentMessageStatus::Completed,
|
||||
created_at: "2026-07-03T00:00:00Z".to_string(),
|
||||
}],
|
||||
|
||||
@@ -34,3 +34,4 @@ pub mod square_hole_works;
|
||||
pub mod story;
|
||||
pub mod visual_novel;
|
||||
pub mod wooden_fish;
|
||||
pub mod editor_agent_new;
|
||||
|
||||
Reference in New Issue
Block a user