Support onprogress callbacks
This commit is contained in:
parent
a9b6ae6679
commit
12c92341b4
1 changed files with 46 additions and 11 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Protocol } from "../shared/protocol.js";
|
||||
import { ProgressCallback, Protocol } from "../shared/protocol.js";
|
||||
import {
|
||||
ClientCapabilities,
|
||||
Implementation,
|
||||
|
|
@ -143,10 +143,14 @@ export class Server<
|
|||
return this.request({ method: "ping" }, EmptyResultSchema);
|
||||
}
|
||||
|
||||
async createMessage(params: CreateMessageRequest["params"]) {
|
||||
async createMessage(
|
||||
params: CreateMessageRequest["params"],
|
||||
onprogress?: ProgressCallback,
|
||||
) {
|
||||
return this.request(
|
||||
{ method: "sampling/createMessage", params },
|
||||
CreateMessageResultSchema,
|
||||
onprogress,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue