Files
Jeeva Ramachandran 8ed3f7dbf2 feat: add hyperswitch ai chats table (#8831)
Co-authored-by: Apoorv Dixit <apoorv.dixit@juspay.in>
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
2025-09-16 08:25:41 +00:00

49 lines
1.4 KiB
Rust

use common_utils::id_type;
use masking::Secret;
use time::PrimitiveDateTime;
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct ChatRequest {
pub message: Secret<String>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
pub struct ChatResponse {
pub response: Secret<serde_json::Value>,
pub merchant_id: id_type::MerchantId,
pub status: String,
#[serde(skip_serializing)]
pub query_executed: Option<Secret<String>>,
#[serde(skip_serializing)]
pub row_count: Option<i32>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct ChatListRequest {
pub merchant_id: Option<id_type::MerchantId>,
pub limit: Option<i64>,
pub offset: Option<i64>,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct ChatConversation {
pub id: String,
pub session_id: Option<String>,
pub user_id: Option<String>,
pub merchant_id: Option<String>,
pub profile_id: Option<String>,
pub org_id: Option<String>,
pub role_id: Option<String>,
pub user_query: Secret<String>,
pub response: Secret<serde_json::Value>,
pub database_query: Option<String>,
pub interaction_status: Option<String>,
#[serde(with = "common_utils::custom_serde::iso8601")]
pub created_at: PrimitiveDateTime,
}
#[derive(Debug, serde::Deserialize, serde::Serialize)]
pub struct ChatListResponse {
pub conversations: Vec<ChatConversation>,
}