pub struct FoundryLocalConfig { /* private fields */ }Expand description
User-facing configuration for initializing the Foundry Local SDK.
Construct with FoundryLocalConfig::new and customise via the builder
methods:
let config = FoundryLocalConfig::new("my_app")
.log_level(LogLevel::Debug)
.model_cache_dir("/path/to/cache");Implementations§
Source§impl FoundryLocalConfig
impl FoundryLocalConfig
Sourcepub fn new(app_name: impl Into<String>) -> Self
pub fn new(app_name: impl Into<String>) -> Self
Create a new configuration with the given application name.
All other fields default to None. Use the builder methods to
customise:
let config = FoundryLocalConfig::new("my_app")
.log_level(LogLevel::Debug)
.model_cache_dir("/path/to/cache");Sourcepub fn app_data_dir(self, dir: impl Into<String>) -> Self
pub fn app_data_dir(self, dir: impl Into<String>) -> Self
Override the application-data directory.
Sourcepub fn model_cache_dir(self, dir: impl Into<String>) -> Self
pub fn model_cache_dir(self, dir: impl Into<String>) -> Self
Override the model-cache directory.
Sourcepub fn catalog_url(self, url: impl Into<String>) -> Self
pub fn catalog_url(self, url: impl Into<String>) -> Self
Add a catalog URL.
Call this method multiple times to configure multiple catalogs. Catalogs
retain insertion order, which determines their priority. Use
catalog_url_with_filter to attach a
per-catalog filter override.
Sourcepub fn catalog_url_with_filter(
self,
url: impl Into<String>,
filter_override: impl Into<String>,
) -> Self
pub fn catalog_url_with_filter( self, url: impl Into<String>, filter_override: impl Into<String>, ) -> Self
Add a catalog URL with a per-catalog filter override.
Behaves like catalog_url but also records a filter
override that is applied to this catalog only.
Sourcepub fn catalog_region(self, region: impl Into<String>) -> Self
pub fn catalog_region(self, region: impl Into<String>) -> Self
Set the Azure region used by the catalog service.
Sourcepub fn web_service_urls(self, urls: impl Into<String>) -> Self
pub fn web_service_urls(self, urls: impl Into<String>) -> Self
Set the web-service listen URLs (e.g. "http://localhost:5273").
Sourcepub fn service_endpoint(self, endpoint: impl Into<String>) -> Self
pub fn service_endpoint(self, endpoint: impl Into<String>) -> Self
Set an external service endpoint URL.
Sourcepub fn library_path(self, path: impl Into<String>) -> Self
pub fn library_path(self, path: impl Into<String>) -> Self
Override the path to the native Foundry Local Core library.
Sourcepub fn additional_setting(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn additional_setting( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add a single key-value pair to the additional settings map.
Sourcepub fn logger(self, logger: impl Logger + 'static) -> Self
pub fn logger(self, logger: impl Logger + 'static) -> Self
Provide an application logger.
Not wired to native logging. The native core’s configuration ABI
exposes only a log level and a logs directory (see log_level and
logs_dir) — there is no logger-callback hook — so a custom Logger
cannot currently receive the core’s log records. The logger is stored for
forward compatibility and any SDK-side use, but setting it has no effect
on native logging today; use log_level / logs_dir to control core
logging.