Models
Functions
Link copied to clipboard
Computes tokens given a GenAI model and a text string.
public ComputeTokensResponse computeTokens(String model, List<Content> contents, ComputeTokensConfig config)
Computes tokens given a GenAI model and a list of content.
Link copied to clipboard
Counts tokens given a GenAI model and a text string.
public CountTokensResponse countTokens(String model, List<Content> contents, CountTokensConfig config)
Counts tokens given a GenAI model and a list of content.
Link copied to clipboard
Fetches information about a model by name.
Link copied to clipboard
public EditImageResponse editImage(String model, String prompt, List<ReferenceImage> referenceImages, EditImageConfig config)
Edits an image given a GenAI model, a prompt, and a list of reference images.
Link copied to clipboard
Embeds content given a GenAI model and a content object.
Embeds content given a GenAI model and a text string.
public EmbedContentResponse embedContent(String model, List<String> texts, EmbedContentConfig config)
Embeds content given a GenAI model and a list of text strings.
Link copied to clipboard
public GenerateContentResponse generateContent(String model, Content content, GenerateContentConfig config)
Generates content given a GenAI model and a content object.
public GenerateContentResponse generateContent(String model, String text, GenerateContentConfig config)
Generates content given a GenAI model and a text string.
public GenerateContentResponse generateContent(String model, List<Content> contents, GenerateContentConfig config)
Generates content given a GenAI model and a list of content.
Link copied to clipboard
public ResponseStream<GenerateContentResponse> generateContentStream(String model, Content content, GenerateContentConfig config)
Generates content with streaming support given a GenAI model and a content object.
public ResponseStream<GenerateContentResponse> generateContentStream(String model, String text, GenerateContentConfig config)
Generates content with streaming support given a GenAI model and a text string.
public ResponseStream<GenerateContentResponse> generateContentStream(String model, List<Content> contents, GenerateContentConfig config)
Generates content with streaming support given a GenAI model and a list of content.
Link copied to clipboard
public GenerateImagesResponse generateImages(String model, String prompt, GenerateImagesConfig config)
Generates images given a GenAI model and a prompt.
Link copied to clipboard
public GenerateVideosOperation generateVideos(String model, GenerateVideosSource source, GenerateVideosConfig config)
Generates videos given a GenAI model, and a GenerateVideosSource source.
public GenerateVideosOperation generateVideos(String model, String prompt, Image image, GenerateVideosConfig config)
Generates videos given a GenAI model, and an input (text, image).
public GenerateVideosOperation generateVideos(String model, String prompt, Image image, Video video, GenerateVideosConfig config)
Generates videos given a GenAI model, and an input (text, image, or video).
Link copied to clipboard
Fetches information about a model by name.
Link copied to clipboard
Makes an API request to list the available models.
Link copied to clipboard
public RecontextImageResponse recontextImage(String model, RecontextImageSource source, RecontextImageConfig config)
Recontextualizes an image.
Link copied to clipboard
public SegmentImageResponse segmentImage(String model, SegmentImageSource source, SegmentImageConfig config)
Segments an image, creating a mask of a specified area.
Link copied to clipboard
Updates a tuned model by its name.
Link copied to clipboard
public UpscaleImageResponse upscaleImage(String model, Image image, String upscaleFactor, UpscaleImageConfig config)
Upscales an image given a GenAI model and an image and an upscale factor.