Audit protocol types (#892)
This commit is contained in:
parent
66c084c795
commit
121929da36
2 changed files with 262 additions and 168 deletions
|
|
@ -153,7 +153,7 @@ public abstract partial class McpServer : McpSession, IMcpServer
|
|||
var result = await SampleAsync(new()
|
||||
{
|
||||
Messages = samplingMessages,
|
||||
MaxTokens = options?.MaxOutputTokens,
|
||||
MaxTokens = options?.MaxOutputTokens ?? ServerOptions.MaxSamplingOutputTokens,
|
||||
StopSequences = options?.StopSequences?.ToArray(),
|
||||
SystemPrompt = systemPrompt?.ToString(),
|
||||
Temperature = options?.Temperature,
|
||||
|
|
|
|||
|
|
@ -152,4 +152,18 @@ public sealed class McpServerOptions
|
|||
/// </para>
|
||||
/// </remarks>
|
||||
public McpServerPrimitiveCollection<McpServerPrompt>? PromptCollection { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default maximum number of tokens to use for sampling requests when not explicitly specified.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// This value is used in <see cref="McpServer.SampleAsync(IEnumerable{Microsoft.Extensions.AI.ChatMessage}, Microsoft.Extensions.AI.ChatOptions?, CancellationToken)"/>
|
||||
/// when <see cref="Microsoft.Extensions.AI.ChatOptions.MaxOutputTokens"/> is not set in the request options.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// The default value is 1000 tokens.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
public int MaxSamplingOutputTokens { get; set; } = 1000;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue