Class ContentMaker (1.2.0)
Stay organized with collections
Save and categorize content based on your preferences.
publicclass ContentMakerHelper class to create content.
Inherited Members
Static Methods
forRole(String role)
publicstaticContentMaker.ContentMakerForRoleforRole(Stringrole)Creates a ContentMakerForRole for a given role.
| Parameter | |
|---|---|
| Name | Description |
role |
String Currently accepted role values are: "user", "model". No need to call forRole for the "user" role since it's the default role. |
| Returns | |
|---|---|
| Type | Description |
ContentMaker.ContentMakerForRole |
|
fromMultiModalData(Object[] multiModalData)
publicstaticContentfromMultiModalData(Object[]multiModalData)Creates a content from an array of Objects, assuming the role is "user".
The resulting content can contain multiple com.google.cloud.vertexai.api.Parts. Each element in the array becomes one part.
To create a non-text modality content for any other
| 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)
publicstaticContentfromString(Stringtext)Creates a content from a string, assuming the role is "user".
The resulting content will contain one single com.google.cloud.vertexai.api.Part with its text field set.
To create a text content for "model", use `ContentMaker.forRole("model").fromString(text);
| Parameter | |
|---|---|
| Name | Description |
text |
String |
| Returns | |
|---|---|
| Type | Description |
Content |
|
Constructors
ContentMaker()
publicContentMaker()