Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to the AxonFlow Python SDK will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.0] - 2026-02-22

### Added

- Media governance configuration methods: `get_media_governance_config()`, `update_media_governance_config()`, `get_media_governance_status()`
- Media governance types: `MediaGovernanceConfig`, `MediaGovernanceStatus`
- Media policy category constants: `CATEGORY_MEDIA_SAFETY`, `CATEGORY_MEDIA_BIOMETRIC`, `CATEGORY_MEDIA_PII`, `CATEGORY_MEDIA_DOCUMENT`

---

## [3.5.0] - 2026-02-19

### Added
Expand Down
18 changes: 17 additions & 1 deletion axonflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@
UpdateStaticPolicyRequest,
)
from axonflow.types import (
CATEGORY_MEDIA_BIOMETRIC,
CATEGORY_MEDIA_DOCUMENT,
CATEGORY_MEDIA_PII,
CATEGORY_MEDIA_SAFETY,
AuditResult,
Budget,
BudgetAlert,
Expand Down Expand Up @@ -151,6 +155,8 @@
MediaAnalysisResponse,
MediaAnalysisResult,
MediaContent,
MediaGovernanceConfig,
MediaGovernanceStatus,
Mode,
ModelPricing,
PlanExecutionResponse,
Expand All @@ -170,6 +176,7 @@
TimelineEntry,
TokenUsage,
UpdateBudgetRequest,
UpdateMediaGovernanceConfigRequest,
UpdatePlanRequest,
UpdatePlanResponse,
UsageBreakdown,
Expand Down Expand Up @@ -202,7 +209,7 @@
WorkflowStepInfo,
)

__version__ = "3.5.0"
__version__ = "3.6.0"
__all__ = [
# Main client
"AxonFlow",
Expand All @@ -220,6 +227,15 @@
"MediaContent",
"MediaAnalysisResult",
"MediaAnalysisResponse",
# Media Governance Config types
"MediaGovernanceConfig",
"MediaGovernanceStatus",
"UpdateMediaGovernanceConfigRequest",
# Media Governance Category constants
"CATEGORY_MEDIA_SAFETY",
"CATEGORY_MEDIA_BIOMETRIC",
"CATEGORY_MEDIA_DOCUMENT",
"CATEGORY_MEDIA_PII",
# Connector types
"ConnectorMetadata",
"ConnectorInstallRequest",
Expand Down
78 changes: 78 additions & 0 deletions axonflow/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@
ListUsageRecordsOptions,
ListWebhooksResponse,
MediaContent,
MediaGovernanceConfig,
MediaGovernanceStatus,
Mode,
PlanExecutionResponse,
PlanResponse,
Expand All @@ -167,6 +169,7 @@
TimelineEntry,
TokenUsage,
UpdateBudgetRequest,
UpdateMediaGovernanceConfigRequest,
UpdatePlanRequest,
UpdatePlanResponse,
UsageBreakdown,
Expand Down Expand Up @@ -3966,6 +3969,64 @@ async def list_webhooks(self) -> ListWebhooksResponse:
total=response.get("total", len(webhooks)),
)

# =========================================================================
# MEDIA GOVERNANCE CONFIG
# =========================================================================

async def get_media_governance_config(self) -> MediaGovernanceConfig:
"""Get the media governance configuration for the current tenant.

Returns:
MediaGovernanceConfig with current tenant media governance settings

Example:
>>> config = await client.get_media_governance_config()
>>> print(f"Enabled: {config.enabled}, Analyzers: {config.allowed_analyzers}")
"""
response = await self._request("GET", "/api/v1/media-governance/config")
return MediaGovernanceConfig.model_validate(response)

async def update_media_governance_config(
self,
request: UpdateMediaGovernanceConfigRequest,
) -> MediaGovernanceConfig:
"""Update the media governance configuration for the current tenant.

Args:
request: Update request with fields to change

Returns:
Updated MediaGovernanceConfig

Example:
>>> from axonflow import UpdateMediaGovernanceConfigRequest
>>> config = await client.update_media_governance_config(
... UpdateMediaGovernanceConfigRequest(
... enabled=True, allowed_analyzers=["nsfw", "pii"]
... )
... )
>>> print(f"Enabled: {config.enabled}")
"""
response = await self._request(
"PUT",
"/api/v1/media-governance/config",
json_data=request.model_dump(exclude_none=True),
)
return MediaGovernanceConfig.model_validate(response)

