File tree Expand file tree Collapse file tree 5 files changed +1779
-448
lines changed
Expand file tree Collapse file tree 5 files changed +1779
-448
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,12 @@ prompt for the LLM in the next step.
1111
1212** Here's what you'll do:**
1313
14+ - When the create_entry tool is called, call the ` suggestTagsSampling ` function
15+ with the agent and the createdEntry.id.
16+ - We don't want to wait for the sampling function to finish so instead of "await"
17+ use "void" which effectively ignores the promise.
18+ - First check if the client supports sampling. If it does, proceed with the
19+ sampling request.
1420- Implement a function that sends a sampling request to the client using
1521 ` agent.server.server.createMessage ` (the ` server.server ` thing is funny, but
1622 our MCP server manages an internal server and that's what we're accessing).
@@ -22,10 +28,7 @@ prompt for the LLM in the next step.
2228
2329And don't forget to call it when the user creates a new journal entry!
2430
25- > ** Note:** Before making a sampling request, you should check whether the
26- > client supports sampling. You can do this with
27- > ` agent.server.server.getClientCapabilities() ` . If sampling is not supported,
28- > you should skip the sampling request. For example:
31+ Here's an example of how to check if the client supports sampling:
2932
3033``` ts
3134const clientCapabilities = agent .server .server .getClientCapabilities ()
You can’t perform that action at this time.
0 commit comments