pub struct PublicChatChannelConfig {
pub anonymous: bool,
pub token: Option<String>,
pub session_expiration_seconds: u32,
pub rate_limit_per_minute: Option<u32>,
pub tool_visibility: AgUiToolVisibility,
pub generic_tool_text: String,
pub auth: Option<AppEndpointAuthConfig>,
pub branding: PublicChatBranding,
pub captcha: Option<PublicChatCaptchaConfig>,
}Expand description
Typed Public Chat channel configuration.
Parsed from the channel_config JSON field on App. Public Chat reuses
AG-UI’s streaming semantics and the shared App endpoint auth verifier, and
adds branding and bot-mitigation tailored to a public, link-shareable chat
website. See specs/public-chat.md.
Fields§
§anonymous: boolWhether anonymous access is allowed. Anonymous-by-default mirrors AG-UI.
When false, visitors must authenticate (e.g. via auth Google OIDC).
token: Option<String>Optional shared bearer token for simple gated access. When set, requests must include the token in a supported header. Redacted on read.
session_expiration_seconds: u32How long (in seconds) a visitor session can be resumed before a fresh
one must be started. 0 disables expiration. Defaults to 6 hours.
rate_limit_per_minute: Option<u32>Optional per-IP, per-app rate limit in requests per minute. None or
Some(0) disables the per-app cap (the global API limit still applies).
tool_visibility: AgUiToolVisibilityPublic tool activity visibility. Same rules as AG-UI: raw tool names, args, results, and internal IDs are never exposed on public streams.
generic_tool_text: StringGeneric public text shown when tool_visibility is generic/narrated.
auth: Option<AppEndpointAuthConfig>Optional inline auth config for this public endpoint (e.g. Google OIDC).
When omitted, anonymous + optional token behavior applies.
branding: PublicChatBrandingBranding shown on the public chat surface.
captcha: Option<PublicChatCaptchaConfig>Optional bot-mitigation / CAPTCHA configuration (Cloudflare Turnstile).
Implementations§
Source§impl PublicChatChannelConfig
impl PublicChatChannelConfig
Sourcepub fn ag_ui_stream_config(&self) -> AgUiChannelConfig
pub fn ag_ui_stream_config(&self) -> AgUiChannelConfig
Project the streaming-relevant fields onto an AgUiChannelConfig so the
shared AG-UI ingress/streaming core can serve Public Chat without a
parallel implementation. Branding and captcha are Public-Chat-only and
are handled by the Public Chat handler, not the shared core.
Sourcepub fn captcha_enforced(&self) -> bool
pub fn captcha_enforced(&self) -> bool
Whether the Turnstile/CAPTCHA challenge should be enforced for an
anonymous visitor. Returns false when no captcha is configured or it is
explicitly disabled. Signed-in visitors (validated via auth) bypass the
challenge and are handled by the caller.
Trait Implementations§
Source§impl Clone for PublicChatChannelConfig
impl Clone for PublicChatChannelConfig
Source§fn clone(&self) -> PublicChatChannelConfig
fn clone(&self) -> PublicChatChannelConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PublicChatChannelConfig
impl Debug for PublicChatChannelConfig
Source§impl<'de> Deserialize<'de> for PublicChatChannelConfig
impl<'de> Deserialize<'de> for PublicChatChannelConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PublicChatChannelConfig
impl RefUnwindSafe for PublicChatChannelConfig
impl Send for PublicChatChannelConfig
impl Sync for PublicChatChannelConfig
impl Unpin for PublicChatChannelConfig
impl UnsafeUnpin for PublicChatChannelConfig
impl UnwindSafe for PublicChatChannelConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> 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