public static class McpServerFeatures.AsyncPromptSpecification
extends java.lang.Object
Example prompt specification:
new McpServerFeatures.AsyncPromptSpecification(
new Prompt("analyze", "Code analysis template"),
(exchange, request) -> {
String code = request.getArguments().get("code");
return Mono.just(new GetPromptResult(
"Analyze this code:\n\n" + code + "\n\nProvide feedback on:"));
})
formatted templates. The function's first argument is an
McpAsyncServerExchange
upon which the server can interact with the
connected client. The second arguments is a
McpSchema.GetPromptRequest
.构造器和说明 |
---|
AsyncPromptSpecification() |