mirror of
https://github.com/katanemo/plano.git
synced 2026-06-17 15:25:17 +02:00
25 lines
622 B
Rust
25 lines
622 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub enum PromptGuardTask {
|
|
#[serde(rename = "jailbreak")]
|
|
Jailbreak,
|
|
#[serde(rename = "toxicity")]
|
|
Toxicity,
|
|
#[serde(rename = "both")]
|
|
Both,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct PromptGuardRequest {
|
|
pub input: String,
|
|
pub task: PromptGuardTask,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct PromptGuardResponse {
|
|
pub toxic_prob: Option<f64>,
|
|
pub jailbreak_prob: Option<f64>,
|
|
pub toxic_verdict: Option<bool>,
|
|
pub jailbreak_verdict: Option<bool>,
|
|
}
|