Skip to main content

FoundryLocalConfig

Struct FoundryLocalConfig 

Source
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

Source

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");
Source

pub fn app_data_dir(self, dir: impl Into<String>) -> Self

Override the application-data directory.

Source

pub fn model_cache_dir(self, dir: impl Into<String>) -> Self

Override the model-cache directory.

Source

pub fn logs_dir(self, dir: impl Into<String>) -> Self

Override the logs directory.

Source

pub fn log_level(self, level: LogLevel) -> Self

Set the log level.

Source

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.

Source

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.

Source

pub fn catalog_region(self, region: impl Into<String>) -> Self

Set the Azure region used by the catalog service.

Source

pub fn web_service_urls(self, urls: impl Into<String>) -> Self

Set the web-service listen URLs (e.g. "http://localhost:5273").

Source

pub fn service_endpoint(self, endpoint: impl Into<String>) -> Self

Set an external service endpoint URL.

Source

pub fn library_path(self, path: impl Into<String>) -> Self

Override the path to the native Foundry Local Core library.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for FoundryLocalConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FoundryLocalConfig

Source§

fn default() -> FoundryLocalConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more