-
Notifications
You must be signed in to change notification settings - Fork 358
Expand file tree
/
Copy pathsampling.ts
More file actions
executable file
·34 lines (31 loc) · 1021 Bytes
/
sampling.ts
File metadata and controls
executable file
·34 lines (31 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* Sampling module for the Browserbase MCP server
* Implements sampling capability to request LLM completions from clients
* Docs: https://modelcontextprotocol.io/docs/concepts/sampling
*/
/**
* Sampling capability configuration
* This indicates that the server can request LLM completions
*/
export const SAMPLING_CAPABILITY = {};
/**
* Note: Sampling in MCP is initiated BY the server TO the client.
* The server sends sampling/createMessage requests to ask the client
* for LLM completions. This is useful for intelligent browser automation
* where the server needs AI assistance to analyze pages and make decisions.
*
* Currently, sampling support depends on the MCP client implementation.
* Not all clients support sampling yet. (ie claude desktop)
*/
/**
* Type definitions for sampling messages
*/
export type SamplingMessage = {
role: "user" | "assistant";
content: {
type: "text" | "image";
text?: string;
data?: string; // base64 for images
mimeType?: string;
};
};