pub struct AiPromptAction {
pub prompt_template: String,
pub variables: HashMap<String, String>,
pub model: Option<String>,
pub temperature: Option<f32>,
pub max_tokens: Option<u32>,
pub stream: bool,
}Expand description
AI prompt action configuration
Sends a prompt to an AI assistant with variables substituted from the event context. Supports streaming responses and custom model configuration.
§Examples
ⓘ
AiPromptAction {
prompt_template: "Format the following code:\n{{code}}".to_string(),
variables: vec![
("code".to_string(), "file_content".to_string()),
].into_iter().collect(),
model: Some("gpt-4".to_string()),
temperature: Some(0.7),
max_tokens: Some(2000),
stream: true,
}Fields§
§prompt_template: StringPrompt template with variable placeholders
variables: HashMap<String, String>Variables for substitution (maps placeholder to context key)
model: Option<String>Optional model name
temperature: Option<f32>Optional temperature (0.0 to 2.0)
max_tokens: Option<u32>Optional max tokens for response
stream: boolWhether to stream responses
Trait Implementations§
Source§impl Clone for AiPromptAction
impl Clone for AiPromptAction
Source§fn clone(&self) -> AiPromptAction
fn clone(&self) -> AiPromptAction
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 AiPromptAction
impl Debug for AiPromptAction
Source§impl<'de> Deserialize<'de> for AiPromptAction
impl<'de> Deserialize<'de> for AiPromptAction
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AiPromptAction
impl RefUnwindSafe for AiPromptAction
impl Send for AiPromptAction
impl Sync for AiPromptAction
impl Unpin for AiPromptAction
impl UnwindSafe for AiPromptAction
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