OpenViking 火山引擎配置完成摘要

✅ 已完成配置

1. 基础环境

  • Python 版本: 3.10.16 ✅
  • OpenViking SDK: 0.1.2 ✅
  • 配置文件: ~/.openviking/ov.conf ✅

2. 配置信息

{
  "storage": {
    "workspace": "D:/openviking_workspace"
  },
  "log": {
    "level": "INFO",
    "output": "stdout"
  },
  "embedding": {
    "dense": {
      "backend": "volcengine",
      "api_key": "YOUR_API_KEY_HERE",
      "model": "doubao-embedding-vision-251215",
      "api_base": "https://ark.cn-beijing.volces.com/api/coding/v3",
      "dimension": 1024,
      "input": "multimodal"
    }
  },
  "vlm": {
    "backend": "volcengine",
    "api_key": "YOUR_API_KEY_HERE",
    "model": "doubao-seed-2-0-pro-260215",
    "api_base": "https://ark.cn-beijing.volces.com/api/coding/v3",
    "temperature": 0.1,
    "max_retries": 3
  }
}

📋 待完成步骤

1. 获取火山引擎 API Key

2. 激活所需模型

3. 更新配置文件

  • 文件位置: ~/.openviking/ov.conf
  • 操作: 将 YOUR_API_KEY_HERE 替换为你的实际 API Key
  • 方法:
    # 使用配置工具
    python3 configure_openviking.py
    
    # 或手动编辑
    notepad ~/.openviking/ov.conf
    

4. 设置环境变量

  • Windows PowerShell:
    $env:OPENVIKING_CONFIG_FILE = "$HOME/.openviking/ov.conf"
    
  • Linux/macOS:
    export OPENVIKING_CONFIG_FILE=~/.openviking/ov.conf
    

🚀 快速开始

1. 配置 API Key

python3 configure_openviking.py

2. 验证配置

python3 verify_openviking_config.py

3. 运行使用示例

python3 openviking_usage_examples.py

4. 基本使用代码

import openviking as ov

# 初始化客户端
client = ov.OpenViking(path="./data")
client.initialize()

# 添加资源
add_result = client.add_resource(
    path="https://raw.githubusercontent.com/volcengine/OpenViking/refs/heads/main/README.md"
)
root_uri = add_result['root_uri']

# 查看目录结构
ls_result = client.ls(root_uri)
print(f"Directory structure:\n{ls_result}\n")

# 等待语义处理
print("Wait for semantic processing...")
client.wait_processed()

# 获取摘要和概览
abstract = client.abstract(root_uri)
overview = client.overview(root_uri)

print(f"L0 Abstract:\n{abstract}\n")
print(f"L1 Overview:\n{overview[:500]}...\n")

# 语义搜索
results = client.find("what is openviking", target_uri=root_uri)
print(f"Search results:\n{results}\n")

# 断开连接
client.disconnect()

📚 相关文档

  • 完整配置指南: OpenViking_火山引擎配置指南.md
  • 快速开始: OpenViking_快速开始.md
  • 使用示例: openviking_usage_examples.py
  • 配置验证: verify_openviking_config.py
  • API Key 配置工具: configure_openviking.py

🔧 故障排除

常见问题

  1. API Key 无效

    • 确保 API Key 以 sk- 开头
    • 从正确的区域页面获取
    • 检查是否过期
  2. 模型未激活

    • 前往模型管理页面确认模型已激活
    • 使用正确的模型 ID
  3. 网络连接问题

    • 检查防火墙设置
    • 确认 API Base URL 正确
    • 尝试使用代理
  4. 安装失败

    • 确保 Python 版本 >= 3.10
    • 使用国内镜像源
    • 清除缓存后重新安装

联系支持

🎉 配置状态

  • Python 环境检查
  • OpenViking SDK 安装
  • 配置文件创建
  • API Key 配置
  • 模型激活
  • 环境变量设置
  • 连接测试

完成以上所有步骤后,你就可以开始使用 OpenViking 了!

← 返回文章列表