GenerativeModelFutures


public abstract class GenerativeModelFutures


Helper method for interacting with a GenerativeModel from Java.

See also
from

Summary

Public methods

static final @NonNull GenerativeModelFutures
abstract @NonNull ListenableFuture<@NonNull GenerateContentResponse>

Generates a response from the system model for the provided Contents.

abstract @NonNull Publisher<@NonNull GenerateContentResponse>

Generates a streaming response from the system model for the provided Contents.

abstract @NonNull GenerativeModel

Returns the GenerativeModel instance that was used to create this object

Public methods

from

public static final @NonNull GenerativeModelFutures from(@NonNull GenerativeModel model)

generateContent

public abstract @NonNull ListenableFuture<@NonNull GenerateContentResponsegenerateContent(@NonNull Content prompt)

Generates a response from the system model for the provided Contents.

Parameters
@NonNull Content prompt

A group of input Contents to send to the model.

generateContentStream

public abstract @NonNull Publisher<@NonNull GenerateContentResponsegenerateContentStream(@NonNull Content prompt)

Generates a streaming response from the system model for the provided Contents.

Parameters
@NonNull Content prompt

A group of input Contents to send to the model.

getGenerativeModel

public abstract @NonNull GenerativeModel getGenerativeModel()

Returns the GenerativeModel instance that was used to create this object