Skip to content
Open
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
8 changes: 6 additions & 2 deletions examples/indonesia_compliance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import os

from axonflow import AxonFlow
from axonflow.exceptions import AxonFlowError
from axonflow.exceptions import AuthenticationError, AxonFlowError
from axonflow.policies import PolicyCategory


Expand Down Expand Up @@ -45,14 +45,18 @@ async def main() -> None:
print("\nSending governed request with NIK...")
try:
resp = await client.proxy_llm_call(
user_token="",
# Enterprise stacks (DEPLOYMENT_MODE=enterprise) validate user
# tokens as JWTs; an empty token 401s on every governed call.
user_token=os.environ.get("AXONFLOW_USER_TOKEN", ""),
query="Customer NIK is 3204110507900003 and their name is Budi Santoso",
request_type="chat",
context={"purpose": "identity_verification"},
)
print(f"Response blocked: {resp.blocked}")
if resp.policy_info:
print(f"Policies evaluated: {resp.policy_info.policies_evaluated}")
except AuthenticationError:
raise # credentials problem — never a "no LLM" situation; fail loudly
except AxonFlowError as e:
print(f"Request error (expected if no LLM configured): {e}")

Expand Down
Loading