axonflow 0.4.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- axonflow/__init__.py +140 -0
- axonflow/client.py +1612 -0
- axonflow/exceptions.py +103 -0
- axonflow/interceptors/__init__.py +20 -0
- axonflow/interceptors/anthropic.py +184 -0
- axonflow/interceptors/base.py +58 -0
- axonflow/interceptors/bedrock.py +231 -0
- axonflow/interceptors/gemini.py +281 -0
- axonflow/interceptors/ollama.py +253 -0
- axonflow/interceptors/openai.py +160 -0
- axonflow/policies.py +289 -0
- axonflow/py.typed +0 -0
- axonflow/types.py +214 -0
- axonflow/utils/__init__.py +12 -0
- axonflow/utils/cache.py +102 -0
- axonflow/utils/logging.py +89 -0
- axonflow/utils/retry.py +111 -0
- axonflow-0.4.0.dist-info/METADATA +316 -0
- axonflow-0.4.0.dist-info/RECORD +22 -0
- axonflow-0.4.0.dist-info/WHEEL +5 -0
- axonflow-0.4.0.dist-info/licenses/LICENSE +21 -0
- axonflow-0.4.0.dist-info/top_level.txt +1 -0
axonflow/__init__.py
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"""AxonFlow Python SDK - Enterprise AI Governance in 3 Lines of Code.
|
|
2
|
+
|
|
3
|
+
This SDK provides a simple, async-first interface for integrating AI governance
|
|
4
|
+
into your Python applications. It supports policy enforcement, audit logging,
|
|
5
|
+
MCP connectors, and multi-agent planning.
|
|
6
|
+
|
|
7
|
+
Example:
|
|
8
|
+
>>> from axonflow import AxonFlow
|
|
9
|
+
>>>
|
|
10
|
+
>>> # Async usage
|
|
11
|
+
>>> async with AxonFlow(
|
|
12
|
+
... agent_url="https://your-agent.axonflow.com",
|
|
13
|
+
... client_id="your-client-id",
|
|
14
|
+
... client_secret="your-client-secret"
|
|
15
|
+
... ) as client:
|
|
16
|
+
... result = await client.execute_query("user-token", "What is AI?", "chat")
|
|
17
|
+
... print(result.data)
|
|
18
|
+
>>>
|
|
19
|
+
>>> # Sync usage
|
|
20
|
+
>>> client = AxonFlow.sync(
|
|
21
|
+
... agent_url="https://your-agent.axonflow.com",
|
|
22
|
+
... client_id="your-client-id",
|
|
23
|
+
... client_secret="your-client-secret"
|
|
24
|
+
... )
|
|
25
|
+
>>> result = client.execute_query("user-token", "What is AI?", "chat")
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from axonflow.client import AxonFlow, SyncAxonFlow
|
|
29
|
+
from axonflow.exceptions import (
|
|
30
|
+
AuthenticationError,
|
|
31
|
+
AxonFlowError,
|
|
32
|
+
ConfigurationError,
|
|
33
|
+
ConnectionError,
|
|
34
|
+
ConnectorError,
|
|
35
|
+
PlanExecutionError,
|
|
36
|
+
PolicyViolationError,
|
|
37
|
+
RateLimitError,
|
|
38
|
+
TimeoutError,
|
|
39
|
+
)
|
|
40
|
+
from axonflow.policies import (
|
|
41
|
+
CreateDynamicPolicyRequest,
|
|
42
|
+
CreatePolicyOverrideRequest,
|
|
43
|
+
CreateStaticPolicyRequest,
|
|
44
|
+
DynamicPolicy,
|
|
45
|
+
DynamicPolicyCondition,
|
|
46
|
+
DynamicPolicyConfig,
|
|
47
|
+
EffectivePoliciesOptions,
|
|
48
|
+
ListDynamicPoliciesOptions,
|
|
49
|
+
ListStaticPoliciesOptions,
|
|
50
|
+
OverrideAction,
|
|
51
|
+
PolicyAction,
|
|
52
|
+
PolicyCategory,
|
|
53
|
+
PolicyOverride,
|
|
54
|
+
PolicySeverity,
|
|
55
|
+
PolicyTier,
|
|
56
|
+
PolicyVersion,
|
|
57
|
+
StaticPolicy,
|
|
58
|
+
TestPatternMatch,
|
|
59
|
+
TestPatternResult,
|
|
60
|
+
UpdateDynamicPolicyRequest,
|
|
61
|
+
UpdateStaticPolicyRequest,
|
|
62
|
+
)
|
|
63
|
+
from axonflow.types import (
|
|
64
|
+
AuditResult,
|
|
65
|
+
CacheConfig,
|
|
66
|
+
ClientRequest,
|
|
67
|
+
ClientResponse,
|
|
68
|
+
ConnectorInstallRequest,
|
|
69
|
+
ConnectorMetadata,
|
|
70
|
+
ConnectorResponse,
|
|
71
|
+
Mode,
|
|
72
|
+
PlanExecutionResponse,
|
|
73
|
+
PlanResponse,
|
|
74
|
+
PlanStep,
|
|
75
|
+
PolicyApprovalResult,
|
|
76
|
+
PolicyEvaluationInfo,
|
|
77
|
+
RateLimitInfo,
|
|
78
|
+
RetryConfig,
|
|
79
|
+
TokenUsage,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
__version__ = "0.3.2"
|
|
83
|
+
__all__ = [
|
|
84
|
+
# Main client
|
|
85
|
+
"AxonFlow",
|
|
86
|
+
"SyncAxonFlow",
|
|
87
|
+
# Configuration
|
|
88
|
+
"Mode",
|
|
89
|
+
"RetryConfig",
|
|
90
|
+
"CacheConfig",
|
|
91
|
+
# Request/Response types
|
|
92
|
+
"ClientRequest",
|
|
93
|
+
"ClientResponse",
|
|
94
|
+
"PolicyEvaluationInfo",
|
|
95
|
+
# Connector types
|
|
96
|
+
"ConnectorMetadata",
|
|
97
|
+
"ConnectorInstallRequest",
|
|
98
|
+
"ConnectorResponse",
|
|
99
|
+
# Planning types
|
|
100
|
+
"PlanStep",
|
|
101
|
+
"PlanResponse",
|
|
102
|
+
"PlanExecutionResponse",
|
|
103
|
+
# Gateway Mode types
|
|
104
|
+
"RateLimitInfo",
|
|
105
|
+
"PolicyApprovalResult",
|
|
106
|
+
"TokenUsage",
|
|
107
|
+
"AuditResult",
|
|
108
|
+
# Policy CRUD types
|
|
109
|
+
"PolicyCategory",
|
|
110
|
+
"PolicyTier",
|
|
111
|
+
"PolicyAction",
|
|
112
|
+
"PolicySeverity",
|
|
113
|
+
"OverrideAction",
|
|
114
|
+
"StaticPolicy",
|
|
115
|
+
"DynamicPolicy",
|
|
116
|
+
"PolicyOverride",
|
|
117
|
+
"PolicyVersion",
|
|
118
|
+
"DynamicPolicyConfig",
|
|
119
|
+
"DynamicPolicyCondition",
|
|
120
|
+
"TestPatternResult",
|
|
121
|
+
"TestPatternMatch",
|
|
122
|
+
"ListStaticPoliciesOptions",
|
|
123
|
+
"ListDynamicPoliciesOptions",
|
|
124
|
+
"EffectivePoliciesOptions",
|
|
125
|
+
"CreateStaticPolicyRequest",
|
|
126
|
+
"UpdateStaticPolicyRequest",
|
|
127
|
+
"CreateDynamicPolicyRequest",
|
|
128
|
+
"UpdateDynamicPolicyRequest",
|
|
129
|
+
"CreatePolicyOverrideRequest",
|
|
130
|
+
# Exceptions
|
|
131
|
+
"AxonFlowError",
|
|
132
|
+
"ConfigurationError",
|
|
133
|
+
"AuthenticationError",
|
|
134
|
+
"PolicyViolationError",
|
|
135
|
+
"RateLimitError",
|
|
136
|
+
"ConnectionError",
|
|
137
|
+
"TimeoutError",
|
|
138
|
+
"ConnectorError",
|
|
139
|
+
"PlanExecutionError",
|
|
140
|
+
]
|