fix: example clients_everything_stdio (#770)
* fix: example clients_everything_stdio * Apply suggestion from @DaleSeo Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com> --------- Co-authored-by: Alex Hancock <alexhancock@block.xyz> Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
This commit is contained in:
parent
cf6988ac7c
commit
012210baae
1 changed files with 8 additions and 6 deletions
|
|
@ -59,7 +59,9 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
// Read resource
|
// Read resource
|
||||||
let resource = client
|
let resource = client
|
||||||
.read_resource(ReadResourceRequestParams::new("test://static/resource/3"))
|
.read_resource(ReadResourceRequestParams::new(
|
||||||
|
"demo://resource/static/document/architecture.md",
|
||||||
|
))
|
||||||
.await?;
|
.await?;
|
||||||
tracing::info!("Resource: {resource:#?}");
|
tracing::info!("Resource: {resource:#?}");
|
||||||
|
|
||||||
|
|
@ -69,18 +71,18 @@ async fn main() -> Result<()> {
|
||||||
|
|
||||||
// Get simple prompt
|
// Get simple prompt
|
||||||
let prompt = client
|
let prompt = client
|
||||||
.get_prompt(GetPromptRequestParams::new("simple_prompt"))
|
.get_prompt(GetPromptRequestParams::new("simple-prompt"))
|
||||||
.await?;
|
.await?;
|
||||||
tracing::info!("Prompt - simple: {prompt:#?}");
|
tracing::info!("Prompt - simple: {prompt:#?}");
|
||||||
|
|
||||||
// Get complex prompt (returns text & image)
|
// Get prompt with arguments
|
||||||
let prompt = client
|
let prompt = client
|
||||||
.get_prompt(
|
.get_prompt(
|
||||||
GetPromptRequestParams::new("complex_prompt")
|
GetPromptRequestParams::new("args-prompt")
|
||||||
.with_arguments(object!({ "temperature": "0.5", "style": "formal" })),
|
.with_arguments(object!({ "city": "Dallas", "state": "Texas" })),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
tracing::info!("Prompt - complex: {prompt:#?}");
|
tracing::info!("Prompt - args: {prompt:#?}");
|
||||||
|
|
||||||
// List resource templates
|
// List resource templates
|
||||||
let resource_templates = client.list_all_resource_templates().await?;
|
let resource_templates = client.list_all_resource_templates().await?;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue