Skip to main content

Python SDK for Atheon

Project description

Codex: Python SDK for Atheon

The Atheon Codex Python library provides convenient access to the Atheon Gateway Ad Service from any Python 3.10+ applications. The library includes type definitions for all request params and response fields, and offers both synchronous and asynchronous clients powered by httpx.

Installation

# install from PyPI
pip install atheon-codex

Usage

import os
from atheon_codex import AtheonCodexClient, AdUnitsFetchModel, AdUnitsIntegrateModel

client = AtheonCodexClient(
    api_key=os.environ.get("ATHEON_CODEX_API_KEY"),
)

fetch_payload = AdUnitsFetchModel(query="How can I write blogs for my website?")
fetch_result = client.fetch_ad_units(fetch_payload)

ad_unit_ids = [ad_unit["id"] for ad_unit in fetch_result["response_data"]]


integrate_payload = AdUnitsIntegrateModel(
    ad_unit_ids=ad_unit_ids, base_content="insert the llm response generated from your application as the base content"
)
integration_result = client.fetch_ad_units(integrate_payload)

print(integration_result)

While you can provide an api_key keyword argument, we recommend using python-dotenv (or something similar) to add ATHEON_CODEX_API_KEY="My Eon API Key" to your .env file so that your API Key is not stored in source control.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

atheon_codex-0.3.1.tar.gz (45.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

atheon_codex-0.3.1-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file atheon_codex-0.3.1.tar.gz.

File metadata

  • Download URL: atheon_codex-0.3.1.tar.gz
  • Upload date:
  • Size: 45.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.7.15

File hashes

Hashes for atheon_codex-0.3.1.tar.gz
Algorithm Hash digest
SHA256 16bc7ce7abe91ef47d89f10bfea458ef3331ca17e04eeb6ad88a73b8bb0f265f
MD5 46e7d0e9e476dd37b6e286efd925693f
BLAKE2b-256 bbc09919025d2cdcec9993af6e8f1c9dddad8777e95dc62b008d9aebbd1e0042

See more details on using hashes here.

File details

Details for the file atheon_codex-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for atheon_codex-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d032c17db62d1ae3cca79be0b02a98b52c93858af0716bfe4e1cf0c9f1188d25
MD5 8a4a29182575a68c80dc48e999bb7daf
BLAKE2b-256 20c631b1525a6a3cc11f1e05c77be1dd2e98dc28f35c2affc7a4e8c2990cb669

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page