GenerativeModelFutures


public abstract class GenerativeModelFutures


用於從 Java 與 GenerativeModel 互動的輔助方法。

另請參閱
from

摘要

公用方法

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

針對提供的 Content,從系統模型產生回應。

abstract @NonNull Publisher<@NonNull GenerateContentResponse>

針對提供的 Content,從系統模型產生串流回應。

abstract @NonNull GenerativeModel

傳回用於建立此物件的 GenerativeModel 例項

公用方法

generateContent

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

針對提供的 Content,從系統模型產生回應。

參數
@NonNull Content prompt

一組要傳送至模型的輸入 Content

generateContentStream

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

針對提供的 Content,從系統模型產生串流回應。

參數
@NonNull Content prompt

一組要傳送至模型的輸入 Content

getGenerativeModel

public abstract @NonNull GenerativeModel getGenerativeModel()

傳回用於建立此物件的 GenerativeModel 例項