ChromaConfig class

Configuration for the ChromaDB client.

This class configures all aspects of client behavior including:

  • Server connection (URL, tenant, database)
  • Authentication
  • Timeouts and retry behavior
  • Logging

Example:

final config = ChromaConfig(
  baseUrl: 'https://api.trychroma.com',
  authProvider: ApiKeyProvider('your-api-key'),
  tenant: 'my-tenant',
  database: 'my-database',
);

final client = ChromaClient(config: config);

Constructors

ChromaConfig({String baseUrl = 'http://localhost:8000', String tenant = 'default_tenant', String database = 'default_database', AuthProvider authProvider = const NoAuthProvider(), Duration timeout = const Duration(seconds: 30), RetryPolicy retryPolicy = const RetryPolicy(), Level logLevel = Level.INFO, Map<String, String> defaultHeaders = const {}})
Creates a ChromaDB configuration.
const

Properties

authProvider AuthProvider
The authentication provider to use.
final
baseUrl String
The base URL for the ChromaDB server.
final
database String
The database to use within the tenant.
final
defaultHeaders Map<String, String>
Custom headers to include in all requests.
final
hashCode int
The hash code for this object.
no setterinherited
logLevel → Level
The minimum log level for HTTP logging.
final
retryPolicy RetryPolicy
Policy for retrying failed requests.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tenant String
The tenant to use for multi-tenant deployments.
final
timeout Duration
Timeout for individual requests.
final

Methods

copyWith({String? baseUrl, String? tenant, String? database, AuthProvider? authProvider, Duration? timeout, RetryPolicy? retryPolicy, Level? logLevel, Map<String, String>? defaultHeaders}) ChromaConfig
Creates a copy of this configuration with optional modifications.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited