pub struct AiResponseConfig {
pub enabled: bool,
pub mode: AiResponseMode,
pub prompt: Option<String>,
pub context: Option<String>,
pub temperature: f32,
pub max_tokens: usize,
pub schema: Option<Value>,
pub cache_enabled: bool,
}
Expand description
Configuration for AI-assisted response generation per endpoint
This is parsed from the x-mockforge-ai
OpenAPI extension
Fields§
§enabled: bool
Whether AI response generation is enabled
mode: AiResponseMode
Response generation mode
prompt: Option<String>
Prompt template for LLM generation Supports template variables: {{body.field}}, {{path.param}}, {{query.param}}, {{headers.name}}
context: Option<String>
Additional context for generation
temperature: f32
Temperature for LLM (0.0 to 2.0)
max_tokens: usize
Max tokens for LLM response
schema: Option<Value>
Schema that the response should conform to (JSON Schema)
cache_enabled: bool
Enable caching for identical requests
Implementations§
Trait Implementations§
Source§impl Clone for AiResponseConfig
impl Clone for AiResponseConfig
Source§fn clone(&self) -> AiResponseConfig
fn clone(&self) -> AiResponseConfig
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 AiResponseConfig
impl Debug for AiResponseConfig
Source§impl Default for AiResponseConfig
impl Default for AiResponseConfig
Source§impl<'de> Deserialize<'de> for AiResponseConfig
impl<'de> Deserialize<'de> for AiResponseConfig
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 AiResponseConfig
impl RefUnwindSafe for AiResponseConfig
impl Send for AiResponseConfig
impl Sync for AiResponseConfig
impl Unpin for AiResponseConfig
impl UnwindSafe for AiResponseConfig
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