pub struct PurviewSettings {
pub app_name: String,
pub app_version: Option<String>,
pub tenant_id: Option<String>,
pub purview_app_location: Option<PurviewAppLocation>,
pub graph_base_uri: String,
pub blocked_prompt_message: String,
pub blocked_response_message: String,
pub ignore_exceptions: bool,
pub ignore_payment_required: bool,
pub cache_ttl_seconds: u64,
pub max_cache_size_bytes: u64,
}Expand description
Settings for Purview integration. Mirrors Python’s PurviewSettings
(an AFBaseSettings/pydantic model there; a plain builder-style struct
here — this port has no environment-variable-driven construction for it,
since Python’s PurviewSettings isn’t env-prefixed either, unlike
agent-framework-copilotstudio’s CopilotStudioSettings).
Fields§
§app_name: StringRequired: the calling application’s display/logical name. Sent as
both integratedAppMetadata.name and protectedAppMetadata.name.
app_version: Option<String>§tenant_id: Option<String>The tenant id (GUID) evaluated requests are scoped to. Python can
also infer this from the bearer token’s tid claim when unset; this
port requires it to be set explicitly — see the crate docs’ “Scope”
section (no JWT introspection here).
purview_app_location: Option<PurviewAppLocation>Where the calling application is considered to run, for policy
location matching. Python can also infer an application-type
location from the bearer token’s appid claim when unset; this port
requires it to be set explicitly, for the same reason as tenant_id.
graph_base_uri: String§blocked_prompt_message: String§blocked_response_message: String§ignore_exceptions: boolIf true, a policy-evaluation failure (any error other than a 402 —
see Self::ignore_payment_required) is logged and swallowed
(fail-open: the run proceeds as if evaluation passed) instead of
propagated.
ignore_payment_required: boolIf true, a 402 Payment Required response is logged and swallowed
instead of propagated — checked independently of
Self::ignore_exceptions, mirroring Python’s separate
except PurviewPaymentRequiredError clause (checked before, and
independently of, the generic exception handler).
cache_ttl_seconds: u64Carried for settings parity with Python; this port does not cache protection-scopes responses (see the crate docs), so this value is currently unused.
max_cache_size_bytes: u64Implementations§
Source§impl PurviewSettings
impl PurviewSettings
Sourcepub fn new(app_name: impl Into<String>) -> Self
pub fn new(app_name: impl Into<String>) -> Self
app_name is Purview’s only required setting; everything else takes
Python’s documented defaults.
pub fn with_app_version(self, version: impl Into<String>) -> Self
pub fn with_tenant_id(self, tenant_id: impl Into<String>) -> Self
pub fn with_purview_app_location(self, location: PurviewAppLocation) -> Self
pub fn with_graph_base_uri(self, uri: impl Into<String>) -> Self
pub fn with_blocked_prompt_message(self, message: impl Into<String>) -> Self
pub fn with_blocked_response_message(self, message: impl Into<String>) -> Self
pub fn with_ignore_exceptions(self, value: bool) -> Self
pub fn with_ignore_payment_required(self, value: bool) -> Self
pub fn with_cache_ttl_seconds(self, ttl: u64) -> Self
pub fn with_max_cache_size_bytes(self, bytes: u64) -> Self
Sourcepub fn get_scopes(&self) -> Vec<String>
pub fn get_scopes(&self) -> Vec<String>
The Microsoft Graph OAuth scope(s) required for this base URI:
https://{host}/.default. Mirrors PurviewSettings.get_scopes.
Trait Implementations§
Source§impl Clone for PurviewSettings
impl Clone for PurviewSettings
Source§fn clone(&self) -> PurviewSettings
fn clone(&self) -> PurviewSettings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more