@@ -23,44 +23,44 @@ namespace Firebase.VertexAI {
23
23
24
24
/// <summary>
25
25
/// 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.
28
28
/// </summary>
29
29
public readonly struct ModelContent {
30
30
private readonly string _role ;
31
31
private readonly ReadOnlyCollection < Part > _parts ;
32
32
33
33
/// <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,
35
35
/// for example, the role is `user`.
36
36
/// </summary>
37
37
public string Role => string . IsNullOrWhiteSpace ( _role ) ? "user" : _role ;
38
38
39
39
/// <summary>
40
- /// The data parts comprising this `` ModelContent` ` value.
40
+ /// The data parts comprising this `ModelContent` value.
41
41
/// </summary>
42
42
public IEnumerable < Part > Parts => _parts ?? new ReadOnlyCollection < Part > ( new List < Part > ( ) ) ;
43
43
44
44
/// <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.
46
46
/// </summary>
47
47
public ModelContent ( params Part [ ] parts ) : this ( "user" , parts ) { }
48
48
49
49
/// <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.
51
51
/// </summary>
52
52
public ModelContent ( IEnumerable < Part > parts ) : this ( "user" , parts ) { }
53
53
54
54
/// <summary>
55
- /// Creates a ModelContent with the given role and `Part`s.
55
+ /// Creates a ` ModelContent` with the given role and `Part`s.
56
56
/// </summary>
57
57
public ModelContent ( string role , params Part [ ] parts ) {
58
58
_role = role ;
59
59
_parts = new ReadOnlyCollection < Part > ( parts . ToList ( ) ) ;
60
60
}
61
61
62
62
/// <summary>
63
- /// Creates a ModelContent with the given role and `Part`s.
63
+ /// Creates a ` ModelContent` with the given role and `Part`s.
64
64
/// </summary>
65
65
public ModelContent ( string role , IEnumerable < Part > parts ) {
66
66
_role = role ;
@@ -70,32 +70,32 @@ public ModelContent(string role, IEnumerable<Part> parts) {
70
70
#region Helper Factories
71
71
72
72
/// <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.
75
75
/// </summary>
76
76
public static ModelContent Text ( string text ) {
77
77
return new ModelContent ( new TextPart ( text ) ) ;
78
78
}
79
79
80
80
/// <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.
83
83
/// </summary>
84
84
public static ModelContent InlineData ( string mimeType , byte [ ] data ) {
85
85
return new ModelContent ( new InlineDataPart ( mimeType , data ) ) ;
86
86
}
87
87
88
88
/// <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.
91
91
/// </summary>
92
92
public static ModelContent FileData ( string mimeType , System . Uri uri ) {
93
93
return new ModelContent ( new FileDataPart ( mimeType , uri ) ) ;
94
94
}
95
95
96
96
/// <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.
99
99
/// </summary>
100
100
public static ModelContent FunctionResponse (
101
101
string name , IDictionary < string , object > response ) {
@@ -111,12 +111,12 @@ public static ModelContent FunctionResponse(
111
111
112
112
/// <summary>
113
113
/// 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.
115
115
/// </summary>
116
116
public interface Part {
117
117
#if ! DOXYGEN
118
118
/// <summary>
119
- /// Intended for internal use only
119
+ /// Intended for internal use only.
120
120
/// </summary>
121
121
Dictionary < string , object > ToJson ( ) ;
122
122
#endif
@@ -151,7 +151,7 @@ Dictionary<string, object> Part.ToJson() {
151
151
}
152
152
153
153
/// <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.
155
155
/// </summary>
156
156
public readonly struct FileDataPart : Part {
157
157
public string MimeType { get ; }
@@ -201,7 +201,7 @@ Dictionary<string, object> Part.ToJson() {
201
201
///
202
202
/// Contains a string representing the `FunctionDeclaration.name` and a structured JSON object
203
203
/// 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.
205
205
/// </summary>
206
206
public readonly struct FunctionResponsePart : Part {
207
207
public string Name { get ; }
@@ -262,7 +262,7 @@ private static Part PartFromJson(Dictionary<string, object> jsonDict) {
262
262
if ( ! functionCallDict . TryGetValue ( "name" , out var name ) || name is not string ) {
263
263
throw new VertexAISerializationException ( "Invalid JSON format: 'name' is not a string." ) ;
264
264
}
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 > ) {
266
266
throw new VertexAISerializationException ( "Invalid JSON format: 'args' is not a dictionary." ) ;
267
267
}
268
268
return new FunctionCallPart ( name as string , args as Dictionary < string , object > ) ;
0 commit comments