|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Text; |
| 4 | + |
| 5 | +namespace LLama.Types |
| 6 | +{ |
| 7 | + public enum ChatRole |
| 8 | + { |
| 9 | + Human, |
| 10 | + Assistant |
| 11 | + } |
| 12 | + public record EmbeddingUsage(int PromptTokens, int TotalTokens); |
| 13 | + |
| 14 | + public record EmbeddingData(int Index, string Object, float[] Embedding); |
| 15 | + |
| 16 | + public record Embedding(string Object, string Model, EmbeddingData[] Data, EmbeddingUsage Usage); |
| 17 | + |
| 18 | + public record CompletionLogprobs(int[] TextOffset, float[] TokenLogProbs, string[] Tokens, Dictionary<string, float>[] TopLogprobs); |
| 19 | + |
| 20 | + public record CompletionChoice(string Text, int Index, CompletionLogprobs? Logprobs, string? FinishReason); |
| 21 | + |
| 22 | + public record CompletionUsage(int PromptTokens, int CompletionTokens, int TotalTokens); |
| 23 | + |
| 24 | + public record CompletionChunk(string Id, string Object, int Created, string Model, CompletionChoice[] Choices); |
| 25 | + |
| 26 | + public record Completion(string Id, string Object, int Created, string Model, CompletionChoice[] Choices, CompletionUsage Usage); |
| 27 | + |
| 28 | + public record ChatCompletionMessage(ChatRole Role, string Content, string? Name = null); |
| 29 | + |
| 30 | + public record ChatCompletionChoice(int Index, ChatCompletionMessage Message, string? FinishReason); |
| 31 | + |
| 32 | + public record ChatCompletion(string Id, string Object, int Created, string Model, ChatCompletionChoice[] Choices, CompletionUsage Usage); |
| 33 | + |
| 34 | + public record ChatCompletionChunkDelta(string? Role, string? Content); |
| 35 | + |
| 36 | + public record ChatCompletionChunkChoice(int Index, ChatCompletionChunkDelta Delta, string? FinishReason); |
| 37 | + |
| 38 | + public record ChatCompletionChunk(string Id, string Model, string Object, int Created, ChatCompletionChunkChoice[] Choices); |
| 39 | + |
| 40 | + public record ChatMessageRecord(ChatCompletionMessage Message, DateTime Time); |
| 41 | +} |
0 commit comments