95 lines
3.1 KiB
Rust
95 lines
3.1 KiB
Rust
use crate::models::common::{
|
|
AiFeature, EventType, JsonValue, Modality, Permission, Priority, Scope, Status, TargetType,
|
|
};
|
|
use serde::{Deserialize, Serialize};
|
|
use std::collections::BTreeMap;
|
|
use uuid::Uuid;
|
|
|
|
pub type TypedJson<T> = sqlx::types::Json<T>;
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct ModelParameters {
|
|
pub temperature: Option<String>,
|
|
pub top_p: Option<String>,
|
|
pub max_tokens: Option<i32>,
|
|
pub stop_sequences: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct RetryPolicy {
|
|
pub max_attempts: Option<i32>,
|
|
pub initial_backoff_ms: Option<i32>,
|
|
pub max_backoff_ms: Option<i32>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct AgentVersionConfig {
|
|
pub parameters: Option<ModelParameters>,
|
|
pub retry: Option<RetryPolicy>,
|
|
pub timeout_seconds: Option<i32>,
|
|
pub parallel_tool_calls: Option<bool>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct AgentEventFilters {
|
|
pub event_actions: Vec<EventType>,
|
|
pub branch_patterns: Vec<String>,
|
|
pub path_patterns: Vec<String>,
|
|
pub label_names: Vec<String>,
|
|
pub actor_ids: Vec<Uuid>,
|
|
pub include_bots: Option<bool>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct AgentSchedulePayload {
|
|
pub target_type: Option<TargetType>,
|
|
pub target_id: Option<Uuid>,
|
|
pub variables: BTreeMap<String, JsonValue>,
|
|
pub dry_run: Option<bool>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct AiModelCapabilityConfig {
|
|
pub input_modalities: Vec<Modality>,
|
|
pub output_modalities: Vec<Modality>,
|
|
pub supported_features: Vec<AiFeature>,
|
|
pub max_input_tokens: Option<i32>,
|
|
pub max_output_tokens: Option<i32>,
|
|
pub limits: BTreeMap<String, JsonValue>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default, utoipa::ToSchema)]
|
|
pub struct WorkspaceIntegrationConfig {
|
|
pub scopes: Vec<Scope>,
|
|
pub permissions: Vec<Permission>,
|
|
pub repo_ids: Vec<Uuid>,
|
|
pub channel_ids: Vec<Uuid>,
|
|
pub callback_url: Option<String>,
|
|
pub settings: BTreeMap<String, JsonValue>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default, utoipa::ToSchema)]
|
|
pub struct NotificationMetadata {
|
|
pub source: Option<String>,
|
|
pub severity: Option<Priority>,
|
|
pub dedupe_key: Option<String>,
|
|
pub template_data: BTreeMap<String, JsonValue>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
|
pub struct ConversationAttachmentMetadata {
|
|
pub checksum_sha256: Option<String>,
|
|
pub width: Option<i32>,
|
|
pub height: Option<i32>,
|
|
pub duration_ms: Option<i64>,
|
|
pub preview_url: Option<String>,
|
|
pub virus_scan_status: Option<Status>,
|
|
pub extra: BTreeMap<String, JsonValue>,
|
|
}
|