API calls for all endpoints tagged GenAIIntegration.
Summary
Functions
Cancel a batch job (Gemini format)
Cancels a batch job. Gemini conventionally sends the request as /v1beta/batches/{batch_id}:cancel; the router matches the :cancel suffix into the batch_id path parameter.
Count tokens (Gemini format) Counts tokens using Google Gemini API format.
Create cached content (Gemini format) Creates a cached content entry that can be re-used across subsequent generate-content calls to reduce repeated prefix tokens.
Delete a batch job (Gemini format)
Delete cached content (Gemini format)
Delete file (Gemini format) Deletes a file in Google Gemini API format.
Embed content (Gemini format) Creates embeddings using Google Gemini API format.
Generate content (Gemini format) Generates content using Google Gemini API format. The model is specified in the URL path.
Generate image (Gemini format)
For Imagen models, use the :predict suffix (e.g., imagen-3.0-generate-001:predict). For Gemini models, use :generateContent with generationConfig.responseModalities: ["IMAGE"] in the request body.
List batch jobs (Gemini format)
Lists batch jobs in Gemini format. Supports pageSize / pageToken pagination.
List cached content entries (Gemini format)
List files (Gemini format) Lists uploaded files in Google Gemini API format.
List models (Gemini format) Lists available models in Google Gemini API format.
Retrieve a batch job (Gemini format)
Retrieve cached content (Gemini format)
Retrieve file (Gemini format) Retrieves file metadata in Google Gemini API format. Note: This endpoint returns file metadata only. Direct file content download is not supported by Gemini Files API. Use the file.uri field from the response to access the file content.
Retrieve video generation operation (Gemini format)
Polls the status of a long-running video generation operation produced by models/{model}:generateVideos. The Gemini SDK appends the operation name as a wildcard path segment. If the operation name contains /, it must be percent-encoded in the request path (for example, %2F) to remain conformant with OpenAPI 3.x path-parameter semantics.
Stream generate content (Gemini format) Streams content generation using Google Gemini API format. The model is specified in the URL path.
Update cached content (Gemini format)
Updates the TTL or expiration time of a cached content entry. Only ttl or expireTime may be modified.
Upload file (Gemini format) Uploads a file using Google Gemini API format. This is a multipart upload with two parts: - "metadata": JSON object containing file metadata - "file": Binary file content Note: Direct file content download is not supported by Gemini Files API. Use the file.uri field from the response to access uploaded files.
Rerank documents (Vertex Rank)
Reranks records using Google Vertex AI's Ranking API. The request body follows the Vertex rankRecords schema.
Functions
@spec gemini_cancel_batch(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Cancel a batch job (Gemini format)
Cancels a batch job. Gemini conventionally sends the request as /v1beta/batches/{batch_id}:cancel; the router matches the :cancel suffix into the batch_id path parameter.
Parameters
connection(ExBifrost.Connection): Connection to serverbatch_id(String.t): Batch identifier, optionally with a:cancelaction suffix.opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_count_tokens( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiCountTokensRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiCountTokens200Response.t()} | {:error, Tesla.Env.t()}
Count tokens (Gemini format) Counts tokens using Google Gemini API format.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with action (e.g., gemini-pro:countTokens)gemini_count_tokens_request(GeminiCountTokensRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiCountTokens200Response.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_create_cached_content( Tesla.Env.client(), ExBifrost.Model.GeminiCreateCachedContentRequest.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Create cached content (Gemini format) Creates a cached content entry that can be re-used across subsequent generate-content calls to reduce repeated prefix tokens.
Parameters
connection(ExBifrost.Connection): Connection to servergemini_create_cached_content_request(GeminiCreateCachedContentRequest):opts(keyword): Optional parameters:"x-model-provider"(String.t): Optional provider override. Defaults togemini. Usevertexto route to Vertex.
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_delete_batch(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Delete a batch job (Gemini format)
Parameters
connection(ExBifrost.Connection): Connection to serverbatch_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_delete_cached_content(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Delete cached content (Gemini format)
Parameters
connection(ExBifrost.Connection): Connection to servercached_id(String.t):opts(keyword): Optional parameters:"x-model-provider"(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_delete_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, map()} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Delete file (Gemini format) Deletes a file in Google Gemini API format.
Parameters
connection(ExBifrost.Connection): Connection to serverfile_id(String.t): File ID to deleteopts(keyword): Optional parameters
Returns
{:ok, map()}on success{:error, Tesla.Env.t}on failure
@spec gemini_embed_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiEmbeddingRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiEmbeddingResponse.t()} | {:error, Tesla.Env.t()}
Embed content (Gemini format) Creates embeddings using Google Gemini API format.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with action (e.g., embedding-001:embedContent)gemini_embedding_request(GeminiEmbeddingRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiEmbeddingResponse.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_generate_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiGenerationResponse.t()} | {:error, Tesla.Env.t()}
Generate content (Gemini format) Generates content using Google Gemini API format. The model is specified in the URL path.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with action (e.g., gemini-pro:generateContent)gemini_generation_request(GeminiGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiGenerationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_generate_image( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiGenerationResponse.t()} | {:error, Tesla.Env.t()}
Generate image (Gemini format)
For Imagen models, use the :predict suffix (e.g., imagen-3.0-generate-001:predict). For Gemini models, use :generateContent with generationConfig.responseModalities: ["IMAGE"] in the request body.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with action suffix. For Imagen models, use:predict(e.g.,imagen-3.0-generate-001:predict). For Gemini models with image generation, use:generateContent(e.g.,gemini-1.5-pro:generateContent).gemini_generation_request(GeminiGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiGenerationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_list_batches( Tesla.Env.client(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
List batch jobs (Gemini format)
Lists batch jobs in Gemini format. Supports pageSize / pageToken pagination.
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters:pageSize(integer())::pageToken(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_list_cached_contents( Tesla.Env.client(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
List cached content entries (Gemini format)
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters:pageSize(integer())::pageToken(String.t)::"x-model-provider"(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_list_files( Tesla.Env.client(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiListFiles200Response.t()} | {:error, Tesla.Env.t()}
List files (Gemini format) Lists uploaded files in Google Gemini API format.
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters:pageSize(integer()): Maximum number of files to return:pageToken(String.t): Page token for pagination
Returns
{:ok, ExBifrost.Model.GeminiListFiles200Response.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_list_models( Tesla.Env.client(), keyword() ) :: {:ok, ExBifrost.Model.GeminiListModelsResponse.t()} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
List models (Gemini format) Lists available models in Google Gemini API format.
Parameters
connection(ExBifrost.Connection): Connection to serveropts(keyword): Optional parameters:pageSize(integer()): Maximum number of models to return:pageToken(String.t): Page token for pagination
Returns
{:ok, ExBifrost.Model.GeminiListModelsResponse.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_retrieve_batch(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Retrieve a batch job (Gemini format)
Parameters
connection(ExBifrost.Connection): Connection to serverbatch_id(String.t):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_retrieve_cached_content(Tesla.Env.client(), String.t(), keyword()) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Retrieve cached content (Gemini format)
Parameters
connection(ExBifrost.Connection): Connection to servercached_id(String.t):opts(keyword): Optional parameters:"x-model-provider"(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_retrieve_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.GeminiUploadFile200ResponseFile.t()} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Retrieve file (Gemini format) Retrieves file metadata in Google Gemini API format. Note: This endpoint returns file metadata only. Direct file content download is not supported by Gemini Files API. Use the file.uri field from the response to access the file content.
Parameters
connection(ExBifrost.Connection): Connection to serverfile_id(String.t): File IDopts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiUploadFile200ResponseFile.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_retrieve_video_operation( Tesla.Env.client(), String.t(), String.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Retrieve video generation operation (Gemini format)
Polls the status of a long-running video generation operation produced by models/{model}:generateVideos. The Gemini SDK appends the operation name as a wildcard path segment. If the operation name contains /, it must be percent-encoded in the request path (for example, %2F) to remain conformant with OpenAPI 3.x path-parameter semantics.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Video model identifier (e.g.veo-3.1-generate-preview).operation_id(String.t): Operation name. If it contains/, it must be percent-encoded in the request path (for example,%2F).opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_stream_generate_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiGenerationRequest.t(), keyword() ) :: {:ok, ExBifrost.Model.GeminiError.t()} | {:ok, ExBifrost.Model.GeminiGenerationResponse.t()} | {:error, Tesla.Env.t()}
Stream generate content (Gemini format) Streams content generation using Google Gemini API format. The model is specified in the URL path.
Parameters
connection(ExBifrost.Connection): Connection to servermodel(String.t): Model name with action (e.g., gemini-pro:streamGenerateContent)gemini_generation_request(GeminiGenerationRequest):opts(keyword): Optional parameters
Returns
{:ok, ExBifrost.Model.GeminiGenerationResponse.t}on success{:error, Tesla.Env.t}on failure
@spec gemini_update_cached_content( Tesla.Env.client(), String.t(), ExBifrost.Model.GeminiUpdateCachedContentRequest.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Update cached content (Gemini format)
Updates the TTL or expiration time of a cached content entry. Only ttl or expireTime may be modified.
Parameters
connection(ExBifrost.Connection): Connection to servercached_id(String.t):gemini_update_cached_content_request(GeminiUpdateCachedContentRequest):opts(keyword): Optional parameters:"x-model-provider"(String.t):
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure
@spec gemini_upload_file(Tesla.Env.client(), String.t(), keyword()) :: {:ok, ExBifrost.Model.GeminiUploadFile200Response.t()} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Upload file (Gemini format) Uploads a file using Google Gemini API format. This is a multipart upload with two parts: - "metadata": JSON object containing file metadata - "file": Binary file content Note: Direct file content download is not supported by Gemini Files API. Use the file.uri field from the response to access uploaded files.
Parameters
connection(ExBifrost.Connection): Connection to serverfile(String.t):opts(keyword): Optional parameters:metadata(ExBifrost.Model.GeminiUploadFileRequestMetadata.t):
Returns
{:ok, ExBifrost.Model.GeminiUploadFile200Response.t}on success{:error, Tesla.Env.t}on failure
@spec vertex_rank( Tesla.Env.client(), ExBifrost.Model.VertexRankRequest.t(), keyword() ) :: {:ok, %{optional(String.t()) => any()}} | {:ok, ExBifrost.Model.GeminiError.t()} | {:error, Tesla.Env.t()}
Rerank documents (Vertex Rank)
Reranks records using Google Vertex AI's Ranking API. The request body follows the Vertex rankRecords schema.
Parameters
connection(ExBifrost.Connection): Connection to serververtex_rank_request(VertexRankRequest):opts(keyword): Optional parameters
Returns
{:ok, %{}}on success{:error, Tesla.Env.t}on failure