-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathShellCallContent.cs
More file actions
43 lines (37 loc) · 1.37 KB
/
ShellCallContent.cs
File metadata and controls
43 lines (37 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using System.Diagnostics;
using System.Text.Json.Serialization;
using Microsoft.Extensions.AI;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI;
/// <summary>
/// Represents a shell command execution request.
/// </summary>
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public sealed class ShellCallContent : AIContent
{
/// <summary>
/// Initializes a new instance of the <see cref="ShellCallContent"/> class.
/// </summary>
/// <param name="callId">The unique identifier for this shell call.</param>
/// <param name="commands">The commands to execute.</param>
[JsonConstructor]
public ShellCallContent(string callId, IReadOnlyList<string> commands)
{
this.CallId = Throw.IfNull(callId);
this.Commands = Throw.IfNull(commands);
}
/// <summary>
/// Gets the unique identifier for this shell call.
/// </summary>
public string CallId { get; }
/// <summary>
/// Gets the commands to execute.
/// </summary>
public IReadOnlyList<string> Commands { get; }
/// <summary>Gets a string representing this instance to display in the debugger.</summary>
[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private string DebuggerDisplay =>
$"ShellCall = {this.CallId}, Commands = {this.Commands.Count}";
}