Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function calls #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions Runtime/DataTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public sealed class CreateChatCompletionRequest
public float? FrequencyPenalty { get; set; } = 0;
public Dictionary<string, string> LogitBias { get; set; }
public string User { get; set; }
public List<Tool> Tools { get; set; }
}

public struct CreateChatCompletionResponse : IResponse
Expand All @@ -107,6 +108,41 @@ public struct CreateChatCompletionResponse : IResponse
public List<ChatChoice> 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<string, Property> Properties { get; set; }
public List<string> Required { get; set; }
}

public class Property
{
public string Type { get; set; }
public string Description { get; set; }
}

public struct ChatChoice
{
Expand All @@ -120,6 +156,9 @@ public struct ChatMessage
{
public string Role { get; set; }
public string Content { get; set; }
public string? Name { get; set; }
public List<ToolCall> ToolCalls { get; set; }
public string? ToolCallId { get; set; }
}

#endregion
Expand Down