Python Enterprise SDK
The official Python library tailored for data scientists and backend engineers integrating rNet AI.
PyPIrnet-oauth
Installation
bash
pip install rnet-oauth
1. Initialize Clients
python
from rnet_oauth import RNetOAuthClient, ModelClient
import os
auth = RNetOAuthClient(
client_id=os.getenv('RNET_CLIENT_ID'),
client_secret=os.getenv('RNET_CLIENT_SECRET'),
redirect_uri='https://api.yourdomain.com/callback'
)
gemini = ModelClient("gemini-2.5-flash-lite")2. Generate Cryptographic Challenge (PKCE)
python
pkce = auth.generate_pkce() auth_url = auth.get_authorization_url(pkce['challenge'], state='secure-random-state')
3. Exchange Code for Tokens
python
tokens = auth.exchange_code_for_token(code, pkce['verifier']) access_token = tokens['access_token']
4. Invoke AI Pipelines
python
response = gemini.chat({
"contents": [
{"role": "user", "parts": [{"text": "Optimize this algorithm."}]}
]
}, access_token)
print(response)