File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
java-vertexai/google-cloud-vertexai/src/main/java/com/google/cloud/vertexai/generativeai Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2727import com .google .cloud .vertexai .api .GenerationConfig ;
2828import com .google .cloud .vertexai .api .SafetySetting ;
2929import com .google .cloud .vertexai .api .Tool ;
30+ import com .google .common .collect .ImmutableList ;
3031import java .io .IOException ;
3132import java .util .ArrayList ;
32- import java .util .Collections ;
3333import java .util .List ;
3434import java .util .Optional ;
3535
@@ -210,9 +210,9 @@ private void checkFinishReasonAndRemoveLastContent(GenerateContentResponse respo
210210 /**
211211 * Returns the history of the conversation.
212212 *
213- * @return an unmodifiable history of the conversation.
213+ * @return a history of the conversation as an immutable list of {@link Content} .
214214 */
215- public List <Content > getHistory () {
215+ public ImmutableList <Content > getHistory () {
216216 try {
217217 checkLastResponseAndEditHistory ();
218218 } catch (IllegalStateException e ) {
@@ -225,7 +225,7 @@ public List<Content> getHistory() {
225225 }
226226 throw e ;
227227 }
228- return Collections . unmodifiableList (history );
228+ return ImmutableList . copyOf (history );
229229 }
230230
231231 /**
You can’t perform that action at this time.
0 commit comments