Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
d01a22f
Implement feature X to enhance user experience and fix bug Y in module Z
yinxulai May 15, 2026
e6696b5
Add TUI styles, Turbo engine, and task definition handling
yinxulai May 16, 2026
b5e0b07
Enhance TUI styles with a comprehensive color palette and new style d…
yinxulai May 16, 2026
3ed37ae
feat: 实现事件总线和任务管理功能,支持任务的创建、更新、删除及运行状态管理
yinxulai May 16, 2026
cf1bece
feat: add task detail and list pages with wizard for task creation an…
yinxulai May 16, 2026
8ce078c
feat: add task wizard for creating and editing tasks with user-friend…
yinxulai May 16, 2026
3e1eeaf
refactor: remove display package and related tests
yinxulai May 16, 2026
f9e48f7
feat: 重构页面布局,添加最小尺寸保护和通用页面结构
yinxulai May 17, 2026
225b775
Refactor TUI components for improved usability and aesthetics
yinxulai May 17, 2026
6c592cc
refactor: 移除仪表板和任务详情页面的状态标识,简化页面布局
yinxulai May 17, 2026
35b9950
feat: Enhance request and response handling in client and server
yinxulai May 17, 2026
53c7796
feat: 支持系统提示和用户提示的请求处理,增强请求构建逻辑
yinxulai May 17, 2026
92fac50
feat: 优化进度条显示逻辑,添加数据加载提示,增强向导字段定义
yinxulai May 17, 2026
54ed8f8
feat: 添加任务超时配置,优化任务创建和编辑
yinxulai May 17, 2026
b9f3fb9
feat: 增强任务详情页的上下文条,添加任务正在运行时的状态处理
yinxulai May 17, 2026
c4b016c
feat: 增强报告数据的 JSON 反序列化,支持时间字段的解析和加载
yinxulai May 18, 2026
f81b783
Refactor task management to use individual JSON files for persistence
yinxulai May 19, 2026
ed738c3
feat: 重构任务管理,支持任务视图和错误处理,优化任务列表加载
yinxulai May 19, 2026
7dc5ec3
feat: Add proxy support for HTTP clients and update related components
yinxulai May 20, 2026
a77cceb
feat: 更新 PromptSource 结构,优化系统消息处理和生成内容逻辑
yinxulai May 20, 2026
61c14b6
feat: 增强 Anthropic 客户端,支持缓存控制和输入 token 统计,优化生成提示逻辑
yinxulai May 20, 2026
4022621
Add tests and refactor TUI page layouts for improved structure and st…
yinxulai May 20, 2026
c479d16
feat: 重构页面布局和渲染逻辑,优化面板尺寸计算和内容包装
yinxulai May 20, 2026
53870b8
feat: 优化仪表盘请求列表和任务详情导航逻辑,避免历史路径循环
yinxulai May 20, 2026
968b7e1
feat: 更新导航逻辑以支持任务详情返回,优化 API 密钥掩码处理
yinxulai May 20, 2026
37fa0e3
feat: 更新任务列表渲染逻辑,调整列宽以适应内容
yinxulai May 20, 2026
eddd5ac
feat: 添加代理配置页面及相关逻辑,支持全局 HTTP 代理设置
yinxulai May 20, 2026
2033134
feat: 更新 ResponsesAPIRequest 结构,添加 Instructions 和 Store 字段
yinxulai May 20, 2026
3da552a
feat: 更新任务列表刷新逻辑,保持光标指向当前选中任务
yinxulai May 21, 2026
caea313
feat: 更新请求体结构,添加请求和响应体字段,优化代理配置页面输入逻辑
yinxulai May 21, 2026
9fdb75a
refactor: migrate to lipgloss v2 and improve layout handling
yinxulai May 22, 2026
a1d64c6
feat: 添加批量创建任务功能及相关界面逻辑
yinxulai May 23, 2026
98a3b04
refactor: 移除批量创建任务相关代码,简化任务创建逻辑
yinxulai May 23, 2026
56067ac
feat: 添加原始请求体支持,更新相关逻辑以处理不同的提示模式
yinxulai May 23, 2026
c50a781
feat: 添加 TurboConfig 支持,更新运行状态和界面以反映并发级别
yinxulai May 23, 2026
9a32fa8
feat: 更新状态提示逻辑,优化任务选择和输入字段处理
yinxulai May 23, 2026
b5aa6f1
feat: 更新任务和仪表板界面,优化列宽和显示内容,添加成功率和耗时信息
yinxulai May 23, 2026
d5e937c
Refactor metrics mapping and enhance TUI table rendering
yinxulai May 23, 2026
6ad91f5
feat: 调整仪表板和 TurboDash 列宽,更新显示内容以支持输入和输出信息
yinxulai May 23, 2026
d99f53d
fix: 修正性能面板中“令牌”标签为“Token”
yinxulai May 23, 2026
4d95e57
feat: 重构进度条渲染逻辑,简化代码并提升可读性
yinxulai May 23, 2026
3dc70de
feat: 重构仪表盘和 TurboDash 运行状态逻辑,简化代码并增强可读性;添加运行指标显示功能
yinxulai May 23, 2026
4829c97
feat: 更新运行指标显示,修改列标题为“均值TTFT”和“均值TPS”,增强可读性
yinxulai May 23, 2026
a8a9025
feat: 添加帮助页功能,支持帮助内容的渲染与导航
yinxulai May 23, 2026
c4fe89d
feat: 添加 RPM 和 TPM 指标计算,增强性能报告和仪表盘显示
yinxulai May 23, 2026
71a5c60
feat: 更新热键渲染,添加时间戳和项目链接,增强界面信息展示
yinxulai May 23, 2026
1918180
feat(i18n): add Chinese/English UI string translations with support f…
yinxulai May 24, 2026
865a4d8
feat(i18n): 添加语言切换功能,支持通过命令行参数和快捷键切换界面语言
yinxulai May 24, 2026
bd8b4d3
feat(i18n): 更新快捷键提示,优化用户界面交互体验
yinxulai May 24, 2026
9401194
feat(i18n): 动态调整任务详情和任务列表的列宽,确保多语言支持下的界面适配
yinxulai May 24, 2026
04cae00
feat: 更新文档格式,优化命令行参数和示例输出,增强可读性
yinxulai May 25, 2026
06ae14f
fix: 修复 Go 环境设置,使用 go.mod 文件指定 Go 版本
yinxulai May 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: 设置 Go 环境
uses: actions/setup-go@v4
with:
go-version: '1.22'
go-version-file: 'go.mod'

