@@ -31,8 +31,11 @@ public readonly struct GenerateContentResponse {
3131 /// <summary>
3232 /// A list of candidate response content, ordered from best to worst.
3333 /// </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+ }
3639
3740 /// <summary>
3841 /// A value containing the safety ratings for the response, or,
@@ -141,8 +144,11 @@ public readonly struct PromptFeedback {
141144 /// <summary>
142145 /// The safety ratings of the prompt.
143146 /// </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+ }
146152
147153 // Hidden constructor, users don't need to make this.
148154 private PromptFeedback ( BlockReason ? blockReason , string blockReasonMessage ,
@@ -192,12 +198,18 @@ public readonly struct UsageMetadata {
192198 public int TotalTokenCount { get ; }
193199
194200 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+ }
197206
198207 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+ }
201213
202214 // Hidden constructor, users don't need to make this.
203215 private UsageMetadata ( int promptTC , int candidatesTC , int totalTC ,
0 commit comments