File tree 1 file changed +4
-4
lines changed
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 27
27
import com .google .cloud .vertexai .api .GenerationConfig ;
28
28
import com .google .cloud .vertexai .api .SafetySetting ;
29
29
import com .google .cloud .vertexai .api .Tool ;
30
+ import com .google .common .collect .ImmutableList ;
30
31
import java .io .IOException ;
31
32
import java .util .ArrayList ;
32
- import java .util .Collections ;
33
33
import java .util .List ;
34
34
import java .util .Optional ;
35
35
@@ -210,9 +210,9 @@ private void checkFinishReasonAndRemoveLastContent(GenerateContentResponse respo
210
210
/**
211
211
* Returns the history of the conversation.
212
212
*
213
- * @return an unmodifiable history of the conversation.
213
+ * @return a history of the conversation as an immutable list of {@link Content} .
214
214
*/
215
- public List <Content > getHistory () {
215
+ public ImmutableList <Content > getHistory () {
216
216
try {
217
217
checkLastResponseAndEditHistory ();
218
218
} catch (IllegalStateException e ) {
@@ -225,7 +225,7 @@ public List<Content> getHistory() {
225
225
}
226
226
throw e ;
227
227
}
228
- return Collections . unmodifiableList (history );
228
+ return ImmutableList . copyOf (history );
229
229
}
230
230
231
231
/**
You can’t perform that action at this time.
0 commit comments