From 1a916b3fa80db02a515d69308b29530a500296be Mon Sep 17 00:00:00 2001 From: codecustard Date: Sat, 18 Nov 2023 05:28:07 -0800 Subject: [PATCH] function calls --- Runtime/DataTypes.cs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Runtime/DataTypes.cs b/Runtime/DataTypes.cs index 4d7c670..58a4e06 100644 --- a/Runtime/DataTypes.cs +++ b/Runtime/DataTypes.cs @@ -94,6 +94,7 @@ public sealed class CreateChatCompletionRequest public float? FrequencyPenalty { get; set; } = 0; public Dictionary LogitBias { get; set; } public string User { get; set; } + public List Tools { get; set; } } public struct CreateChatCompletionResponse : IResponse @@ -107,6 +108,41 @@ public struct CreateChatCompletionResponse : IResponse public List Choices { get; set; } public Usage Usage { get; set; } } + + public class Tool + { + public string Type { get; set; } + public ToolFunction Function { get; set; } + } + + public class ToolFunction + { + public string Name { get; set; } = string.Empty; + public string Description { get; set; } + public Parameters? Parameters { get; set; } + public string? Arguments { get; set; } + + } + + public struct ToolCall + { + public string Id { get; set; } + public string Type { get; set; } + public ToolFunction Function { get; set; } + } + + public class Parameters + { + public string Type { get; set; } = "object"; + public Dictionary Properties { get; set; } + public List Required { get; set; } + } + + public class Property + { + public string Type { get; set; } + public string Description { get; set; } + } public struct ChatChoice { @@ -120,6 +156,9 @@ public struct ChatMessage { public string Role { get; set; } public string Content { get; set; } + public string? Name { get; set; } + public List ToolCalls { get; set; } + public string? ToolCallId { get; set; } } #endregion