ExMemvid.Config (ex_memvid v0.1.1)
Configuration defaults and constants for ExMemvid.
This module provides a Nimble Options schema for validating and managing ExMemvid configuration options, converted from the Python version.
Summary
Functions
Returns codec parameters for the specified codec.
Get codec parameters for a specific codec.
Validates configuration options, raising on error.
Types
@type t() :: [ qr: map(), codec: atom(), chunking: map(), retrieval: map(), embedding: map(), index: map() ]
:qr
(map/0
) - QR Code generation settings The default value is%{gzip: false, error_correction: :medium, fill_color: "#000000", back_color: "#ffffff"}
.:error_correction
(atom/0
) - Error correction level The default value is{:in, [:low, :medium, :quartile, :high]}
.:fill_color
(String.t/0
) - QR fill color The default value is"#000000"
.:back_color
(String.t/0
) - QR background color The default value is"#ffffff"
.:gzip
(boolean/0
) - Whether to gzip the QR code text The default value isfalse
.
:codec
(atom/0
) - Video codec to use: :h265, :hevc, :h264 The default value is:h265
.:chunking
(map/0
) - Text chunking settings The default value is%{chunk_size: 1024, overlap: 32}
.:retrieval
(map/0
) - Data retrieval settings:top_k
(integer/0
) - Number of top results to retrieve The default value is5
.:batch_size
(integer/0
) - Batch size for processing The default value is100
.:max_workers
(integer/0
) - Maximum number of worker processes The default value is4
.:cache_size
(integer/0
) - Number of frames to cache The default value is1000
.
:embedding
(map/0
) - Text embedding settings The default value is%{module: ExMemvid.Embedding.Local, batch_size: 32, model: "sentence-transformers/all-MiniLM-L6-v2", dimension: 384, max_sequence_length: 512, partitions: 4}
.:module
(atom/0
) - Which Embedding Implementation to use The default value isExMemvid.Embedding.Local
.:model
(String.t/0
) - Embedding model name The default value is"sentence-transformers/all-MiniLM-L6-v2 "
.:dimension
(integer/0
) - Embedding vector dimension The default value is384
.:batch_size
(integer/0
) - Batch size for embedding The default value is32
.:max_sequence_length
(integer/0
) - Maximum sequence length for text input The default value is512
.:partitions
(integer/0
) - Number of embedding worker partitions (defaults to CPU cores) The default value is4
.
:index
(map/0
) - Vector index settings The default value is%{vector_search_space: :cosine, embedding_dimensions: 384, max_elements: 10000}
.:ef_construction
(integer/0
) - Number of elements to consider during index construction The default value is400
.:ef_search
(integer/0
) - Number of elements to consider during search The default value is50
.:vector_search_space
- Vector search space type The default value is:cosine
.:embedding_dimensions
(integer/0
) - Dimensions of the embedding vectors The default value is384
.:max_elements
(integer/0
) - Maximum number of elements in the index The default value is10000
.
Functions
Returns codec parameters for the specified codec.
Get codec parameters for a specific codec.
Examples
iex> ExMemvid.Config.get_codec_parameters(:h265)
%{video_fps: 30, ...}
iex> ExMemvid.Config.get_codec_parameters(:invalid)
{:error, "Unsupported codec: invalid. Available: [:h265, :hevc, :h264]"}
Validates configuration options, raising on error.