mirror of
https://github.com/charmbracelet/crush.git
synced 2025-08-02 05:20:46 +03:00
* chore(deps): update mcp-go Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> * fix: vendoring Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com> --------- Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
21 lines
796 B
Go
21 lines
796 B
Go
package client
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/mark3labs/mcp-go/mcp"
|
|
)
|
|
|
|
// SamplingHandler defines the interface for handling sampling requests from servers.
|
|
// Clients can implement this interface to provide LLM sampling capabilities to servers.
|
|
type SamplingHandler interface {
|
|
// CreateMessage handles a sampling request from the server and returns the generated message.
|
|
// The implementation should:
|
|
// 1. Validate the request parameters
|
|
// 2. Optionally prompt the user for approval (human-in-the-loop)
|
|
// 3. Select an appropriate model based on preferences
|
|
// 4. Generate the response using the selected model
|
|
// 5. Return the result with model information and stop reason
|
|
CreateMessage(ctx context.Context, request mcp.CreateMessageRequest) (*mcp.CreateMessageResult, error)
|
|
}
|