Athena Intelligence Python Library
Project description
Athena Intelligence Python Library
The Athena Intelligence Python Library provides convenient access to the Athena Intelligence API from applications written in Python.
The library includes type definitions for all request and response fields, and offers both synchronous and asynchronous clients powered by httpx.
Installation
Add this dependency to your project's build file:
pip install athenaintel
# or
poetry add athenaintel
Usage
Simply import Athena and start making calls to our API.
from athena import GeneralAgentConfig, GeneralAgentRequest, InputMessage
from athena.client import Athena
client = Athena(
api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
)
response = client.agents.general.invoke(
request=GeneralAgentRequest(
config=GeneralAgentConfig(enabled_tools=[]),
messages=[
InputMessage(
role="user",
content="Summarize what Athena Intelligence does in one paragraph.",
)
],
)
)
print(response.messages[-1].content)
Async Client
The SDK also exports an async client so that you can make non-blocking calls to our API.
import asyncio
from athena import GeneralAgentConfig, GeneralAgentRequest, InputMessage
from athena.client import AsyncAthena
client = AsyncAthena(
api_key="YOUR_API_KEY" # Defaults to ATHENA_API_KEY
)
async def main() -> None:
response = await client.agents.general.invoke(
request=GeneralAgentRequest(
config=GeneralAgentConfig(enabled_tools=[]),
messages=[
InputMessage(
role="user",
content="Summarize what Athena Intelligence does in one paragraph.",
)
],
)
)
print("Received message", response)
asyncio.run(main())
Long-running workflows
For long-running AOP executions, start the execution asynchronously and check the thread status with the returned thread ID:
from athena import AopExecuteRequestIn
from athena.client import Athena
client = Athena(api_key="...")
execution = client.aop.execute_async(
request=AopExecuteRequestIn(
asset_id="YOUR_AOP_ASSET_ID",
user_inputs={"company": "Athena Intelligence"},
)
)
status = client.threads.get_status(execution.thread_id)
Athena Module
All of the models are nested within the Athena module. Let IntelliSense guide you!
Exception Handling
All errors thrown by the SDK will be subclasses of ApiError.
from athena.core import ApiError
try:
client.users.me()
except ApiError as e: # Handle all API errors
print(e.status_code)
print(e.body)
Advanced
Timeouts
By default, requests time out after 60 seconds. You can configure this with a timeout option at the client or request level.
from athena.client import Athena
client = Athena(
# All timeouts are 20 seconds
timeout=20.0,
)
# Override timeout for a specific method
client.users.me(request_options={"timeout_in_seconds": 20})
Custom HTTP client
You can override the httpx client to customize it for your use-case. Some common use-cases include support for proxies and transports.
import httpx
from athena.client import Athena
client = Athena(
http_client=httpx.Client(
proxy="http://my.test.proxy.example.com",
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
),
)
Beta Status
This SDK is in Preview, and there may be breaking changes between versions without a major version update.
To ensure a reproducible environment (and minimize risk of breaking changes), we recommend pinning a specific package version.
Contributing
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!
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 athenaintel-0.1.1652.tar.gz.
File metadata
- Download URL: athenaintel-0.1.1652.tar.gz
- Upload date:
- Size: 96.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21de4e575ed74edf91ec178e30d009b993c89089567a0f78c29957bbf37b9448
|
|
| MD5 |
f6c8a4f1342b65d1d3652819d5909d36
|
|
| BLAKE2b-256 |
2c7b2f8a5617da56fe9bd7fa7c02b7babf23cfd11e573c5c3e41c382e99de90c
|
Provenance
The following attestation bundles were made for athenaintel-0.1.1652.tar.gz:
Publisher:
ci.yml on Athena-Intel/athena-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
athenaintel-0.1.1652.tar.gz -
Subject digest:
21de4e575ed74edf91ec178e30d009b993c89089567a0f78c29957bbf37b9448 - Sigstore transparency entry: 1971237663
- Sigstore integration time:
-
Permalink:
Athena-Intel/athena-python@5821686feed35d631d8468c3701916825be29033 -
Branch / Tag:
refs/tags/0.1.1652 - Owner: https://github.com/Athena-Intel
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5821686feed35d631d8468c3701916825be29033 -
Trigger Event:
push
-
Statement type:
File details
Details for the file athenaintel-0.1.1652-py3-none-any.whl.
File metadata
- Download URL: athenaintel-0.1.1652-py3-none-any.whl
- Upload date:
- Size: 195.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 |
b86c7296597ca05a898c5e375b841503384fd2524ea67e46366d3f0b76c6be39
|
|
| MD5 |
dc0cabee166e4199e835c08ee5a5d71d
|
|
| BLAKE2b-256 |
a4cccfdd5653fe65a9cb92fa3782d16f25466b9a9df8842317fd2c3780496d64
|
Provenance
The following attestation bundles were made for athenaintel-0.1.1652-py3-none-any.whl:
Publisher:
ci.yml on Athena-Intel/athena-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
athenaintel-0.1.1652-py3-none-any.whl -
Subject digest:
b86c7296597ca05a898c5e375b841503384fd2524ea67e46366d3f0b76c6be39 - Sigstore transparency entry: 1971237762
- Sigstore integration time:
-
Permalink:
Athena-Intel/athena-python@5821686feed35d631d8468c3701916825be29033 -
Branch / Tag:
refs/tags/0.1.1652 - Owner: https://github.com/Athena-Intel
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@5821686feed35d631d8468c3701916825be29033 -
Trigger Event:
push
-
Statement type: