Class ContentMaker.ContentMakerForRole (1.0.0)

public static class ContentMaker.ContentMakerForRole

Helper class to create content for a given role. Instantiated by ContentMaker.forRole("role").

Inheritance

java.lang.Object > ContentMaker.ContentMakerForRole

Methods

fromMultiModalData(Object[] multiModalData)

public Content fromMultiModalData(Object[] multiModalData)

Creates a content from an array of Objects.

Parameter
Name Description
multiModalData Object[]

an array which contains the actual payload of each part. The element could be either a single String or a Part. When it's a single string, it's converted to a com.google.cloud.vertexai.api.Part that has the Text field set.

Returns
Type Description
Content

fromString(String text)

public Content fromString(String text)

Creates a content from a string.

Parameter
Name Description
text String

a string which will be converted to a com.google.cloud.vertexai.api.Part with its text field set.

Returns
Type Description
Content