Cortex SDK — transport client for Python
Project description
Cortex SDK for Python
Install
pip install cortex-suite-sdk
Quick start
import asyncio
from cortex_sdk import CortexClient
def on_message(msg):
print(msg["type"], msg["payload"])
async def main():
client = CortexClient(
api_key="your-api-key",
# auth_url="https://cortexsuite.app", # optional override
on_message=on_message,
)
await client.connect()
await client.send_message(content="Hello")
asyncio.run(main())
API
See the full API reference.
auth_url is optional; if omitted, the SDK uses its default auth base URL.
Error handling
from cortex_sdk import CortexClient, CortexError
def on_message(msg):
if msg["type"] == "system::error":
print("Runtime error:", msg["payload"]["code"])
if msg["payload"].get("fatal"):
pass # handle unrecoverable session
client = CortexClient(
api_key="your-api-key",
on_message=on_message,
)
try:
await client.connect()
except CortexError as err:
if err.code in ("auth_invalid", "auth_refresh_failed"):
pass # prompt re-authentication
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cortex_suite_sdk-1.1.20.tar.gz.
File metadata
- Download URL: cortex_suite_sdk-1.1.20.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5dc7e4b29a07128b006ba2939c16ec1bd3d28b7cee80e7833901b2772d55bf1
|
|
| MD5 |
c83c2af78049f3d734dce812645e53a0
|
|
| BLAKE2b-256 |
a6db0a181eea96091962e8d8e4f42042779f9fa0d22e3d73dbaa9990f4a71f64
|
Provenance
The following attestation bundles were made for cortex_suite_sdk-1.1.20.tar.gz:
Publisher:
release.yml on Cortex-Suite-Team/cortex-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortex_suite_sdk-1.1.20.tar.gz -
Subject digest:
a5dc7e4b29a07128b006ba2939c16ec1bd3d28b7cee80e7833901b2772d55bf1 - Sigstore transparency entry: 1694759403
- Sigstore integration time:
-
Permalink:
Cortex-Suite-Team/cortex-sdk@7aca48dfa6b3bc4fff0ac0064629eae26273332c -
Branch / Tag:
refs/tags/v1.1.20 - Owner: https://github.com/Cortex-Suite-Team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7aca48dfa6b3bc4fff0ac0064629eae26273332c -
Trigger Event:
push
-
Statement type:
File details
Details for the file cortex_suite_sdk-1.1.20-py3-none-any.whl.
File metadata
- Download URL: cortex_suite_sdk-1.1.20-py3-none-any.whl
- Upload date:
- Size: 18.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a632d672757af049308cff55e7e56810d0ec84320c2b404e13598a14430f0c3f
|
|
| MD5 |
94843839c6ea5320bbc9b62004ddb17f
|
|
| BLAKE2b-256 |
649552c6dc191abda266bd7b78b78e556e703129342d3405786f041ed423cc22
|
Provenance
The following attestation bundles were made for cortex_suite_sdk-1.1.20-py3-none-any.whl:
Publisher:
release.yml on Cortex-Suite-Team/cortex-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cortex_suite_sdk-1.1.20-py3-none-any.whl -
Subject digest:
a632d672757af049308cff55e7e56810d0ec84320c2b404e13598a14430f0c3f - Sigstore transparency entry: 1694759651
- Sigstore integration time:
-
Permalink:
Cortex-Suite-Team/cortex-sdk@7aca48dfa6b3bc4fff0ac0064629eae26273332c -
Branch / Tag:
refs/tags/v1.1.20 - Owner: https://github.com/Cortex-Suite-Team
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7aca48dfa6b3bc4fff0ac0064629eae26273332c -
Trigger Event:
push
-
Statement type: