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,
}Will be extracted to mockforge-intelligence crate
Expand description
Configuration for AI-assisted response generation per endpoint
This is parsed from the x-mockforge-ai OpenAPI extension
Fieldsยง
ยงenabled: boolWill be extracted to mockforge-intelligence crate
Whether AI response generation is enabled
mode: AiResponseModeWill be extracted to mockforge-intelligence crate
Response generation mode
prompt: Option<String>Will be extracted to mockforge-intelligence crate
Prompt template for LLM generation Supports template variables: {{body.field}}, {{path.param}}, {{query.param}}, {{headers.name}}
context: Option<String>Will be extracted to mockforge-intelligence crate
Additional context for generation
temperature: f32Will be extracted to mockforge-intelligence crate
Temperature for LLM (0.0 to 2.0)
max_tokens: usizeWill be extracted to mockforge-intelligence crate
Max tokens for LLM response
schema: Option<Value>Will be extracted to mockforge-intelligence crate
Schema that the response should conform to (JSON Schema)
cache_enabled: boolWill be extracted to mockforge-intelligence crate
Enable caching for identical requests
Implementationsยง
Sourceยงimpl AiResponseConfig
impl AiResponseConfig
Sourcepub fn new(enabled: bool, mode: AiResponseMode, prompt: String) -> Self
๐Deprecated: Will be extracted to mockforge-intelligence crate
pub fn new(enabled: bool, mode: AiResponseMode, prompt: String) -> Self
Will be extracted to mockforge-intelligence crate
Create a new AI response configuration
Trait Implementationsยง
Sourceยงimpl Clone for AiResponseConfig
impl Clone for AiResponseConfig
Sourceยงfn clone(&self) -> AiResponseConfig
fn clone(&self) -> AiResponseConfig
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Auto Trait Implementationsยง
impl Freeze for AiResponseConfig
impl RefUnwindSafe for AiResponseConfig
impl Send for AiResponseConfig
impl Sync for AiResponseConfig
impl Unpin for AiResponseConfig
impl UnsafeUnpin 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
Sourceยงimpl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Sourceยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more