Gemini.Types.FileSearchStore (GeminiEx v0.8.4)
View SourceType definitions for File Search Stores (semantic search stores).
File Search Stores enable semantic search over uploaded documents using vector embeddings. They are part of the RAG (Retrieval-Augmented Generation) system and are only available through Vertex AI.
Store States
Stores go through several states during their lifecycle:
:state_unspecified- Initial/unknown state:creating- Store is being created:active- Store is ready to use:deleting- Store is being deleted:failed- Store creation/operation failed
Example
# Create a file search store
config = %CreateFileSearchStoreConfig{
display_name: "Product Documentation",
description: "Technical documentation for our products"
}
{:ok, store} = Gemini.APIs.FileSearchStores.create(config)
# Check store state
case store.state do
:active -> IO.puts("Store ready: #{store.name}")
:creating -> IO.puts("Still creating...")
:failed -> IO.puts("Failed to create store")
end
# Import files
{:ok, _doc} = Gemini.APIs.FileSearchStores.import_file(
store.name,
"files/uploaded-doc-id"
)
Summary
Types
File search store state enumeration.
Represents a File Search Store for semantic search.
Vector embedding configuration for the store.
Functions
Checks if the store is active and ready to use.
Checks if the store is still being created.
Checks if the store operation failed.
Creates a FileSearchStore from API response.
Extracts the store ID from the full resource name.
Parses store state from API string.
Converts state atom to API string format.
Types
@type file_search_store_state() ::
:state_unspecified | :creating | :active | :deleting | :failed
File search store state enumeration.
:state_unspecified- Initial/unknown state:creating- Store is being created:active- Store is ready for operations:deleting- Store is being deleted:failed- Operation failed
@type t() :: %Gemini.Types.FileSearchStore{ create_time: String.t() | nil, description: String.t() | nil, display_name: String.t() | nil, document_count: integer() | nil, name: String.t() | nil, state: file_search_store_state() | nil, total_size_bytes: integer() | nil, update_time: String.t() | nil, vector_config: vector_config() | nil }
Represents a File Search Store for semantic search.
Fields
name- Resource name (format: "fileSearchStores/{store_id}")display_name- Human-readable namedescription- Store descriptionstate- Current statecreate_time- Creation timestamp (ISO 8601)update_time- Last update timestamp (ISO 8601)document_count- Number of documents in the storetotal_size_bytes- Total size of all documentsvector_config- Vector embedding configuration
@type vector_config() :: %{ optional(:embedding_model) => String.t(), optional(:dimensions) => pos_integer() }
Vector embedding configuration for the store.
Functions
Checks if the store is active and ready to use.
Checks if the store is still being created.
Checks if the store operation failed.
Creates a FileSearchStore from API response.
Parameters
response- Map from API response with string keys
Examples
response = %{
"name" => "fileSearchStores/abc123",
"displayName" => "My Store",
"state" => "ACTIVE",
"documentCount" => 42
}
store = FileSearchStore.from_api_response(response)
Extracts the store ID from the full resource name.
Examples
store = %FileSearchStore{name: "fileSearchStores/abc123"}
FileSearchStore.get_id(store)
# => "abc123"
@spec parse_state(String.t() | nil) :: file_search_store_state() | nil
Parses store state from API string.
@spec state_to_api(file_search_store_state()) :: String.t()
Converts state atom to API string format.