pub struct ResponseGenerator;
Expand description
Response generator for creating mock responses
Implementations§
Source§impl ResponseGenerator
impl ResponseGenerator
Sourcepub async fn generate_ai_response(
ai_config: &AiResponseConfig,
context: &RequestContext,
generator: Option<&dyn AiGenerator>,
) -> Result<Value>
pub async fn generate_ai_response( ai_config: &AiResponseConfig, context: &RequestContext, generator: Option<&dyn AiGenerator>, ) -> Result<Value>
Generate an AI-assisted response using LLM
This method generates a dynamic response based on request context using the configured LLM provider (OpenAI, Anthropic, etc.)
§Arguments
ai_config
- The AI response configurationcontext
- The request context for prompt expansiongenerator
- Optional AI generator implementation (if None, returns placeholder)
§Returns
A JSON value containing the generated response
Sourcepub fn generate_response(
spec: &OpenApiSpec,
operation: &Operation,
status_code: u16,
content_type: Option<&str>,
) -> Result<Value>
pub fn generate_response( spec: &OpenApiSpec, operation: &Operation, status_code: u16, content_type: Option<&str>, ) -> Result<Value>
Generate a mock response for an operation and status code
Sourcepub fn generate_response_with_expansion(
spec: &OpenApiSpec,
operation: &Operation,
status_code: u16,
content_type: Option<&str>,
expand_tokens: bool,
) -> Result<Value>
pub fn generate_response_with_expansion( spec: &OpenApiSpec, operation: &Operation, status_code: u16, content_type: Option<&str>, expand_tokens: bool, ) -> Result<Value>
Generate a mock response for an operation and status code with token expansion control
Auto Trait Implementations§
impl Freeze for ResponseGenerator
impl RefUnwindSafe for ResponseGenerator
impl Send for ResponseGenerator
impl Sync for ResponseGenerator
impl Unpin for ResponseGenerator
impl UnwindSafe for ResponseGenerator
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