Align sampling specification XML docs with spec revision d165cd6 (#1293)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com>
This commit is contained in:
Copilot 2026-02-17 16:02:14 -05:00 • committed by GitHub
commit 43a302ffa9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 26 additions and 1 deletions

View file

@ -33,8 +33,13 @@ public sealed class CreateMessageRequestParams : RequestParams
/// Gets or sets the maximum number of tokens to generate in the LLM response, as requested by the server.
/// </summary>
/// <remarks>
/// <para>
/// A token is generally a word or part of a word in the text. Setting this value helps control
/// response length and computation time. The client can choose to sample fewer tokens than requested.
/// </para>
/// <para>
/// The client must respect the <see cref="MaxTokens"/> parameter.
/// </para>
/// </remarks>
[JsonPropertyName("maxTokens")]
public required int MaxTokens { get; set; }
@ -42,6 +47,9 @@ public sealed class CreateMessageRequestParams : RequestParams
/// <summary>
/// Gets or sets the messages requested by the server to be included in the prompt.
/// </summary>
/// <remarks>
/// The list of messages in a sampling request should not be retained between separate requests.
/// </remarks>
[JsonPropertyName("messages")]
public IList<SamplingMessage> Messages { get; set; } = [];
@ -49,9 +57,14 @@ public sealed class CreateMessageRequestParams : RequestParams
/// Gets or sets optional metadata to pass through to the LLM provider.
/// </summary>
/// <remarks>
/// <para>
/// The format of this metadata is provider-specific and can include model-specific settings or
/// configuration that isn't covered by standard parameters. This allows for passing custom parameters
/// that are specific to certain AI models or providers.
/// </para>
/// <para>
/// The client may modify or ignore metadata.
/// </para>
/// </remarks>
[JsonPropertyName("metadata")]
public JsonElement? Metadata { get; set; }
@ -90,6 +103,9 @@ public sealed class CreateMessageRequestParams : RequestParams
/// sequence exactly matches one of the provided sequences. Common uses include ending markers like "END", punctuation
/// like ".", or special delimiter sequences like "###".
/// </para>
/// <para>
/// The client may modify or ignore stop sequences.
/// </para>
/// </remarks>
[JsonPropertyName("stopSequences")]
public IList<string>? StopSequences { get; set; }
@ -106,6 +122,15 @@ public sealed class CreateMessageRequestParams : RequestParams
/// <summary>
/// Gets or sets the temperature to use for sampling, as requested by the server.
/// </summary>
/// <remarks>
/// <para>
/// Temperature controls randomness in model responses. Higher values produce higher randomness,
/// and lower values produce more stable output. The valid range depends on the model provider.
/// </para>
/// <para>
/// The client may modify or ignore this value.
/// </para>
/// </remarks>
[JsonPropertyName("temperature")]
public float? Temperature { get; set; }

View file

@ -41,7 +41,7 @@ public sealed class CreateMessageResult : Result
/// <remarks>
/// Standard values include:
/// <list type="bullet">
/// <item><term>endTurn</term><description>The model naturally completed its response.</description></item>
/// <item><term>endTurn</term><description>The participant is yielding the conversation to the other party.</description></item>
/// <item><term>maxTokens</term><description>The response was truncated due to reaching token limits.</description></item>
/// <item><term>stopSequence</term><description>A specific stop sequence was encountered during generation.</description></item>
/// <item><term>toolUse</term><description>The model wants to use one or more tools.</description></item>