# `Gemini.Types.FileSearchStore`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L1)

Type 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"
    )

# `file_search_store_state`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L53)

```elixir
@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

# `t`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L69)

```elixir
@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 name
- `description` - Store description
- `state` - Current state
- `create_time` - Creation timestamp (ISO 8601)
- `update_time` - Last update timestamp (ISO 8601)
- `document_count` - Number of documents in the store
- `total_size_bytes` - Total size of all documents
- `vector_config` - Vector embedding configuration

# `vector_config`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L63)

```elixir
@type vector_config() :: %{
  optional(:embedding_model) =&gt; String.t(),
  optional(:dimensions) =&gt; pos_integer()
}
```

Vector embedding configuration for the store.

# `active?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L155)

```elixir
@spec active?(t()) :: boolean()
```

Checks if the store is active and ready to use.

# `creating?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L162)

```elixir
@spec creating?(t()) :: boolean()
```

Checks if the store is still being created.

# `failed?`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L169)

```elixir
@spec failed?(t()) :: boolean()
```

Checks if the store operation failed.

# `from_api_response`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L115)

```elixir
@spec from_api_response(map()) :: t()
```

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)

# `get_id`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L182)

```elixir
@spec get_id(t()) :: String.t() | nil
```

Extracts the store ID from the full resource name.

## Examples

    store = %FileSearchStore{name: "fileSearchStores/abc123"}
    FileSearchStore.get_id(store)
    # => "abc123"

# `parse_state`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L133)

```elixir
@spec parse_state(String.t() | nil) :: file_search_store_state() | nil
```

Parses store state from API string.

# `state_to_api`
[🔗](https://github.com/nshkrdotcom/gemini_ex/blob/v0.11.0/lib/gemini/types/file_search_store.ex#L145)

```elixir
@spec state_to_api(file_search_store_state()) :: String.t()
```

Converts state atom to API string format.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
