Add context to complete requests (#488)
This commit is contained in:
parent
c560f47ee6
commit
46d25b7558
2 changed files with 26 additions and 1 deletions
19
src/ModelContextProtocol.Core/Protocol/CompleteContext.cs
Normal file
19
src/ModelContextProtocol.Core/Protocol/CompleteContext.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace ModelContextProtocol.Protocol;
|
||||
|
||||
/// <summary>
|
||||
/// Represents additional context information for completion requests.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This context provides information that helps the server generate more relevant
|
||||
/// completion suggestions, such as previously resolved variables in a template.
|
||||
/// </remarks>
|
||||
public class CompleteContext
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets previously-resolved variables in a URI template or prompt.
|
||||
/// </summary>
|
||||
[JsonPropertyName("arguments")]
|
||||
public IDictionary<string, string>? Arguments { get; init; }
|
||||
}
|
||||
|
|
@ -30,5 +30,11 @@ public class CompleteRequestParams : RequestParams
|
|||
/// and the current partial input.
|
||||
/// </summary>
|
||||
[JsonPropertyName("argument")]
|
||||
public required Argument Argument { get; init; }
|
||||
public required Argument Argument { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets additional, optional context for completions.
|
||||
/// </summary>
|
||||
[JsonPropertyName("context")]
|
||||
public CompleteContext? Context { get; init; }
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue