forked from weaviate/csharp-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerativeConfig.cs
More file actions
175 lines (144 loc) · 5.28 KB
/
GenerativeConfig.cs
File metadata and controls
175 lines (144 loc) · 5.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
using System.Text.Json.Serialization;
namespace Weaviate.Client.Models;
public interface IGenerativeConfig
{
[JsonIgnore]
string Type { get; }
}
public static class GenerativeConfig
{
public record Custom : IGenerativeConfig
{
public required string Type { get; set; }
public dynamic? Config { get; set; } = new { };
}
public abstract record OpenAIBase : IGenerativeConfig
{
public string? BaseURL { get; set; }
public int? FrequencyPenalty { get; set; }
public int? MaxTokens { get; set; }
public int? PresencePenalty { get; set; }
public double? Temperature { get; set; }
public double? TopP { get; set; }
public abstract string Type { get; }
}
public record AWS : IGenerativeConfig
{
public const string TypeValue = "generative-aws";
public string Type => TypeValue;
public string Region { get; set; } = string.Empty;
public string Service { get; set; } = string.Empty;
public string? Model { get; set; }
public string? Endpoint { get; set; }
}
public record Anthropic : IGenerativeConfig
{
public const string TypeValue = "generative-anthropic";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public int? MaxTokens { get; set; }
public string? Model { get; set; }
public string[]? StopSequences { get; set; }
public double? Temperature { get; set; }
public int? TopK { get; set; }
public double? TopP { get; set; }
}
public record Anyscale : IGenerativeConfig
{
public const string TypeValue = "generative-anyscale";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public string? Model { get; set; }
public double? Temperature { get; set; }
}
public record Cohere : IGenerativeConfig
{
public const string TypeValue = "generative-cohere";
public string Type => TypeValue;
public int? K { get; set; }
public string? Model { get; set; }
public int? MaxTokens { get; set; }
public string? ReturnLikelihoods { get; set; }
public string[]? StopSequences { get; set; }
public double? Temperature { get; set; }
}
public record Databricks : IGenerativeConfig
{
public const string TypeValue = "generative-databricks";
public string Type => TypeValue;
public string Endpoint { get; set; } = string.Empty;
public int? MaxTokens { get; set; }
public double? Temperature { get; set; }
public int? TopK { get; set; }
public double? TopP { get; set; }
}
public record FriendliAI : IGenerativeConfig
{
public const string TypeValue = "generative-friendliai";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public int? MaxTokens { get; set; }
public string? Model { get; set; }
public double? Temperature { get; set; }
}
public record Mistral : IGenerativeConfig
{
public const string TypeValue = "generative-mistral";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public int? MaxTokens { get; set; }
public string? Model { get; set; }
public double? Temperature { get; set; }
}
public record Nvidia : IGenerativeConfig
{
public const string TypeValue = "generative-nvidia";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public int? MaxTokens { get; set; }
public string? Model { get; set; }
public double? Temperature { get; set; }
}
public record Ollama : IGenerativeConfig
{
public const string TypeValue = "generative-ollama";
public string Type => TypeValue;
public string? ApiEndpoint { get; set; }
public string? Model { get; set; }
}
public record OpenAI : OpenAIBase
{
public const string TypeValue = "generative-openai";
public override string Type => TypeValue;
public string? Model { get; set; }
}
public record AzureOpenAI : OpenAIBase
{
public const string TypeValue = "generative-azure-openai";
public override string Type => TypeValue;
public string ResourceName { get; set; } = string.Empty;
public string DeploymentId { get; set; } = string.Empty;
}
public record Google : IGenerativeConfig
{
public const string TypeValue = "generative-google";
public string Type => TypeValue;
public string? ApiEndpoint { get; set; }
public int? MaxOutputTokens { get; set; }
public string? ModelId { get; set; }
public string? ProjectId { get; set; }
public double? Temperature { get; set; }
public int? TopK { get; set; }
public double? TopP { get; set; }
}
public record XAI : IGenerativeConfig
{
public const string TypeValue = "generative-xai";
public string Type => TypeValue;
public string? BaseURL { get; set; }
public int? MaxTokens { get; set; }
public string? Model { get; set; }
public double? Temperature { get; set; }
public double? TopP { get; set; }
}
}