@@ -31,8 +31,11 @@ public readonly struct GenerateContentResponse {
31
31
/// <summary>
32
32
/// A list of candidate response content, ordered from best to worst.
33
33
/// </summary>
34
- public IEnumerable < Candidate > Candidates =>
35
- _candidates ?? new ReadOnlyCollection < Candidate > ( new List < Candidate > ( ) ) ;
34
+ public IEnumerable < Candidate > Candidates {
35
+ get {
36
+ return _candidates ?? new ReadOnlyCollection < Candidate > ( new List < Candidate > ( ) ) ;
37
+ }
38
+ }
36
39
37
40
/// <summary>
38
41
/// A value containing the safety ratings for the response, or,
@@ -141,8 +144,11 @@ public readonly struct PromptFeedback {
141
144
/// <summary>
142
145
/// The safety ratings of the prompt.
143
146
/// </summary>
144
- public IEnumerable < SafetyRating > SafetyRatings =>
145
- _safetyRatings ?? new ReadOnlyCollection < SafetyRating > ( new List < SafetyRating > ( ) ) ;
147
+ public IEnumerable < SafetyRating > SafetyRatings {
148
+ get {
149
+ return _safetyRatings ?? new ReadOnlyCollection < SafetyRating > ( new List < SafetyRating > ( ) ) ;
150
+ }
151
+ }
146
152
147
153
// Hidden constructor, users don't need to make this.
148
154
private PromptFeedback ( BlockReason ? blockReason , string blockReasonMessage ,
@@ -192,12 +198,18 @@ public readonly struct UsageMetadata {
192
198
public int TotalTokenCount { get ; }
193
199
194
200
private readonly ReadOnlyCollection < ModalityTokenCount > _promptTokensDetails ;
195
- public IEnumerable < ModalityTokenCount > PromptTokensDetails =>
196
- _promptTokensDetails ?? new ReadOnlyCollection < ModalityTokenCount > ( new List < ModalityTokenCount > ( ) ) ;
201
+ public IEnumerable < ModalityTokenCount > PromptTokensDetails {
202
+ get {
203
+ return _promptTokensDetails ?? new ReadOnlyCollection < ModalityTokenCount > ( new List < ModalityTokenCount > ( ) ) ;
204
+ }
205
+ }
197
206
198
207
private readonly ReadOnlyCollection < ModalityTokenCount > _candidatesTokensDetails ;
199
- public IEnumerable < ModalityTokenCount > CandidatesTokensDetails =>
200
- _candidatesTokensDetails ?? new ReadOnlyCollection < ModalityTokenCount > ( new List < ModalityTokenCount > ( ) ) ;
208
+ public IEnumerable < ModalityTokenCount > CandidatesTokensDetails {
209
+ get {
210
+ return _candidatesTokensDetails ?? new ReadOnlyCollection < ModalityTokenCount > ( new List < ModalityTokenCount > ( ) ) ;
211
+ }
212
+ }
201
213
202
214
// Hidden constructor, users don't need to make this.
203
215
private UsageMetadata ( int promptTC , int candidatesTC , int totalTC ,
0 commit comments