Skip to content

Commit a34a491

Browse files
committed
Address feedback
1 parent 06f3991 commit a34a491

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

vertexai/src/GenerateContentResponse.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public readonly struct GenerateContentResponse {
4545
public UsageMetadata? UsageMetadata { get; }
4646

4747
/// <summary>
48-
/// The response's content as text, if it exists
48+
/// The response's content as text, if it exists.
4949
/// </summary>
5050
public string Text {
5151
get {
@@ -57,7 +57,7 @@ public string Text {
5757
}
5858

5959
/// <summary>
60-
/// Returns function calls found in any Parts of the first candidate of the response, if any.
60+
/// Returns function calls found in any `Part`s of the first candidate of the response, if any.
6161
/// </summary>
6262
public IEnumerable<ModelContent.FunctionCallPart> FunctionCalls {
6363
get {

vertexai/src/GenerativeModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace Firebase.VertexAI {
3434
public class GenerativeModel {
3535
private FirebaseApp _firebaseApp;
3636

37-
// Various setting fields provided by the user
37+
// Various setting fields provided by the user.
3838
private string _location;
3939
private string _modelName;
4040
private GenerationConfig? _generationConfig;
@@ -73,7 +73,7 @@ internal GenerativeModel(FirebaseApp firebaseApp,
7373

7474
#region Public API
7575
/// <summary>
76-
/// Generates new content from input ModelContent given to the model as a prompt.
76+
/// Generates new content from input `ModelContent` given to the model as a prompt.
7777
/// </summary>
7878
/// <param name="content">The input(s) given to the model as a prompt.</param>
7979
/// <returns>The generated content response from the model.</returns>
@@ -93,7 +93,7 @@ public Task<GenerateContentResponse> GenerateContentAsync(
9393
return GenerateContentAsync(new ModelContent[] { ModelContent.Text(text) });
9494
}
9595
/// <summary>
96-
/// Generates new content from input ModelContent given to the model as a prompt.
96+
/// Generates new content from input `ModelContent` given to the model as a prompt.
9797
/// </summary>
9898
/// <param name="content">The input(s) given to the model as a prompt.</param>
9999
/// <returns>The generated content response from the model.</returns>

vertexai/src/ModelContent.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,44 @@ namespace Firebase.VertexAI {
2323

2424
/// <summary>
2525
/// A type describing data in media formats interpretable by an AI model. Each generative AI
26-
/// request or response contains a list of ``ModelContent``s, and each ``ModelContent`` value
27-
/// may comprise multiple heterogeneous ``ModelContent.Part``s.
26+
/// request or response contains a list of `ModelContent`s, and each `ModelContent` value
27+
/// may comprise multiple heterogeneous `ModelContent.Part`s.
2828
/// </summary>
2929
public readonly struct ModelContent {
3030
private readonly string _role;
3131
private readonly ReadOnlyCollection<Part> _parts;
3232

3333
/// <summary>
34-
/// The role of the entity creating the ``ModelContent``. For user-generated client requests,
34+
/// The role of the entity creating the `ModelContent`. For user-generated client requests,
3535
/// for example, the role is `user`.
3636
/// </summary>
3737
public string Role => string.IsNullOrWhiteSpace(_role) ? "user" : _role;
3838

3939
/// <summary>
40-
/// The data parts comprising this ``ModelContent`` value.
40+
/// The data parts comprising this `ModelContent` value.
4141
/// </summary>
4242
public IEnumerable<Part> Parts => _parts ?? new ReadOnlyCollection<Part>(new List<Part>());
4343

4444
/// <summary>
45-
/// Creates a ModelContent with the given `Part`s, using the default `user` role.
45+
/// Creates a `ModelContent` with the given `Part`s, using the default `user` role.
4646
/// </summary>
4747
public ModelContent(params Part[] parts) : this("user", parts) { }
4848

4949
/// <summary>
50-
/// Creates a ModelContent with the given `Part`s, using the default `user` role.
50+
/// Creates a `ModelContent` with the given `Part`s, using the default `user` role.
5151
/// </summary>
5252
public ModelContent(IEnumerable<Part> parts) : this("user", parts) { }
5353

5454
/// <summary>
55-
/// Creates a ModelContent with the given role and `Part`s.
55+
/// Creates a `ModelContent` with the given role and `Part`s.
5656
/// </summary>
5757
public ModelContent(string role, params Part[] parts) {
5858
_role = role;
5959
_parts = new ReadOnlyCollection<Part>(parts.ToList());
6060
}
6161

6262
/// <summary>
63-
/// Creates a ModelContent with the given role and `Part`s.
63+
/// Creates a `ModelContent` with the given role and `Part`s.
6464
/// </summary>
6565
public ModelContent(string role, IEnumerable<Part> parts) {
6666
_role = role;
@@ -70,32 +70,32 @@ public ModelContent(string role, IEnumerable<Part> parts) {
7070
#region Helper Factories
7171

7272
/// <summary>
73-
/// Creates a new ModelContent with the default `user` role, and a
74-
/// TextPart containing the given text.
73+
/// Creates a new `ModelContent` with the default `user` role, and a
74+
/// `TextPart` containing the given text.
7575
/// </summary>
7676
public static ModelContent Text(string text) {
7777
return new ModelContent(new TextPart(text));
7878
}
7979

8080
/// <summary>
81-
/// Creates a new ModelContent with the default `user` role, and an
82-
/// InlineDataPart containing the given mimeType and data.
81+
/// Creates a new `ModelContent` with the default `user` role, and an
82+
/// `InlineDataPart` containing the given mimeType and data.
8383
/// </summary>
8484
public static ModelContent InlineData(string mimeType, byte[] data) {
8585
return new ModelContent(new InlineDataPart(mimeType, data));
8686
}
8787

8888
/// <summary>
89-
/// Creates a new ModelContent with the default `user` role, and a
90-
/// FileDataPart containing the given mimeType and data.
89+
/// Creates a new `ModelContent` with the default `user` role, and a
90+
/// `FileDataPart` containing the given mimeType and data.
9191
/// </summary>
9292
public static ModelContent FileData(string mimeType, System.Uri uri) {
9393
return new ModelContent(new FileDataPart(mimeType, uri));
9494
}
9595

9696
/// <summary>
97-
/// Creates a new ModelContent with the default `user` role, and a
98-
/// FunctionResponsePart containing the given name and args.
97+
/// Creates a new `ModelContent` with the default `user` role, and a
98+
/// `FunctionResponsePart` containing the given name and args.
9999
/// </summary>
100100
public static ModelContent FunctionResponse(
101101
string name, IDictionary<string, object> response) {
@@ -111,12 +111,12 @@ public static ModelContent FunctionResponse(
111111

112112
/// <summary>
113113
/// A discrete piece of data in a media format interpretable by an AI model. Within a
114-
/// single value of ``Part``, different data types may not mix.
114+
/// single value of `Part`, different data types may not mix.
115115
/// </summary>
116116
public interface Part {
117117
#if !DOXYGEN
118118
/// <summary>
119-
/// Intended for internal use only
119+
/// Intended for internal use only.
120120
/// </summary>
121121
Dictionary<string, object> ToJson();
122122
#endif
@@ -151,7 +151,7 @@ Dictionary<string, object> Part.ToJson() {
151151
}
152152

153153
/// <summary>
154-
/// File data stored in Cloud Storage for Firebase, referenced by URI.
154+
/// File data stored in Cloud Storage for Firebase, referenced by a URI.
155155
/// </summary>
156156
public readonly struct FileDataPart : Part {
157157
public string MimeType { get; }
@@ -201,7 +201,7 @@ Dictionary<string, object> Part.ToJson() {
201201
///
202202
/// Contains a string representing the `FunctionDeclaration.name` and a structured JSON object
203203
/// containing any output from the function is used as context to the model. This should contain the
204-
/// result of a ``FunctionCallPart`` made based on model prediction.
204+
/// result of a `FunctionCallPart` made based on model prediction.
205205
/// </summary>
206206
public readonly struct FunctionResponsePart : Part {
207207
public string Name { get; }
@@ -262,7 +262,7 @@ private static Part PartFromJson(Dictionary<string, object> jsonDict) {
262262
if (!functionCallDict.TryGetValue("name", out var name) || name is not string) {
263263
throw new VertexAISerializationException("Invalid JSON format: 'name' is not a string.");
264264
}
265-
if (!functionCallDict.TryGetValue("name", out var args) || args is not Dictionary<string, object>) {
265+
if (!functionCallDict.TryGetValue("args", out var args) || args is not Dictionary<string, object>) {
266266
throw new VertexAISerializationException("Invalid JSON format: 'args' is not a dictionary.");
267267
}
268268
return new FunctionCallPart(name as string, args as Dictionary<string, object>);

vertexai/src/RequestOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Firebase.VertexAI {
2222
/// Configuration parameters for sending requests to the backend.
2323
/// </summary>
2424
public readonly struct RequestOptions {
25-
// Since the user could create RequestOptions with the default constructor,
25+
// Since the user could create `RequestOptions` with the default constructor,
2626
// which isn't hidable in our C# version, we default to null, and use that
2727
// to determine if it should be 180.
2828
private readonly TimeSpan? _timeout;
@@ -33,7 +33,7 @@ public readonly struct RequestOptions {
3333
internal TimeSpan Timeout => _timeout ?? DefaultTimeout;
3434

3535
/// <summary>
36-
/// Initialize a request options object.
36+
/// Initialize a `RequestOptions` object.
3737
/// </summary>
3838
/// <param name="timeout">The request's timeout interval. Defaults to 180 seconds if given null.</param>
3939
public RequestOptions(TimeSpan? timeout = null) {

vertexai/src/VertexAI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private VertexAI(FirebaseApp firebaseApp, string location) {
3535
}
3636

3737
/// <summary>
38-
/// Returns a VertexAI initialized with the default `FirebaseApp` and location.
38+
/// Returns a `VertexAI` instance initialized with the default `FirebaseApp` and location.
3939
/// </summary>
4040
public static VertexAI DefaultInstance => GetInstance();
4141

@@ -51,7 +51,7 @@ public static VertexAI GetInstance(string location = "us-central1") {
5151
}
5252

5353
/// <summary>
54-
/// Creates an instance of `VertexAI` configured with the given FirebaseApp and location.
54+
/// Creates an instance of `VertexAI` configured with the given `FirebaseApp` and location.
5555
/// </summary>
5656
/// <param name="app">The custom `FirebaseApp` used for initialization.</param>
5757
/// <param name="location">The region identifier, defaulting to `us-central1`; see [Vertex AI

0 commit comments

Comments
 (0)