pub struct PromptInjectionAction {
pub id: String,
pub prompt: String,
}Expand description
One hidden action the judge may select for system prompt injection.
Fields§
§id: StringStable action id the judge returns.
prompt: StringSystem prompt inserted when this action is selected.
Implementations§
Source§impl PromptInjectionAction
impl PromptInjectionAction
Sourcepub fn new(id: impl Into<String>, prompt: impl Into<String>) -> Result<Self>
pub fn new(id: impl Into<String>, prompt: impl Into<String>) -> Result<Self>
Creates one validated action entry.
Sourcepub fn parse_database(source: &str) -> Result<Vec<Self>>
pub fn parse_database(source: &str) -> Result<Vec<Self>>
Parses a text action DB.
The format is intentionally small:
[action_id]
System prompt text to inject.
[other_action]
Another system prompt.Trait Implementations§
Source§impl Clone for PromptInjectionAction
impl Clone for PromptInjectionAction
Source§fn clone(&self) -> PromptInjectionAction
fn clone(&self) -> PromptInjectionAction
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PromptInjectionAction
impl Debug for PromptInjectionAction
Source§impl PartialEq for PromptInjectionAction
impl PartialEq for PromptInjectionAction
impl Eq for PromptInjectionAction
impl StructuralPartialEq for PromptInjectionAction
Auto Trait Implementations§
impl Freeze for PromptInjectionAction
impl RefUnwindSafe for PromptInjectionAction
impl Send for PromptInjectionAction
impl Sync for PromptInjectionAction
impl Unpin for PromptInjectionAction
impl UnsafeUnpin for PromptInjectionAction
impl UnwindSafe for PromptInjectionAction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.