36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
//! App-server API types for predictions.
|
|
|
|
use crate::JsonSchema;
|
|
use crate::TS;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct ThreadPredictionRequestParams {
|
|
pub thread_id: String,
|
|
pub source_turn_id: String,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct ThreadPredictionRequestResponse {}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct ThreadPredictionUpdatedNotification {
|
|
pub thread_id: String,
|
|
pub source_turn_id: String,
|
|
pub result: ThreadPredictionResult,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
|
#[serde(tag = "type", rename_all = "camelCase")]
|
|
#[ts(tag = "type", rename_all = "camelCase", export_to = "v2/")]
|
|
pub enum ThreadPredictionResult {
|
|
Completed { text: Option<String> },
|
|
Failed,
|
|
}
|