Metadata-Version: 2.4
Name: byoe
Version: 1.0.0
Summary: 卜一智航 — 携智而来，决策随行。AI 开发团队编排 + 内置多模型编程 Agent 一体化工具
Author-email: "byoe.net" <hi@byoe.net>
License-Expression: MIT
Project-URL: Homepage, https://www.byoe.net
Project-URL: Repository, https://github.com/byoenet/byoe
Project-URL: Bug Tracker, https://www.byoe.net/bugs
Project-URL: Changelog, https://www.byoe.net/changelog
Keywords: ai,agent,orchestration,coding,llm,cli,dev-team,byoe
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Environment :: Console
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: openai>=1.0
Requires-Dist: rich>=13.0
Requires-Dist: prompt_toolkit>=3.0
Provides-Extra: dotenv
Requires-Dist: python-dotenv>=1.0; extra == "dotenv"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Provides-Extra: web
Provides-Extra: fast
Requires-Dist: tiktoken>=0.5; extra == "fast"
Provides-Extra: structured
Requires-Dist: pydantic>=2.0; extra == "structured"

﻿# BYOE - Bring Your Own Executive AI

> An AI developer-team orchestration tool by [byoe.net](https://www.byoe.net)

**BYOE** combines a lightweight coding Agent with a Crew orchestration layer, so every developer can have an AI crew standing by at all times.

Website: https://www.byoe.net | Install: `pip install byoe`

## 重要更新（1.0.0）

### Python 库 API 全面开放

BYOE 现在是一个**可编程 Python 库**，不再只是 CLI 工具：

```python
pip install byoe
```

```python
import byoe

# 工厂函数，自动从环境变量读取配置
agent = byoe.create_agent()

# 三种调用方式
result = agent.chat("解释向量数据库")          # 同步

stream = agent.stream("写一首诗")              # 流式
for tok in stream:
    print(tok, end="", flush=True)
poem = stream.result                           # 完整文本

import asyncio
result = asyncio.run(agent.achat("重构这段代码"))  # asyncio 异步
```

### 产品功能特点（1.0.0）

| 特性 | 说明 |
|------|------|
| 🐍 **Python 库 API** | `from byoe import Agent, LLM, Tool, create_agent` |
| 📦 **结构化输出** | `agent.chat("...", response_model=MyModel)` 返回 pydantic 实例 |
| 🔗 **模型降级链** | `fallback_models=["gpt-4o-mini"]` 自动切换备用模型 |
| 💾 **会话持久化** | `agent.save()` / `agent.load(path)` 跨进程恢复对话 |
| 🧠 **语义记忆** | `BYOE_EMBEDDING_MODEL` 启用向量搜索，零新依赖 |
| 🔀 **Swarm 并行分组** | `parallel_groups=[["安全","性能"],["主管"]]` scatter-gather |
| 🔌 **工具插件系统** | pip 包通过 entry-point 自动注册工具 |
| 🔄 **MCP 双向集成** | `byoe mcp-server` 暴露工具；`create_agent(mcp_servers=[...])` 接入外部 MCP 工具 |
| 🖼️ **多模态图片输入** | `chat/stream/achat(images=[...])` 支持图片理解，内置 `read_image` 工具 |
| 🛡️ **CLI Git 安全确认** | risky Git 操作交互确认，危险操作默认拒绝 |
| 🌐 **Helm Web UI** | 内置前端界面，支持会话、工具轨迹与状态可视化 |
| 📊 **`byoe metrics`** | Token 用量与费用统计 |
| 🗂️ **`byoe memory`** | 命令行直接搜索/管理记忆 |

升级命令：
```bash
pip install -U byoe
```


## 历史更新 (0.7.3)

- **技术栈更新和工具集成**： CLI 中使用 `byoe sober` 即可通过原生多文件正则实现项目代码扫描检测，提供 `console/md` 两种输出模式！
- **修复**: 更新了 PyPI 的项目页面元信息，确保链接准确指向 `www.byoe.net`
- 升级命令：
        ```bash
        pip install -U byoe
        ```

## Features

- **AI Coding Agent** — reads/writes files, runs bash commands, searches the web
- **Web UI (Helm)** — React frontend with dark/light theme, session history, token usage
- **CLI** — `byoe chat` for terminal-first workflows
- **Crew Orchestration** — plan and track multi-agent project workflows
- **Any LLM** — OpenAI, Anthropic, DeepSeek, Ollama, or any OpenAI-compatible API
- **Deep Integration** — auto-injects INSTRUCTIONS.md and crew.yaml into the system prompt
- **Session Memory** — save and restore conversations with full token accounting
- **Custom Skills** — extend the agent with your own tools

---

## Installation

```bash
pip install byoe
```

Development install:

```bash
git clone https://github.com/byoenet/byoe
cd byoe
pip install -e .
```

---

## Quick Start

### Web UI

```bash
export OPENAI_API_KEY=sk-...
export BYOE_MODEL=deepseek-chat
byoe web
```

Open http://localhost:7860 in your browser.

### CLI Chat

```bash
export OPENAI_API_KEY=sk-...
export BYOE_MODEL=deepseek-chat
byoe chat
```

### BYOE Hosted Service

```bash
export BYOE_API_KEY=<your-token>
export BYOE_BASE_URL=https://api.byoe.net
byoe web
```

---

## Configuration

Config file: `~/.byoe/config.yaml`

```yaml
provider: openai    # openai | anthropic | deepseek | byoe | ollama
api_key: sk-...
model: gpt-4o
base_url: ""        # optional: custom endpoint
```

Environment variables:

```bash
export BYOE_PROVIDER=openai
export BYOE_API_KEY=sk-...
export BYOE_MODEL=gpt-4o
```

---

## Supported Providers

| Provider | --provider value | Notes |
|----------|-----------------|-------|
| OpenAI | openai | GPT-4o, o1, etc. |
| Anthropic | anthropic | Claude 3.5 Sonnet, etc. |
| DeepSeek | deepseek | deepseek-chat, deepseek-coder |
| Ollama | ollama | Local models |
| BYOE | byoe | Hosted service at byoe.net |
| Any OpenAI-compat | openai + --base-url | LM Studio, vLLM, etc. |

---

## Crew Commands

```bash
byoe init              # Initialize project (creates INSTRUCTIONS.md + crew.yaml)
byoe plan "<goal>"     # Generate a sprint plan
byoe status            # Show current sprint / task status
byoe release           # Tag and document a release
byoe run               # Execute the next planned task
byoe agents            # List available specialist agents
```

---

## License

MIT (c) byoe.net
