Skip to content

Latest commit

 

History

History
194 lines (128 loc) · 5.61 KB

File metadata and controls

194 lines (128 loc) · 5.61 KB

AskOnce 快速开始指南 / Getting Started Guide

文档版本 / Document Version: 1.1 创建日期 / Created: 2026-03-07

本指南将帮助你快速启动和运行 AskOnce 项目。

This guide will help you quickly start and run the AskOnce project.


目录 / Table of Contents

  1. 前置要求 / Prerequisites
  2. 快速开始 / Quick Start
  3. 环境变量配置 / Environment Variables
  4. 使用指南 / Usage Guide
  5. 故障排除 / Troubleshooting
  6. 了解更多 / Learn More

1. 前置要求 / Prerequisites

必需 / Required

  • Node.js: >= 18.0.0
  • npm: >= 9.0.0
  • Python: >= 3.10 (用于 Python 后端 / for Python backend)

可选 / Optional

  • Docker: 用于容器化部署 / For containerized deployment
  • API Keys: 用于调用 AI 模型 / For calling AI models

2. 快速开始 / Quick Start

方式一:Web 应用 (推荐) / Method 1: Web Application (Recommended)

# 1. 克隆仓库 / Clone repository
git clone https://github.com/linuxhsj/askonce.git
cd askonce

# 2. 安装依赖 / Install dependencies
cd frontend && npm install
cd ../backend/node && npm install

# 3. 配置环境变量 / Configure environment variables
cp .env.example .env
# 编辑 .env 文件,添加你的 API Keys / Edit .env file, add your API Keys

# 4. 启动后端 / Start backend
npm run dev

# 5. 启动前端 (新终端) / Start frontend (new terminal)
cd ../../frontend && npm run dev

访问 / Visit: http://localhost:3000

方式二:Docker 部署 / Method 2: Docker Deployment

# 1. 克隆仓库 / Clone repository
git clone https://github.com/linuxhsj/askonce.git
cd askonce

# 2. 配置环境变量 / Configure environment variables
cp .env.example .env
# 编辑 .env 文件,添加你的 API Keys / Edit .env file, add your API Keys

# 3. 启动所有服务 / Start all services
docker-compose up -d

# 4. 访问 / Access
# 前端 / Frontend: http://localhost:3000
# 后端 / Backend: http://localhost:8000

方式三:浏览器扩展 / Method 3: Browser Extension

# 1. 克隆仓库 / Clone repository
git clone https://github.com/linuxhsj/askonce.git
cd askonce

# 2. 打开 Chrome,访问 chrome://extensions/
#    Open Chrome, visit chrome://extensions/

# 3. 启用"开发者模式" / Enable "Developer mode"

# 4. 点击"加载已解压的扩展程序" / Click "Load unpacked"

# 5. 选择 extension/ 目录 / Select extension/ directory

3. 环境变量配置 / Environment Variables Configuration

创建 .env 文件 / Create .env file:

# OpenAI API (必需至少一个 / At least one required)
OPENAI_API_KEY=sk-xxx
ANTHROPIC_API_KEY=sk-ant-xxx
DEEPSEEK_API_KEY=sk-xxx

# OpenRouter (可选,用于更多模型 / Optional, for more models)
OPENROUTER_API_KEY=sk-or-xxx

# 其他 / Others
GOOGLE_API_KEY=xxx
XAI_API_KEY=xxx

# 服务配置 / Service Configuration
PORT=8000
MAX_CONCURRENT=10
DEFAULT_TIMEOUT=60000

4. 使用指南 / Usage Guide

1. 选择模型 / Select Models

在模型选择区域,你可以 / In the model selection area, you can:

  • 点击分组标题展开/折叠 / Click group header to expand/collapse
  • 点击复选框选择/取消选择模型 / Click checkbox to select/deselect models
  • 使用"全选"和"取消全选"按钮 / Use "Select All" and "Deselect All" buttons

2. 输入问题 / Enter Question

在文本框中输入你的问题,支持 / Enter your question in the text box, supports:

  • 多行文本 / Multi-line text
  • 代码块 / Code blocks
  • Markdown 格式 / Markdown format

3. 发送查询 / Send Query

点击"查询所有"按钮或按 Ctrl+Enter 发送。

Click "Query All" button or press Ctrl+Enter to send.

4. 查看结果 / View Results

  • 卡片模式 / Card Mode: 每个模型的回答独立展示 / Each model's response displayed independently
  • 并排模式 / Side-by-side Mode: 多个回答并排显示 / Multiple responses displayed side by side
  • 导出 / Export: 点击"导出"下载 Markdown 文件 / Click "Export" to download Markdown file

5. AI 评审 / AI Judge

查询完成后,点击"开始分析"使用 AI 评审功能。

After query completes, click "Start Analysis" to use AI judging feature.


5. 故障排除 / Troubleshooting

问题:API 请求失败 / Issue: API Request Failed

  1. 检查 API Key 是否正确配置 / Check if API Key is correctly configured
  2. 检查网络连接 / Check network connection
  3. 查看后端日志 / Check backend logs

问题:扩展无法加载 / Issue: Extension Cannot Load

  1. 确保扩展已正确加载 / Ensure extension is correctly loaded
  2. 检查是否启用了开发者模式 / Check if developer mode is enabled
  3. 查看扩展的错误日志 / Check extension error logs

问题:流式响应不工作 / Issue: Streaming Response Not Working

  1. 确保使用的是支持的浏览器 / Ensure using a supported browser
  2. 检查是否有代理或防火墙阻止 / Check if proxy or firewall is blocking

6. 了解更多 / Learn More


文档版本 / Document Version: v1.1 创建日期 / Created: 2026-03-07 作者 / Author: SeekSage