feat(macros): auto-generate get_info and default router (#785)
* feat(macros): auto-generate get_info and default router * docs: simplify examples and docs with new defaults * feat(macros): add tool_router(server_handler) to elide separate #[tool_handler] impl * docs: add Tools section to README and simplify calculator examples with server_handler
This commit is contained in:
parent
5891b45162
commit
be321a4abe
1 changed files with 742 additions and 233 deletions
|
|
@ -30,7 +30,7 @@ impl TestPromptServer {
|
|||
}
|
||||
}
|
||||
|
||||
#[prompt_handler]
|
||||
#[prompt_handler(router = self.prompt_router)]
|
||||
impl ServerHandler for TestPromptServer {}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
|
@ -80,7 +80,7 @@ impl<T: Send + Sync + 'static> GenericPromptServer<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[prompt_handler]
|
||||
#[prompt_handler(router = self.prompt_router)]
|
||||
impl<T: Send + Sync + 'static> ServerHandler for GenericPromptServer<T> {}
|
||||
|
||||
#[test]
|
||||
|
|
@ -148,7 +148,7 @@ mod nested {
|
|||
}
|
||||
}
|
||||
|
||||
#[prompt_handler]
|
||||
#[prompt_handler(router = self.prompt_router)]
|
||||
impl ServerHandler for NestedServer {}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Reference in a new issue