chore: add #[non_exhaustive] and mutation methods to improve compatibility (#715)
* chore: add #[non_exhaustive] to reduce backwards-incompatible changes going forward * fix: remove ProtocolVersion import * fix: add a few more with_ mutator methods --------- Co-authored-by: Alex Hancock <alexhancock@block.xyz>
This commit is contained in:
parent
79834b6211
commit
f63718d202
1 changed files with 1568 additions and 1110 deletions
|
|
@ -40,11 +40,11 @@ impl ClientHandler for SamplingDemoClient {
|
|||
let response_text =
|
||||
self.mock_llm_response(¶ms.messages, params.system_prompt.as_deref());
|
||||
|
||||
Ok(CreateMessageResult {
|
||||
message: SamplingMessage::assistant_text(response_text),
|
||||
model: "mock_llm".to_string(),
|
||||
stop_reason: Some(CreateMessageResult::STOP_REASON_END_TURN.to_string()),
|
||||
})
|
||||
Ok(CreateMessageResult::new(
|
||||
SamplingMessage::assistant_text(response_text),
|
||||
"mock_llm".to_string(),
|
||||
)
|
||||
.with_stop_reason(Some(CreateMessageResult::STOP_REASON_END_TURN.to_string())))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -98,14 +98,11 @@ async fn main() -> Result<()> {
|
|||
// Test the ask_llm tool
|
||||
tracing::info!("Testing ask_llm tool...");
|
||||
match client
|
||||
.call_tool(CallToolRequestParams {
|
||||
meta: None,
|
||||
name: "ask_llm".into(),
|
||||
arguments: Some(object!({
|
||||
.call_tool(
|
||||
CallToolRequestParams::new("ask_llm").with_arguments(object!({
|
||||
"question": "Hello world"
|
||||
})),
|
||||
task: None,
|
||||
})
|
||||
)
|
||||
.await
|
||||
{
|
||||
Ok(result) => tracing::info!("Ask LLM result: {result:#?}"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue