Metadata-Version: 2.5
Name: bos-ai
Version: 2.2.0
Summary: An agent out of the box. A framework for your own agent-native applications.
Project-URL: Homepage, https://github.com/bos-agent/bos-ai
License: MIT License
        
        Copyright (c) 2024-2026, bos-ai contributors
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Requires-Python: >=3.13
Requires-Dist: filelock==3.25.2
Requires-Dist: jsonschema>=4.21
Requires-Dist: pydantic==2.12.5
Requires-Dist: python-dotenv==1.2.2
Requires-Dist: pyyaml==6.0.3
Provides-Extra: all
Requires-Dist: beautifulsoup4==4.14.3; extra == 'all'
Requires-Dist: click==8.3.2; extra == 'all'
Requires-Dist: ddgs==9.14.4; extra == 'all'
Requires-Dist: httpx==0.28.1; extra == 'all'
Requires-Dist: lark-oapi==1.6.8; extra == 'all'
Requires-Dist: litellm==1.84.0; extra == 'all'
Requires-Dist: prompt-toolkit==3.0.52; extra == 'all'
Requires-Dist: python-multipart==0.0.32; extra == 'all'
Requires-Dist: rich==14.3.3; extra == 'all'
Requires-Dist: starlette==1.6.0; extra == 'all'
Requires-Dist: textual-autocomplete==4.0.6; extra == 'all'
Requires-Dist: textual==8.2.3; extra == 'all'
Requires-Dist: uvicorn==0.53.0; extra == 'all'
Requires-Dist: websockets==15.0.1; extra == 'all'
Provides-Extra: claude-code
Requires-Dist: claude-agent-sdk==0.2.159; extra == 'claude-code'
Requires-Dist: httpx==0.28.1; extra == 'claude-code'
Requires-Dist: mcp<3,>=2; extra == 'claude-code'
Requires-Dist: python-multipart==0.0.32; extra == 'claude-code'
Requires-Dist: starlette==1.6.0; extra == 'claude-code'
Requires-Dist: uvicorn==0.53.0; extra == 'claude-code'
Requires-Dist: websockets==15.0.1; extra == 'claude-code'
Provides-Extra: cli
Requires-Dist: click==8.3.2; extra == 'cli'
Requires-Dist: httpx==0.28.1; extra == 'cli'
Requires-Dist: prompt-toolkit==3.0.52; extra == 'cli'
Requires-Dist: python-multipart==0.0.32; extra == 'cli'
Requires-Dist: rich==14.3.3; extra == 'cli'
Requires-Dist: starlette==1.6.0; extra == 'cli'
Requires-Dist: textual-autocomplete==4.0.6; extra == 'cli'
Requires-Dist: textual==8.2.3; extra == 'cli'
Requires-Dist: uvicorn==0.53.0; extra == 'cli'
Requires-Dist: websockets==15.0.1; extra == 'cli'
Provides-Extra: codex
Requires-Dist: httpx==0.28.1; extra == 'codex'
Requires-Dist: mcp<3,>=2; extra == 'codex'
Requires-Dist: openai-codex==0.156.1; extra == 'codex'
Requires-Dist: python-multipart==0.0.32; extra == 'codex'
Requires-Dist: starlette==1.6.0; extra == 'codex'
Requires-Dist: uvicorn==0.53.0; extra == 'codex'
Requires-Dist: websockets==15.0.1; extra == 'codex'
Provides-Extra: gateway
Requires-Dist: httpx==0.28.1; extra == 'gateway'
Requires-Dist: python-multipart==0.0.32; extra == 'gateway'
Requires-Dist: starlette==1.6.0; extra == 'gateway'
Requires-Dist: uvicorn==0.53.0; extra == 'gateway'
Requires-Dist: websockets==15.0.1; extra == 'gateway'
Provides-Extra: lark
Requires-Dist: lark-oapi==1.6.8; extra == 'lark'
Provides-Extra: litellm
Requires-Dist: litellm==1.84.0; extra == 'litellm'
Provides-Extra: search
Requires-Dist: beautifulsoup4==4.14.3; extra == 'search'
Requires-Dist: ddgs==9.14.4; extra == 'search'
Description-Content-Type: text/markdown

```
 ███████████     ███████     █████████
░░███░░░░░███  ███░░░░░███  ███░░░░░███
 ░███    ░███ ███     ░░███░███    ░░░
 ░██████████ ░███      ░███░░█████████
 ░███░░░░░███░███      ░███ ░░░░░░░░███
 ░███    ░███░░███     ███  ███    ░███
 ███████████  ░░░███████░  ░░█████████
░░░░░░░░░░░     ░░░░░░░     ░░░░░░░░░
```

> An agent out of the box. A framework for your own agent-native applications.

<div align="center">
  <p>
    <a href="https://pypi.org/project/bos-ai/"><img src="https://img.shields.io/pypi/v/bos-ai" alt="PyPI"></a>
    <a href="https://pepy.tech/project/bos-ai"><img src="https://static.pepy.tech/badge/bos-ai" alt="Downloads"></a>
    <img src="https://img.shields.io/badge/python-≥3.13-blue" alt="Python">
    <img src="https://img.shields.io/badge/license-MIT-green" alt="License">
    <a href="https://github.com/bos-agent/bos-ai"><img src="https://img.shields.io/github/stars/bos-agent/bos-ai?style=social" alt="GitHub Stars"></a>
  </p>
</div>


## Quick Start

```bash
OPENAI_API_KEY=<api-key> uvx boscli ask "how are you" --model openai/gpt-4o
```

Install [uv](https://docs.astral.sh/uv/) to get `uvx`, or install the CLI permanently with `uv tool install boscli` / `pipx install boscli`.

Using a different provider? See LiteLLM's [provider docs](https://docs.litellm.ai/docs/providers) for the right `BOS_MODEL` prefix and required environment variables. For example, using a deepseek model

```bash
DEEPSEEK_API_KEY=<api-key> uvx boscli ask "how are you" --model deepseek/deepseek-v4-pro
```

> `pip install bos-ai` installs the **library** — it does not provide the `boscli` command. The CLI ships as the [`boscli`](https://pypi.org/project/boscli/) distribution. See [Embedding](#embedding) to drive BOS from your own application.

## Project Setup

```bash
mkdir my-agent && cd my-agent
boscli init          # guided setup: purpose, topology, model — writes a runnable baseline
boscli gateway start # start the agent runtime
boscli tui           # connect the terminal UI
```

## Embedding

`pip install bos-ai` is a library install: about 14 MB, no console script, no terminal UI, no gateway. There are two ways to embed, and which one you want is a decision to make before you write code.

**Call the agent** from your own process — `bos.sdk` is the contract:

```python
from bos.sdk import BosApp

async with BosApp(my_config_dict, bos_dir="/var/lib/myapp/.bos") as app:
    agent = app.agent()
    result = await agent.run(chat_id, "hello")
```

**Or mount the whole gateway runtime** — actors, channels, chat coordination, the WebSocket protocol — inside your own web application with `GatewayMount` (needs `bos-ai[gateway]`).

Configuration is a plain dict in both — load it from a database, environment, or a control plane; nothing requires a TOML file on disk. **[Embedding BOS](docs/site/embedding/index.md)** covers the choice, both modes, and the supported API surface; [`examples/embed_sdk.py`](examples/embed_sdk.py) and [`examples/embed_gateway_fastapi.py`](examples/embed_gateway_fastapi.py) are the runnable versions.

### Install extras

| Install | Adds |
|---|---|
| `bos-ai` | The library: `bos.core`, `bos.config`, plugins |
| `bos-ai[litellm]` | The built-in LLM provider. Without it, register your own with `@ep_provider` |
| `bos-ai[gateway]` | The gateway process and the Telegram/Lark channels |
| `bos-ai[search]` | The built-in web-search and page-fetch tools |
| `bos-ai[lark]` | The Lark/Feishu SDK |
| `bos-ai[cli]` | The CLI's dependencies — run it with `python -m bos.cli` |
| `bos-ai[codex]` | The Codex external agent runtime (BEP 19), with the vendor's `codex` CLI binary |
| `bos-ai[claude-code]` | The Claude Code external agent runtime (BEP 19), with the `claude` CLI bundled in the `claude-agent-sdk` wheel (~230 MB) |
| `bos-ai[all]` | Every extra above except `codex` and `claude-code`, which each bundle a vendor CLI binary |

The `codex` and `claude-code` extras let a BOS agent run on Codex or Claude Code — see [External agents](docs/site/concepts/external-agents.md) for declaring, configuring and logging in.

### The supported surface

- `bos.core` — `AgentHarness`, `Agent`, `AgentResult`, the `ep_*` extension points, and the port protocols (`LLM`, `ChatStore`, `Consolidator`, `ToolSet`, `TurnInterceptor`, `PromptProvider`, `TurnEventSink`)
- `bos.config` — `Workspace`, `RootConfig`, `validate_config`

Names prefixed with `_` are re-exported for extensions and are **not stable**; they are not part of the embedding contract.

## Docs

See the [documentation site](https://bos-agent.github.io/bos-ai/) for tutorials, architecture, extension points, and the configuration reference.

Building on BOS with an AI agent? [`llm-full.md`](src/bos/llm-full.md) is a single dense, code-grounded reference covering every mechanism — configuration, extension points, plugins, channels, skills, the CLI, and the runtime — in one file. `boscli init` drops a copy into every scaffolded project.

## License

See [LICENSE](LICENSE).
