Metadata-Version: 2.1
Name: athenaintel
Version: 0.1.1659
Summary: Athena Intelligence Python Library
Requires-Python: >=3.9,<4.0
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.8
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: fastapi (>=0.115.10,<0.130.0)
Requires-Dist: httpx (>=0.21.2)
Requires-Dist: langchain_core (>=0.3.40,<0.4.0)
Requires-Dist: langserve (>=0.3.1,<0.4.0)
Requires-Dist: pydantic (>=1.9.2)
Requires-Dist: pydantic-core (>=2.18.2)
Requires-Dist: python-magic (==0.4.27)
Requires-Dist: typing_extensions (>=4.0.0)
Description-Content-Type: text/markdown

# Athena Intelligence Python Library

[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)
[![pypi](https://img.shields.io/pypi/v/athenaintel.svg)](https://pypi.python.org/pypi/athenaintel)

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:

```bash
pip install athenaintel
# or
poetry add athenaintel
```

## Usage
Simply import `Athena` and start making calls to our API. 

```python
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. 

```python
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:

```python
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`](./src/athena/core/api_error.py).

```python
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.

```python
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.

```python
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!

