mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 11:24:45 +08:00
feat(ai): add endpoints to chat with ai service (#8585)
Co-authored-by: Riddhiagrawal001 <riddhi.agrawal2112@gmail.com> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
18
crates/api_models/src/chat.rs
Normal file
18
crates/api_models/src/chat.rs
Normal file
@ -0,0 +1,18 @@
|
||||
use common_utils::id_type;
|
||||
use masking::Secret;
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)]
|
||||
pub struct ChatRequest {
|
||||
pub message: Secret<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Deserialize, serde::Serialize)]
|
||||
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>,
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
pub mod apple_pay_certificates_migration;
|
||||
pub mod chat;
|
||||
pub mod connector_onboarding;
|
||||
pub mod customer;
|
||||
pub mod dispute;
|
||||
|
||||
5
crates/api_models/src/events/chat.rs
Normal file
5
crates/api_models/src/events/chat.rs
Normal file
@ -0,0 +1,5 @@
|
||||
use common_utils::events::{ApiEventMetric, ApiEventsType};
|
||||
|
||||
use crate::chat::{ChatRequest, ChatResponse};
|
||||
|
||||
common_utils::impl_api_event_type!(Chat, (ChatRequest, ChatResponse));
|
||||
@ -5,6 +5,7 @@ pub mod apple_pay_certificates_migration;
|
||||
pub mod authentication;
|
||||
pub mod blocklist;
|
||||
pub mod cards_info;
|
||||
pub mod chat;
|
||||
pub mod conditional_configs;
|
||||
pub mod connector_enums;
|
||||
pub mod connector_onboarding;
|
||||
|
||||
Reference in New Issue
Block a user