Skip to content

Commit 938d445

Browse files
committed
Mark internal methods with comments
1 parent de4d9c3 commit 938d445

File tree

8 files changed

+42
-1
lines changed

8 files changed

+42
-1
lines changed

vertexai/src/Candidate.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ private static FinishReason ParseFinishReason(string str) {
121121
};
122122
}
123123

124+
/// <summary>
125+
/// Intended for internal use only.
126+
/// </summary>
124127
internal static Candidate FromJson(Dictionary<string, object> jsonDict) {
125128
return new Candidate(
126129
jsonDict.ParseObject("content", ModelContent.FromJson, defaultValue: new ModelContent("model")),

vertexai/src/Citation.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ private CitationMetadata(List<Citation> citations) {
3838
_citations = new ReadOnlyCollection<Citation>(citations ?? new List<Citation>());
3939
}
4040

41+
/// <summary>
42+
/// Intended for internal use only.
43+
/// </summary>
4144
internal static CitationMetadata FromJson(Dictionary<string, object> jsonDict) {
4245
return new CitationMetadata(
4346
jsonDict.ParseObjectList("citations", Citation.FromJson));
@@ -84,6 +87,9 @@ private Citation(int startIndex, int endIndex, Uri uri, string title,
8487
PublicationDate = publicationDate;
8588
}
8689

90+
/// <summary>
91+
/// Intended for internal use only.
92+
/// </summary>
8793
internal static Citation FromJson(Dictionary<string, object> jsonDict) {
8894
// If there is a Uri, need to convert it.
8995
Uri uri = null;

vertexai/src/GenerateContentResponse.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,16 @@ private GenerateContentResponse(List<Candidate> candidates, PromptFeedback? prom
7474
UsageMetadata = usageMetadata;
7575
}
7676

77+
/// <summary>
78+
/// Intended for internal use only.
79+
/// </summary>
7780
internal static GenerateContentResponse FromJson(string jsonString) {
7881
return FromJson(Json.Deserialize(jsonString) as Dictionary<string, object>);
7982
}
8083

84+
/// <summary>
85+
/// Intended for internal use only.
86+
/// </summary>
8187
internal static GenerateContentResponse FromJson(Dictionary<string, object> jsonDict) {
8288
return new GenerateContentResponse(
8389
jsonDict.ParseObjectList("candidates", Candidate.FromJson),
@@ -152,6 +158,9 @@ private static BlockReason ParseBlockReason(string str) {
152158
};
153159
}
154160

161+
/// <summary>
162+
/// Intended for internal use only.
163+
/// </summary>
155164
internal static PromptFeedback FromJson(Dictionary<string, object> jsonDict) {
156165
return new PromptFeedback(
157166
jsonDict.ParseNullableEnum("blockReason", ParseBlockReason),
@@ -186,6 +195,9 @@ private UsageMetadata(int promptTC, int candidatesTC, int totalTC) {
186195
TotalTokenCount = totalTC;
187196
}
188197

198+
/// <summary>
199+
/// Intended for internal use only.
200+
/// </summary>
189201
internal static UsageMetadata FromJson(Dictionary<string, object> jsonDict) {
190202
return new UsageMetadata(
191203
jsonDict.ParseValue<int>("promptTokenCount"),

vertexai/src/GenerationConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ public GenerationConfig(
159159
_responseSchema = responseSchema;
160160
}
161161

162+
/// <summary>
163+
/// Intended for internal use only.
164+
/// </summary>
162165
internal Dictionary<string, object> ToJson() {
163166
Dictionary<string, object> jsonDict = new();
164167
if (_temperature.HasValue) jsonDict["temperature"] = _temperature.Value;

vertexai/src/GenerativeModel.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ public class GenerativeModel {
4646

4747
private readonly HttpClient _httpClient;
4848

49+
/// <summary>
50+
/// Intended for internal use only. Use `VertexAI.GetInstance` instead.
51+
/// </summary>
4952
internal GenerativeModel(FirebaseApp firebaseApp,
5053
string location,
5154
string modelName,

vertexai/src/ModelContent.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@ internal Dictionary<string, object> ToJson() {
232232
};
233233
}
234234

235+
/// <summary>
236+
/// Intended for internal use only.
237+
/// </summary>
235238
internal static ModelContent FromJson(Dictionary<string, object> jsonDict) {
236239
// Both role and parts are required keys
237240
return new ModelContent(

vertexai/src/RequestOptions.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ public readonly struct RequestOptions {
2727
// to determine if it should be 180.
2828
private readonly TimeSpan? _timeout;
2929

30+
/// <summary>
31+
/// Intended for internal use only.
32+
/// </summary>
3033
internal static TimeSpan DefaultTimeout => TimeSpan.FromSeconds(180);
3134

32-
// Intentionally not public, as users don't need it.
35+
/// <summary>
36+
/// Intended for internal use only.
37+
/// </summary>
3338
internal TimeSpan Timeout => _timeout ?? DefaultTimeout;
3439

3540
/// <summary>

vertexai/src/Safety.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ private string ConvertMethod(HarmBlockMethod method) {
140140
};
141141
}
142142

143+
/// <summary>
144+
/// Intended for internal use only.
145+
/// </summary>
143146
internal Dictionary<string, object> ToJson() {
144147
Dictionary<string, object> jsonDict = new () {
145148
["category"] = ConvertCategory(_category),
@@ -297,6 +300,9 @@ private static HarmSeverity ParseSeverity(string str) {
297300
};
298301
}
299302

303+
/// <summary>
304+
/// Intended for internal use only.
305+
/// </summary>
300306
internal static SafetyRating FromJson(Dictionary<string, object> jsonDict) {
301307
return new SafetyRating(
302308
jsonDict.ParseEnum("category", ParseCategory),

0 commit comments

Comments
 (0)