Athena Intelligence Python Library
Actively maintained. Last release 4 weeks ago. A safe choice.
pip install athenaintelAthena 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)