Add ITool + ToolRegistry + GetCurrentTimeTool
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
using System.Text.Json;
|
||||
|
||||
namespace backend.Tools;
|
||||
|
||||
public record DeviceContext(Guid DeviceId, Guid ConversationId, IDeviceChannel Channel);
|
||||
public record ToolInvocation(string CallId, JsonElement Arguments);
|
||||
public record ToolResult(JsonElement Output);
|
||||
|
||||
public interface ITool
|
||||
{
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
JsonElement ParameterSchema { get; }
|
||||
bool RunsDuringResponse { get; }
|
||||
Task<ToolResult> ExecuteAsync(
|
||||
ToolInvocation invocation,
|
||||
DeviceContext device,
|
||||
CancellationToken ct);
|
||||
}
|
||||
Reference in New Issue
Block a user