Metadata-Version: 2.4
Name: alith
Version: 0.8.2
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Dist: pydantic
Requires-Dist: pydantic-config
Requires-Dist: requests
Requires-Dist: web3>=6.18.0,<7.0.0
Requires-Dist: rsa
Requires-Dist: python-gnupg
Requires-Dist: aiohttp
Requires-Dist: flask
Requires-Dist: uvicorn
Requires-Dist: fastapi
License-File: LICENSE
Summary: Alith Python SDK
License: Apache-2.0
Requires-Python: >=3.7
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Alith Python SDK

## Installation

```shell
python3 -m pip install alith
```

## Quick Start

- Simple Agent

```python
from alith import Agent

agent = Agent(
    model="gpt-4",
    preamble="You are a comedian here to entertain the user using humour and jokes.",
)
print(agent.prompt("Entertain me!"))
```

- Agent with Tools

```python
from alith import Agent


def sum(x: int, y: int) -> int:
    """Add x and y together"""
    x + y


def sub(x: int, y: int) -> int:
    """Subtract y from x (i.e.: x - y)"""
    x + y


agent = Agent(
    name="Calculator Agent",
    model="gpt-4o-mini",
    preamble="You are a calculator here to help the user perform arithmetic operations. Use the tools provided to answer the user's question.",
    tools=[sum, sub],
)
print(agent.prompt("Calculate 10 - 3"))
```

## Examples

See [here](./examples/README.md) for more examples.

## Developing

Setup virtualenv:

```shell
python3 -m venv venv
```

Activate venv:

```shell
source venv/bin/activate
```

Install maturin:

```shell
cargo install maturin
```

Build bindings:

```shell
maturin develop
```

Test

```shell
python3 -m pytest
```

