test(context): test context request handling and refactor for reusable client-server tests (#97)
This commit is contained in:
parent
36834f37d0
commit
910d3b39db
2 changed files with 902 additions and 140 deletions
|
|
@ -84,6 +84,7 @@ pub trait ClientHandler: Sized + Send + Sync + 'static {
|
|||
McpError::method_not_found::<CreateMessageRequestMethod>(),
|
||||
))
|
||||
}
|
||||
|
||||
fn list_roots(
|
||||
&self,
|
||||
context: RequestContext<RoleClient>,
|
||||
|
|
|
|||
|
|
@ -713,6 +713,16 @@ pub struct SamplingMessage {
|
|||
pub content: Content,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
||||
pub enum ContextInclusion {
|
||||
#[serde(rename = "allServers")]
|
||||
AllServers,
|
||||
#[serde(rename = "none")]
|
||||
None,
|
||||
#[serde(rename = "thisServer")]
|
||||
ThisServer,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct CreateMessageRequestParam {
|
||||
|
|
@ -722,7 +732,7 @@ pub struct CreateMessageRequestParam {
|
|||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub system_prompt: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub include_context: Option<String>,
|
||||
pub include_context: Option<ContextInclusion>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub temperature: Option<f32>,
|
||||
pub max_tokens: u32,
|
||||
|
|
|
|||
Loading…
Reference in a new issue