- name: 运行测试并生成覆盖率报告
run: go test -v -race -coverprofile=coverage.txt ./...
Expand Down
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 项目配置
BINARIES=ait tpg
BINARY=ait
BIN_DIR=bin

# Go 相关变量
Expand All @@ -10,7 +10,10 @@ GOTEST=$(GOCMD) test
GOMOD=$(GOCMD) mod

# 构建标志
LDFLAGS=-ldflags "-w -s"
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
GIT_COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
BUILD_TIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS=-ldflags "-w -s -X main.Version=$(VERSION) -X main.GitCommit=$(GIT_COMMIT) -X main.BuildTime=$(BUILD_TIME)"
BUILD_FLAGS=-trimpath $(LDFLAGS)

## help: 显示此帮助信息
Expand All @@ -19,15 +22,25 @@ help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'

## build: 构建所有二进制文件
## build: 构建当前平台二进制
.PHONY: build
build:
@echo "正在构建所有二进制文件..."
@echo "正在构建 $(BINARY)..."
@mkdir -p $(BIN_DIR)
@for binary in $(BINARIES); do \
echo "构建 $$binary..."; \
$(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$$binary ./cmd/$$binary/; \
done
$(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY) ./cmd/$(BINARY)/

## build-all: 交叉编译所有平台
.PHONY: build-all
build-all:
@echo "正在交叉编译所有平台..."
@mkdir -p $(BIN_DIR)
GOOS=linux GOARCH=amd64 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-linux-amd64 ./cmd/$(BINARY)/
GOOS=linux GOARCH=arm64 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-linux-arm64 ./cmd/$(BINARY)/
GOOS=linux GOARCH=386 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-linux-386 ./cmd/$(BINARY)/
GOOS=linux GOARCH=arm $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-linux-arm ./cmd/$(BINARY)/
GOOS=darwin GOARCH=amd64 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-darwin-amd64 ./cmd/$(BINARY)/
GOOS=darwin GOARCH=arm64 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-darwin-arm64 ./cmd/$(BINARY)/
GOOS=windows GOARCH=amd64 $(GOBUILD) $(BUILD_FLAGS) -o $(BIN_DIR)/$(BINARY)-windows-amd64.exe ./cmd/$(BINARY)/

## test: 运行所有测试
.PHONY: test
Expand Down
55 changes: 28 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,26 +306,27 @@ ait --models=gpt-4,claude-3-sonnet --prompt-file="test_prompts/*.txt" --count=20

## 📋 命令行参数

| 参数 | 描述 | 默认值 | 必填 |
|:---------------|:-------------------------------------------------------------|:--------------------------|:----:|
| `--version` | 显示版本信息(包括 Git Commit 和构建时间) | - | ❌ |
| `--protocol` | 协议类型 (`openai`/`anthropic`) | 根据环境变量自动推断 | ❌ |
| `--baseUrl` | 服务地址<br/>支持环境变量:`OPENAI_BASE_URL` 或 `ANTHROPIC_BASE_URL` | - | ✅ |
| `--apiKey` | API 密钥<br/>支持环境变量:`OPENAI_API_KEY` 或 `ANTHROPIC_API_KEY` | - | ✅ |
| `--model` | 单个模型名称<br/>如:`gpt-4`(不支持多个模型) | - | ❌ |
| `--models` | 模型名称,支持多个模型用逗号分割<br/>如:`gpt-4,claude-3-sonnet` | - | ✅ |
| `--concurrency`| 并发数 | `3` | ❌ |
| `--count` | 请求总数 | `10` | ❌ |
| `--timeout` | 请求超时时间(秒) | `300` | ❌ |
| `--prompt` | 测试提示语(直接输入字符串)<br/>如:`"分析人工智能的发展前景"` | `"你好,介绍一下你自己。"` | ❌ |
| `--prompt-file`| 从文件读取 prompt<br/>**支持多种模式**:<br/>• 单文件:`"prompts/test.txt"`<br/>• 通配符:`"prompts/*.txt"`<br/>• 相对/绝对路径均可 | - | ❌ |
| `--prompt-length`| 生成指定字符长度的测试 prompt<br/>**快速测试功能**:无需准备文件即可生成测试内容<br/>• 优先级高于其他 prompt 参数<br/>• 生成有意义的中文文本片段 | `0`(不启用) | ❌ |
| `--stream` | 是否开启流模式 | `true` | ❌ |
| `--thinking` | 是否开启思考模式(仅 OpenAI 协议支持) | `false` | ❌ |
| `--log` | 是否开启详细日志记录 | `false` | ❌ |
| `--report` | 是否生成报告文件(同时生成 JSON 和 CSV) | `false` | ❌ |
| 参数 | 描述 | 默认值 | 必填 |
| :--- | :--- | :--- | :---: |
| `--version` | 显示版本信息(包括 Git Commit 和构建时间) | - | ❌ |
| `--protocol` | 协议类型 (`openai`/`anthropic`) | 根据环境变量自动推断 | ❌ |
| `--baseUrl` | 服务地址<br/>支持环境变量:`OPENAI_BASE_URL` 或 `ANTHROPIC_BASE_URL` | - | ✅ |
| `--apiKey` | API 密钥<br/>支持环境变量:`OPENAI_API_KEY` 或 `ANTHROPIC_API_KEY` | - | ✅ |
| `--model` | 单个模型名称<br/>如:`gpt-4`(不支持多个模型) | - | ❌ |
| `--models` | 模型名称,支持多个模型用逗号分割<br/>如:`gpt-4,claude-3-sonnet` | - | ✅ |
| `--concurrency` | 并发数 | `3` | ❌ |
| `--count` | 请求总数 | `10` | ❌ |
| `--timeout` | 请求超时时间(秒) | `300` | ❌ |
| `--prompt` | 测试提示语(直接输入字符串)<br/>如:`"分析人工智能的发展前景"` | `"你好,介绍一下你自己。"` | ❌ |
| `--prompt-file` | 从文件读取 prompt<br/>**支持多种模式**:<br/>• 单文件:`"prompts/test.txt"`<br/>• 通配符:`"prompts/*.txt"`<br/>• 相对/绝对路径均可 | - | ❌ |
| `--prompt-length` | 生成指定字符长度的测试 prompt<br/>**快速测试功能**:无需准备文件即可生成测试内容<br/>• 优先级高于其他 prompt 参数<br/>• 生成有意义的中文文本片段 | `0`(不启用) | ❌ |
| `--stream` | 是否开启流模式 | `true` | ❌ |
| `--thinking` | 是否开启思考模式(仅 OpenAI 协议支持) | `false` | ❌ |
| `--log` | 是否开启详细日志记录 | `false` | ❌ |
| `--report` | 是否生成报告文件(同时生成 JSON 和 CSV) | `false` | ❌ |

**注意**:

- `--model` 和 `--models` 不能同时使用。使用 `--model` 测试单个模型,使用 `--models` 测试多个模型
- prompt 参数优先级:`--prompt-length` > `--prompt-file` > `--prompt` > 管道输入 > 默认值

Expand All @@ -343,7 +344,7 @@ ait --models=gpt-4,claude-3-sonnet --prompt-file="test_prompts/*.txt" --count=20

### 单模型详细报告示例

```
```text
┌──────────────────┬──────────┬──────────┬──────────┬──────────┬────────┬────────────────────────────┐
│ 指标 │ 最小值 │ 平均值 │ 标准差 │ 最大值 │ 单位 │ 采样方式说明 │
├──────────────────┼──────────┼──────────┼──────────┼──────────┼────────┼────────────────────────────┤
Expand All @@ -356,7 +357,7 @@ ait --models=gpt-4,claude-3-sonnet --prompt-file="test_prompts/*.txt" --count=20

### 多模型对比报告示例

```
```text
┌────────────────┬──────────┬────────┬──────────┬────────────┬─────────────┬────────────────┬────────────────┬──────────────────┐
│ 🤖 模型 │ 📊 请求数│ ⚡ 并发│ ✅ 成功率│ 🕐 平均总耗时│ ⚡ 平均 TTFT │ 🚀 平均输出 TPS│ 🌐 平均吞吐 TPS│ 🎲 平均输出Token数│
├────────────────┼──────────┼────────┼──────────┼────────────┼─────────────┼────────────────┼────────────────┼──────────────────┤
Expand Down Expand Up @@ -581,13 +582,13 @@ ait \

### tpg 参数说明

| 参数 | 描述 | 默认值 |
|:-----------|:------------------------------------------|:-----------|
| `-count` | 生成的 prompt 数量 | `10` |
| `-length` | 每个 prompt 的近似长度(字符数) | `50` |
| `-output` | 输出目录 | `prompts` |
| `-template`| 模板字符串,支持占位符 | 无 |
| `-help` | 显示帮助信息 | - |
| 参数 | 描述 | 默认值 |
| :--- | :--- | :--- |
| `-count` | 生成的 prompt 数量 | `10` |
| `-length` | 每个 prompt 的近似长度(字符数) | `50` |
| `-output` | 输出目录 | `prompts` |
| `-template` | 模板字符串,支持占位符 | 无 |
| `-help` | 显示帮助信息 | - |

### 模板占位符

Expand Down
Loading
Loading