ExLLM.Gemini.Permissions (ex_llm v0.5.0)
View SourceGoogle Gemini Permissions API implementation.
This module provides functionality for managing permissions on tuned models and corpora in the Gemini API. Permissions control access levels (reader, writer, owner) for users, groups, or everyone.
Summary
Functions
Creates a permission for a tuned model or corpus.
Deletes a permission.
Gets information about a specific permission.
Lists permissions for a tuned model or corpus.
Transfers ownership of a tuned model.
Updates a permission's role.
Types
@type grantee_type() :: :GRANTEE_TYPE_UNSPECIFIED | :USER | :GROUP | :EVERYONE
@type role() :: :ROLE_UNSPECIFIED | :READER | :WRITER | :OWNER
Functions
@spec create_permission(String.t(), map(), options()) :: {:ok, ExLLM.Gemini.Permissions.Permission.t()} | {:error, term()}
Creates a permission for a tuned model or corpus.
Parameters
parent
- The parent resource (e.g., "tunedModels/my-model" or "corpora/my-corpus")permission
- The permission to create containing::grantee_type
- Type of grantee (USER, GROUP, or EVERYONE):email_address
- Email for USER or GROUP types:role
- Permission level (READER, WRITER, or OWNER)
opts
- Options including:api_key
Returns
{:ok, permission}
- The created permission{:error, reason}
- Error details
Deletes a permission.
Parameters
name
- The resource name of the permissionopts
- Options including:api_key
Returns
{:ok, %{}}
- Empty response on success{:error, reason}
- Error details
@spec get_permission(String.t(), options()) :: {:ok, ExLLM.Gemini.Permissions.Permission.t()} | {:error, term()}
Gets information about a specific permission.
Parameters
name
- The resource name (e.g., "tunedModels/my-model/permissions/perm-123")opts
- Options including:api_key
Returns
{:ok, permission}
- The permission details{:error, reason}
- Error details
@spec list_permissions(String.t(), options()) :: {:ok, ExLLM.Gemini.Permissions.ListPermissionsResponse.t()} | {:error, term()}
Lists permissions for a tuned model or corpus.
Parameters
parent
- The parent resourceopts
- Options including::api_key
- Google API key:page_size
- Maximum number of permissions to return:page_token
- Token for pagination
Returns
{:ok, response}
- List of permissions{:error, reason}
- Error details
Transfers ownership of a tuned model.
The current owner will be downgraded to writer role.
Parameters
name
- The resource name of the tuned modelrequest
- Map containing:email_address
of new owneropts
- Options including:api_key
Returns
{:ok, %{}}
- Empty response on success{:error, reason}
- Error details
@spec update_permission(String.t(), map(), options()) :: {:ok, ExLLM.Gemini.Permissions.Permission.t()} | {:error, term()}
Updates a permission's role.
Parameters
name
- The resource name of the permissionupdate
- Map containing:role
to updateopts
- Options including::api_key
- Google API key:update_mask
- Required field mask (should be "role")
Returns
{:ok, permission}
- The updated permission{:error, reason}
- Error details