88 lines
2.8 KiB
Rust
88 lines
2.8 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
#[cfg(feature = "spacetime-types")]
|
|
use spacetimedb::SpacetimeType;
|
|
|
|
use crate::{AiResultReferenceKind, AiTaskKind, AiTaskStageBlueprint, AiTaskStageKind};
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskCreateInput {
|
|
pub task_id: String,
|
|
pub task_kind: AiTaskKind,
|
|
pub owner_user_id: String,
|
|
pub request_label: String,
|
|
pub source_module: String,
|
|
pub source_entity_id: Option<String>,
|
|
pub request_payload_json: Option<String>,
|
|
pub stages: Vec<AiTaskStageBlueprint>,
|
|
pub created_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskStartInput {
|
|
pub task_id: String,
|
|
pub started_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskStageStartInput {
|
|
pub task_id: String,
|
|
pub stage_kind: AiTaskStageKind,
|
|
pub started_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTextChunkAppendInput {
|
|
pub task_id: String,
|
|
pub stage_kind: AiTaskStageKind,
|
|
pub sequence: u32,
|
|
pub delta_text: String,
|
|
pub created_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiStageCompletionInput {
|
|
pub task_id: String,
|
|
pub stage_kind: AiTaskStageKind,
|
|
pub text_output: Option<String>,
|
|
pub structured_payload_json: Option<String>,
|
|
pub warning_messages: Vec<String>,
|
|
pub completed_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiResultReferenceInput {
|
|
pub task_id: String,
|
|
pub reference_kind: AiResultReferenceKind,
|
|
pub reference_id: String,
|
|
pub label: Option<String>,
|
|
pub created_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskFinishInput {
|
|
pub task_id: String,
|
|
pub completed_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskCancelInput {
|
|
pub task_id: String,
|
|
pub completed_at_micros: i64,
|
|
}
|
|
|
|
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
|
pub struct AiTaskFailureInput {
|
|
pub task_id: String,
|
|
pub failure_message: String,
|
|
pub completed_at_micros: i64,
|
|
}
|