-
Notifications
You must be signed in to change notification settings - Fork 857
Expand file tree
/
Copy pathHostedShellTool.cs
More file actions
38 lines (31 loc) · 1.62 KB
/
HostedShellTool.cs
File metadata and controls
38 lines (31 loc) · 1.62 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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Shared.DiagnosticIds;
namespace Microsoft.Extensions.AI;
/// <summary>Represents a hosted tool that can be specified to an AI service to enable it to execute shell commands.</summary>
/// <remarks>
/// This tool does not itself implement shell command execution. It is a marker that can be used to inform a service
/// that the service is allowed to execute shell commands if the service is capable of doing so.
/// </remarks>
[Experimental(DiagnosticIds.Experiments.AIShell, UrlFormat = DiagnosticIds.UrlFormat)]
public class HostedShellTool : AITool
{
/// <summary>Any additional properties associated with the tool.</summary>
private IReadOnlyDictionary<string, object?>? _additionalProperties;
/// <summary>Initializes a new instance of the <see cref="HostedShellTool"/> class.</summary>
public HostedShellTool()
{
}
/// <summary>Initializes a new instance of the <see cref="HostedShellTool"/> class.</summary>
/// <param name="additionalProperties">Any additional properties associated with the tool.</param>
public HostedShellTool(IReadOnlyDictionary<string, object?>? additionalProperties)
{
_additionalProperties = additionalProperties;
}
/// <inheritdoc />
public override string Name => "shell";
/// <inheritdoc />
public override IReadOnlyDictionary<string, object?> AdditionalProperties => _additionalProperties ?? base.AdditionalProperties;
}