pub struct SamplingResponse {
pub role: String,
pub content: McpContent,
pub model: String,
pub stop_reason: Option<String>,
}Expand description
The client’s answer to a SamplingRequest, returned by
McpContext::sample.
Fields§
§role: StringAlmost always "assistant", per spec.
content: McpContent§model: StringThe model the client actually used to generate this response, e.g.
"claude-3-sonnet-20240307".
stop_reason: Option<String>Why the model stopped, e.g. "endTurn", "maxTokens", "stopSequence".
None if the client didn’t report one.
Auto Trait Implementations§
impl Freeze for SamplingResponse
impl RefUnwindSafe for SamplingResponse
impl Send for SamplingResponse
impl Sync for SamplingResponse
impl Unpin for SamplingResponse
impl UnsafeUnpin for SamplingResponse
impl UnwindSafe for SamplingResponse
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