Class PartMaker (1.14.0)

public class PartMaker

Helper class to create com.google.cloud.vertexai.api.Part

Inheritance

Object > PartMaker

Static Methods

fromFunctionResponse(String name, Struct response)

public static Part fromFunctionResponse(String name, Struct response)
Parameters
Name Description
name String

a string represents the name of the com.google.cloud.vertexai.api.FunctionDeclaration

response Struct

a structured JSON object containing any output from the function call

Returns
Type Description
Part

fromFunctionResponse(String name, Map<String,Object> response)

public static Part fromFunctionResponse(String name, Map<String,Object> response)
Parameters
Name Description
name String

a string represents the name of the com.google.cloud.vertexai.api.FunctionDeclaration

response Map<String,Object>

a map containing the output from the function call, supported output type: String, Double, Boolean, null

Returns
Type Description
Part

fromMimeTypeAndData(String mimeType, Object partData)

public static Part fromMimeTypeAndData(String mimeType, Object partData)

Makes a com.google.cloud.vertexai.api.Part from mimeType and data (or link to the data).

Parameters
Name Description
mimeType String

currently accepted values are "image/png", "image/jpeg", "video/mp4", "video/mpeg", "video/quicktime", "video/x-msvideo", "video/x-ms-wmv", "video/x-flv"

partData Object

the following types can be accepted.

  • a String representing the uri of the data. Resulting Part will have fileData field set.
  • a GCS URI object. Resulting Part will have fileData field set.
  • byte arrays that represents the actual data. Resulting Part will have inlineData field set.
  • com.google.protobuf.ByteString that represents the actual data. Resulting Part will have inlineData field set.

Returns
Type Description
Part