pub struct ServerConfig {
pub bind: String,
pub port: u16,
pub gateway_url: String,
pub gateway_key: Option<String>,
pub model: String,
pub seed_kb: bool,
pub max_iterations: u32,
pub max_tokens: u32,
pub storage: StorageBackend,
pub widget_auth_strict: bool,
}Expand description
Fully-resolved server configuration.
Fields§
§bind: StringIP address to bind (127.0.0.1 for local dev, 0.0.0.0 in containers).
port: u16Port to bind.
gateway_url: StringLLM gateway base URL.
gateway_key: Option<String>Optional gateway API key. None means LLM turns are unavailable and
send_message returns a clean error.
model: StringModel id.
seed_kb: boolWhether to seed the knowledge base with demo docs on startup.
max_iterations: u32Agent-loop iteration cap per turn.
max_tokens: u32max_tokens per LLM call.
storage: StorageBackendStorage backend (drives both the storage adapter and the matching durable
admin stores). Defaults to StorageBackend::Memory.
widget_auth_strict: boolFail-closed embeddable-widget auth: when true, a session for an agent
the WidgetAuthProvider
has no policy for is rejected (unknown/unregistered agents can’t be
embedded). When false (default), an absent policy is allowed — so the
permissive default provider leaves /ws open. Set WIDGET_AUTH_STRICT=1
in front of a real provider. Origin + authContext are always enforced
for agents that do have a policy, regardless of this flag.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Read configuration from the environment, applying documented defaults.
Sourcepub fn has_llm(&self) -> bool
pub fn has_llm(&self) -> bool
true when a gateway key is present, so LLM turns can actually run.
Sourcepub fn llm_config(&self) -> Option<LlmConfig>
pub fn llm_config(&self) -> Option<LlmConfig>
Build the smooth-operator LlmConfig for live turns.
Returns None when no gateway key is configured (callers should emit a
clean protocol error rather than attempting a turn).
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request