async def get_media_governance_status(self) -> MediaGovernanceStatus:
"""Get the platform-level media governance status.

Returns:
MediaGovernanceStatus with availability and default configuration

Example:
>>> status = await client.get_media_governance_status()
>>> print(f"Available: {status.available}, Tier: {status.tier}")
"""
response = await self._request("GET", "/api/v1/media-governance/status")
return MediaGovernanceStatus.model_validate(response)

# =========================================================================
# MAS FEAT COMPLIANCE (Enterprise)
# =========================================================================
Expand Down Expand Up @@ -6391,6 +6452,23 @@ def get_pricing(
"""Get pricing information for models."""
return self._run_sync(self._async_client.get_pricing(provider, model))

# Media Governance Config sync wrappers

def get_media_governance_config(self) -> MediaGovernanceConfig:
"""Get the media governance configuration for the current tenant."""
return self._run_sync(self._async_client.get_media_governance_config())

def update_media_governance_config(
self,
request: UpdateMediaGovernanceConfigRequest,
) -> MediaGovernanceConfig:
"""Update the media governance configuration for the current tenant."""
return self._run_sync(self._async_client.update_media_governance_config(request))

def get_media_governance_status(self) -> MediaGovernanceStatus:
"""Get the platform-level media governance status."""
return self._run_sync(self._async_client.get_media_governance_status())

# =========================================================================
# MAS FEAT Compliance sync wrappers (Enterprise)
# =========================================================================
Expand Down
56 changes: 56 additions & 0 deletions axonflow/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1028,3 +1028,59 @@ class ListWebhooksResponse(BaseModel):
default_factory=list, description="List of webhook subscriptions"
)
total: int = Field(default=0, ge=0, description="Total count of webhooks")


# =========================================================================
# Media Governance Config Types
# =========================================================================


class MediaGovernanceConfig(BaseModel):
"""Per-tenant media governance configuration.

Controls whether media analysis is enabled and which analyzers
are allowed for a given tenant.
"""

tenant_id: str = Field(default="", description="Tenant ID")
enabled: bool = Field(default=False, description="Whether media analysis is enabled")
allowed_analyzers: list[str] = Field(
default_factory=list, description="List of allowed analyzer IDs"
)
updated_at: str = Field(default="", description="Last updated timestamp")
updated_by: str = Field(default="", description="User who last updated the config")


class MediaGovernanceStatus(BaseModel):
"""Platform-level media governance status.

Reports availability and default configuration for media governance.
"""

available: bool = Field(default=False, description="Whether media governance is available")
enabled_by_default: bool = Field(
default=False, description="Whether media governance is enabled by default for new tenants"
)
per_tenant_control: bool = Field(
default=False, description="Whether per-tenant media governance control is supported"
)
tier: str = Field(default="", description="License tier (community, enterprise, etc.)")


class UpdateMediaGovernanceConfigRequest(BaseModel):
"""Request to update per-tenant media governance configuration."""

enabled: bool | None = Field(default=None, description="Enable or disable media analysis")
allowed_analyzers: list[str] | None = Field(
default=None, description="List of allowed analyzer IDs"
)


# =========================================================================
# Media Governance Category Constants
# =========================================================================

CATEGORY_MEDIA_SAFETY: str = "media-safety"
CATEGORY_MEDIA_BIOMETRIC: str = "media-biometric"
CATEGORY_MEDIA_DOCUMENT: str = "media-document"
CATEGORY_MEDIA_PII: str = "media-pii"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "axonflow"
version = "3.5.0"
version = "3.6.0"
description = "AxonFlow Python SDK - Enterprise AI Governance in 3 Lines of Code"
readme = "README.md"
license = {text = "MIT"}
Expand Down