pub struct CreateMessageRequestParams {
pub meta: Option<Meta>,
pub task: Option<JsonObject>,
pub messages: Vec<SamplingMessage>,
pub model_preferences: Option<ModelPreferences>,
pub system_prompt: Option<String>,
pub include_context: Option<ContextInclusion>,
pub temperature: Option<f32>,
pub max_tokens: u32,
pub stop_sequences: Option<Vec<String>>,
pub metadata: Option<Value>,
}Expand description
Parameters for creating a message through LLM sampling.
This structure contains all the necessary information for a client to generate an LLM response, including conversation history, model preferences, and generation parameters.
This implements TaskAugmentedRequestParamsMeta as sampling requests can be
long-running and may benefit from task-based execution.
Fields§
§meta: Option<Meta>Protocol-level metadata for this request (SEP-1319)
task: Option<JsonObject>Task metadata for async task management (SEP-1319)
messages: Vec<SamplingMessage>The conversation history and current messages
model_preferences: Option<ModelPreferences>Preferences for model selection and behavior
system_prompt: Option<String>System prompt to guide the model’s behavior
include_context: Option<ContextInclusion>How much context to include from MCP servers
temperature: Option<f32>Temperature for controlling randomness (0.0 to 1.0)
max_tokens: u32Maximum number of tokens to generate
stop_sequences: Option<Vec<String>>Sequences that should stop generation
metadata: Option<Value>Additional metadata for the request
Trait Implementations§
Source§impl Clone for CreateMessageRequestParams
impl Clone for CreateMessageRequestParams
Source§fn clone(&self) -> CreateMessageRequestParams
fn clone(&self) -> CreateMessageRequestParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateMessageRequestParams
impl Debug for CreateMessageRequestParams
Source§impl<'de> Deserialize<'de> for CreateMessageRequestParams
impl<'de> Deserialize<'de> for CreateMessageRequestParams
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>,
Source§impl JsonSchema for CreateMessageRequestParams
impl JsonSchema for CreateMessageRequestParams
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl RequestParamsMeta for CreateMessageRequestParams
impl RequestParamsMeta for CreateMessageRequestParams
Source§fn progress_token(&self) -> Option<ProgressToken>
fn progress_token(&self) -> Option<ProgressToken>
Source§fn set_progress_token(&mut self, token: ProgressToken)
fn set_progress_token(&mut self, token: ProgressToken)
Source§impl TaskAugmentedRequestParamsMeta for CreateMessageRequestParams
impl TaskAugmentedRequestParamsMeta for CreateMessageRequestParams
Source§fn task(&self) -> Option<&JsonObject>
fn task(&self) -> Option<&JsonObject>
Source§fn task_mut(&mut self) -> &mut Option<JsonObject>
fn task_mut(&mut self) -> &mut Option<JsonObject>
Source§fn set_task(&mut self, task: JsonObject)
fn set_task(&mut self, task: JsonObject)
impl StructuralPartialEq for CreateMessageRequestParams
Auto Trait Implementations§
impl Freeze for CreateMessageRequestParams
impl RefUnwindSafe for CreateMessageRequestParams
impl Send for CreateMessageRequestParams
impl Sync for CreateMessageRequestParams
impl Unpin for CreateMessageRequestParams
impl UnwindSafe for CreateMessageRequestParams
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§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