Package io.quarkiverse.mcp.server
Interface SamplingRequest
- All Known Implementing Classes:
- SamplingRequestImpl
public interface SamplingRequest
A request from the server to sample an LLM.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic enumA request to include context from one or more MCP servers.
- 
Method SummaryModifier and TypeMethodDescriptionlongmessages()metadata()io.smallrye.mutiny.Uni<SamplingResponse>send()Send a message to the client.default SamplingResponseSend a message to the client and wait for the result.
- 
Method Details- 
maxTokenslong maxTokens()- Returns:
- the maximum number of tokens to sample
 
- 
messagesList<SamplingMessage> messages()- Returns:
- the sampling messages (not null)
 
- 
stopSequences- Returns:
- the stop sequences
 
- 
systemPromptString systemPrompt()- Returns:
- the system prompt the server wants to use for sampling
 
- 
temperatureBigDecimal temperature()- Returns:
- the temperature
 
- 
includeContextSamplingRequest.IncludeContext includeContext()- Returns:
- the request to include the context
 
- 
modelPreferencesModelPreferences modelPreferences()- Returns:
- the model preferences
 
- 
metadata- Returns:
- the optional metadata
 
- 
sendio.smallrye.mutiny.Uni<SamplingResponse> send()Send a message to the client.If the client does not respond before the timeout expires then the returned Unifails withTimeoutException. The default timeout is configured with thequarkus.mcp.server.sampling.default-timeoutconfig property.- Returns:
- a new Unithat completes with aSamplingResponse
 
- 
sendAndAwaitSend a message to the client and wait for the result.Note that this method will block until the client sends the response. If the client does not respond before the timeout expires then a TimeoutExceptionis thrown. The default timeout is configured with thequarkus.mcp.server.sampling.default-timeoutconfig property.- Returns:
- the response
 
 
-