Metadata-Version: 2.2
Name: headlessagents
Version: 1.0.0
Summary: Python SDK for interacting with Headless Agents API
Author-email: Hayden <hayden@headlessagents.ai>
License: MIT
Project-URL: Homepage, https://github.com/headlessagents/headlessagents
Project-URL: Documentation, https://github.com/headlessagents/headlessagents#readme
Project-URL: Issues, https://github.com/headlessagents/headlessagents/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.25.0
Requires-Dist: aiohttp>=3.8.0
Requires-Dist: pydantic>=1.9.0

# HeadlessAgents Python SDK 1.0.0<a id="HeadlessAgents-python-sdk-100"></a>

Welcome to the HeadlessAgents SDK documentation. This guide will help you get started with integrating and using the HeadlessAgents SDK in your project.

[![This SDK was generated by liblab](https://public-liblab-readme-assets.s3.us-east-1.amazonaws.com/built-by-liblab-icon.svg)](https://liblab.com/?utm_source=readme)

## Versions<a id="versions"></a>

- API version: `1.0.0`
- SDK version: `1.0.0`

## About the API<a id="about-the-api"></a>

API for interacting with Headless Agents

## Table of Contents<a id="table-of-contents"></a>

- [Setup & Configuration](#setup--configuration)
  - [Supported Language Versions](#supported-language-versions)
  - [Installation](#installation)
- [Authentication](#authentication)
  - [API Key Authentication](#api-key-authentication)
- [Setting a Custom Timeout](#setting-a-custom-timeout)
- [Sample Usage](#sample-usage)
- [Services](#services)
- [Models](#models)

## Setup & Configuration<a id="setup--configuration"></a>

### Supported Language Versions<a id="supported-language-versions"></a>

This SDK is compatible with the following versions: `Python >= 3.7`

### Installation<a id="installation"></a>

To get started with the SDK, we recommend installing using `pip`:

```bash
pip install headlessagents
```

## Authentication<a id="authentication"></a>

### API Key Authentication<a id="api-key-authentication"></a>

The HeadlessAgents API uses API keys as a form of authentication. An API key is a unique identifier used to authenticate a user, developer, or a program that is calling the API.

#### Setting the API key<a id="setting-the-api-key"></a>

When you initialize the SDK, you can set the API key as follows:

```py
HeadlessAgents(
    api_key="YOUR_API_KEY",
    timeout=10000
)
```

If you need to set or update the API key after initializing the SDK, you can use:

```py
sdk.set_api_key("YOUR_API_KEY")
```

## Setting a Custom Timeout<a id="setting-a-custom-timeout"></a>

You can set a custom timeout for the SDK's HTTP requests as follows:

```py
from headlessagents import HeadlessAgents

sdk = HeadlessAgents(timeout=10000)
```

# Sample Usage<a id="sample-usage"></a>

Below is a comprehensive example demonstrating how to authenticate and call a simple endpoint:

```py
from headlessagents import HeadlessAgents

sdk = HeadlessAgents(
    api_key="YOUR_API_KEY",
    timeout=10000
)

result = sdk.system.health_check()

print(result)

```

# Async Usage<a id="async-usage"></a>

The SDK includes an Async Client for making asynchronous API requests. This is useful for applications that need non-blocking operations, like web servers or apps with a graphical user interface.

```py
import asyncio
from headlessagents import HeadlessAgentsAsync

sdk = HeadlessAgentsAsync(
    api_key="YOUR_API_KEY",
    timeout=10000
)


async def main():
  result = await sdk.system.health_check()
  print(result)

asyncio.run(main())
```

## Services<a id="services"></a>

The SDK provides various services to interact with the API.

<details> 
<summary>Below is a list of all available services:</summary>

| Name      |
| :-------- |
| system    |
| agents    |
| execution |
| analysis  |
| schema    |
| threads   |

</details>

## Models<a id="models"></a>

The SDK includes several models that represent the data structures used in API requests and responses. These models help in organizing and managing the data efficiently.

<details> 
<summary>Below is a list of all available models:</summary>

| Name                   | Description |
| :--------------------- | :---------- |
| HealthCheckOkResponse  |             |
| AgentCreate            |             |
| Agent                  |             |
| AgentUpdate            |             |
| CallAgentRequest       |             |
| CallAgentOkResponse    |             |
| DigestRequest          |             |
| CreateDigestOkResponse |             |
| SchemaCreateRequest    |             |
| CreateSchemaOkResponse |             |
| Thread                 |             |
| ThreadMessage          |             |

</details>

<!-- This file was generated by liblab | https://liblab.com/ -->
