pub struct PromptRequest {
pub context: RequestContext,
pub arguments: HashMap<String, String>,
}Expand description
Request type for prompt middleware.
Contains the request context and prompt arguments, allowing middleware to access and modify the request before it reaches the prompt handler.
Fields§
§context: RequestContextThe request context with progress reporting, cancellation, etc.
arguments: HashMap<String, String>The prompt arguments (name -> value)
Implementations§
Source§impl PromptRequest
impl PromptRequest
Sourcepub fn new(context: RequestContext, arguments: HashMap<String, String>) -> Self
pub fn new(context: RequestContext, arguments: HashMap<String, String>) -> Self
Create a new prompt request with the given context and arguments.
Sourcepub fn with_arguments(arguments: HashMap<String, String>) -> Self
pub fn with_arguments(arguments: HashMap<String, String>) -> Self
Create a prompt request with a default context (for testing or simple use cases).
Trait Implementations§
Source§impl Clone for PromptRequest
impl Clone for PromptRequest
Source§fn clone(&self) -> PromptRequest
fn clone(&self) -> PromptRequest
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 PromptRequest
impl Debug for PromptRequest
Source§impl<S> Service<PromptRequest> for PromptCatchError<S>where
S: Service<PromptRequest, Response = GetPromptResult> + Clone + Send + 'static,
S::Error: Display + Send,
S::Future: Send,
impl<S> Service<PromptRequest> for PromptCatchError<S>where
S: Service<PromptRequest, Response = GetPromptResult> + Clone + Send + 'static,
S::Error: Display + Send,
S::Future: Send,
Source§type Response = GetPromptResult
type Response = GetPromptResult
Responses given by the service.
Source§type Error = Infallible
type Error = Infallible
Errors produced by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Infallible>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Infallible>> + Send>>
The future response value.
Source§impl<F, Fut> Service<PromptRequest> for PromptContextHandlerService<F>
impl<F, Fut> Service<PromptRequest> for PromptContextHandlerService<F>
Source§type Response = GetPromptResult
type Response = GetPromptResult
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send>>
The future response value.
Source§impl<F, Fut> Service<PromptRequest> for PromptHandlerService<F>
impl<F, Fut> Service<PromptRequest> for PromptHandlerService<F>
Source§type Response = GetPromptResult
type Response = GetPromptResult
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<GetPromptResult, Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl Freeze for PromptRequest
impl !RefUnwindSafe for PromptRequest
impl Send for PromptRequest
impl Sync for PromptRequest
impl Unpin for PromptRequest
impl !UnwindSafe for PromptRequest
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