Async Models
Async module of Models
Functions
Link copied to clipboard
public CompletableFuture<ComputeTokensResponse> computeTokens(String model, String text, ComputeTokensConfig config)
Asynchronously computes tokens given a GenAI model and a text string.
public CompletableFuture<ComputeTokensResponse> computeTokens(String model, List<Content> contents, ComputeTokensConfig config)
Asynchronously computes tokens given a GenAI model and a list of content.
Link copied to clipboard
public CompletableFuture<CountTokensResponse> countTokens(String model, String text, CountTokensConfig config)
Asynchronously counts tokens given a GenAI model and a text string.
public CompletableFuture<CountTokensResponse> countTokens(String model, List<Content> contents, CountTokensConfig config)
Asynchronously counts tokens given a GenAI model and a list of content.
Link copied to clipboard
Asynchronously fetches information about a model by name.
Link copied to clipboard
public CompletableFuture<EditImageResponse> editImage(String model, String prompt, List<ReferenceImage> referenceImages, EditImageConfig config)
Asynchronously edits an image given a GenAI model, a prompt, and a list of reference images.
Link copied to clipboard
public CompletableFuture<EmbedContentResponse> embedContent(String model, Content content, EmbedContentConfig config)
Asynchronously embeds content given a GenAI model and a content object.
public CompletableFuture<EmbedContentResponse> embedContent(String model, String text, EmbedContentConfig config)
Asynchronously embeds content given a GenAI model and a text string.
public CompletableFuture<EmbedContentResponse> embedContent(String model, List<String> texts, EmbedContentConfig config)
Asynchronously embeds content given a GenAI model and a list of text strings.
Link copied to clipboard
public CompletableFuture<GenerateContentResponse> generateContent(String model, Content content, GenerateContentConfig config)
Asynchronously generates content given a GenAI model and a content object.
public CompletableFuture<GenerateContentResponse> generateContent(String model, String text, GenerateContentConfig config)
Asynchronously generates content given a GenAI model and a text string.
public CompletableFuture<GenerateContentResponse> generateContent(String model, List<Content> contents, GenerateContentConfig config)
Asynchronously generates content given a GenAI model and a list of content.
Link copied to clipboard
public CompletableFuture<ResponseStream<GenerateContentResponse>> generateContentStream(String model, Content content, GenerateContentConfig config)
Asynchronously generates content with streaming support given a GenAI model and a content object.
public CompletableFuture<ResponseStream<GenerateContentResponse>> generateContentStream(String model, String text, GenerateContentConfig config)
Asynchronously generates content with streaming support given a GenAI model and a text string.
public CompletableFuture<ResponseStream<GenerateContentResponse>> generateContentStream(String model, List<Content> contents, GenerateContentConfig config)
Asynchronously generates content with streaming support given a GenAI model and a list of content.
Link copied to clipboard
public CompletableFuture<GenerateImagesResponse> generateImages(String model, String prompt, GenerateImagesConfig config)
Asynchronously generates images given a GenAI model and a prompt.
Link copied to clipboard
public CompletableFuture<GenerateVideosOperation> generateVideos(String model, GenerateVideosSource source, GenerateVideosConfig config)
Asynchronously generates videos given a GenAI model, and a GenerateVideosSource source.
public CompletableFuture<GenerateVideosOperation> generateVideos(String model, String prompt, Image image, GenerateVideosConfig config)
Asynchronously generates videos given a GenAI model, and an input (text, image).
public CompletableFuture<GenerateVideosOperation> generateVideos(String model, String prompt, Image image, Video video, GenerateVideosConfig config)
Asynchronously generates videos given a GenAI model, and an input (text, image, or video).
Link copied to clipboard
Asynchronously fetches information about a model by name.
Link copied to clipboard
Asynchronously makes an API request to list the available models.
Link copied to clipboard
public CompletableFuture<RecontextImageResponse> recontextImage(String model, RecontextImageSource source, RecontextImageConfig config)
Asynchronously recontextualizes an image.
Link copied to clipboard
public CompletableFuture<SegmentImageResponse> segmentImage(String model, SegmentImageSource source, SegmentImageConfig config)
Asynchronously segments an image, creating a mask of a specified area.
Link copied to clipboard
Asynchronously updates a tuned model by its name.
Link copied to clipboard
public CompletableFuture<UpscaleImageResponse> upscaleImage(String model, Image image, String upscaleFactor, UpscaleImageConfig config)
Asynchronously upscales an image given a GenAI model and an image and an upscale factor.