From 691ffaafb735c670d3c49b382493283cff5b8568 Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Sun, 30 Jun 2024 12:00:37 -0500 Subject: [PATCH] feat: add class to represent a callable function --- .../Models/AnthropicFunction.cs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/AnthropicClient/Models/AnthropicFunction.cs diff --git a/src/AnthropicClient/Models/AnthropicFunction.cs b/src/AnthropicClient/Models/AnthropicFunction.cs new file mode 100644 index 0000000..c3143a3 --- /dev/null +++ b/src/AnthropicClient/Models/AnthropicFunction.cs @@ -0,0 +1,30 @@ +using System.Reflection; + +namespace AnthropicClient.Models; + +/// +/// Represents a function that can be provided as a tool. +/// +public class AnthropicFunction +{ + /// + /// Gets the method of the function. + /// + public MethodInfo Method { get; } + + /// + /// Gets the instance on which the method is invoked. + /// + public object? Instance { get; } + + internal AnthropicFunction(MethodInfo method) + { + Method = method; + } + + internal AnthropicFunction(MethodInfo method, object? instance) + { + Method = method; + Instance = instance; + } +} \ No newline at end of file