Skip to content
Back to skills

760 Quickstart E9fc2977

ASecurity

5 分钟上手 OpenViking。

  • 9 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 11, 2026
ai-agentspythonbashgitapi

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 760-quickstart_e9fc2977 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 760 Quickstart E9fc2977?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 760 Quickstart E9fc2977
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-760-quickstart-e9fc2977/badge)](https://www.skillsdirectory.com/skills/tools-only-760-quickstart-e9fc2977)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# 快速开始

5 分钟上手 OpenViking。

## 前置要求

在开始使用 OpenViking 之前,请确保您的环境满足以下要求:

- **Python 版本**:3.9 或更高版本
- **操作系统**:Linux、macOS、Windows
- **网络连接**:需要稳定的网络连接(用于下载依赖包和访问模型服务)

## 安装

```bash
pip install openviking
```

## 模型准备

OpenViking 需要以下模型能力:
- **VLM 模型**:用于图像和内容理解
- **Embedding 模型**:用于向量化和语义检索

OpenViking 支持多种模型服务:
- **火山引擎(豆包模型)**:推荐使用,成本低、性能好,新用户有免费额度。如需购买和开通,请参考:[火山引擎购买指南](../configuration/volcengine-purchase-guide.md)
- **OpenAI 模型**:支持 GPT-4V 等 VLM 模型和 OpenAI Embedding 模型
- **其他自定义模型服务**:支持兼容 OpenAI API 格式的模型服务

## 配置环境

### 配置文件模版

创建配置文件 `ov.conf`:

```json
{
  "embedding": {
    "dense": {
      "api_base" : "<api-endpoint>",
      "api_key"  : "<your-api-key>",
      "provider" : "<provider-type>",
      "dimension": 1024,
      "model"    : "<model-name>"
    }
  },
  "vlm": {
    "api_base" : "<api-endpoint>",
    "api_key"  : "<your-api-key>",
    "provider" : "<provider-type>",
    "model"    : "<model-name>"
  }
}
```

### 配置示例

<details>
<summary><b>示例 1:使用火山引擎(豆包模型)</b></summary>

```json
{
  "embedding": {
    "dense": {
      "api_base" : "https://ark.cn-beijing.volces.com/api/v3",
      "api_key"  : "your-volcengine-api-key",
      "provider" : "volcengine",
      "dimension": 1024,
      "model"    : "doubao-embedding-vision-250615"
    }
  },
  "vlm": {
    "api_base" : "https://ark.cn-beijing.volces.com/api/v3",
    "api_key"  : "your-volcengine-api-key",
    "provider" : "volcengine",
    "model"    : "doubao-seed-1-8-251228"
  }
}
```

</details>

<details>
<summary><b>示例 2:使用 OpenAI 模型</b></summary>

```json
{
  "embedding": {
    "dense": {
      "api_base" : "https://api.openai.com/v1",
      "api_key"  : "your-openai-api-key",
      "provider" : "openai",
      "dimension": 3072,
      "model"    : "text-embedding-3-large"
    }
  },
  "vlm": {
    "api_base" : "https://api.openai.com/v1",
    "api_key"  : "your-openai-api-key",
    "provider" : "openai",
    "model"    : "gpt-4-vision-preview"
  }
}
```

</details>

### 设置环境变量

创建好配置文件后,设置环境变量指向配置文件:

```bash
export OPENVIKING_CONFIG_FILE=ov.conf
```

## 运行第一个示例

### 创建 Python 脚本

创建 `example.py`:

```python
import openviking as ov

# Initialize OpenViking client with data directory
client = ov.OpenViking(path="./data")

try:
    # Initialize the client
    client.initialize()

    # Add resource (supports URL, file, or directory)
    add_result = client.add_resource(
        path="https://raw.githubusercontent.com/volcengine/OpenViking/refs/heads/main/README.md"
    )
    root_uri = add_result['root_uri']

    # Explore the resource tree structure
    ls_result = client.ls(root_uri)
    print(f"Directory structure:\n{ls_result}\n")

    # Use glob to find markdown files
    glob_result = client.glob(pattern="**/*.md", uri=root_uri)
    if glob_result['matches']:
        content = client.read(glob_result['matches'][0])
        print(f"Content preview: {content[:200]}...\n")

    # Wait for semantic processing to complete
    print("Wait for semantic processing...")
    client.wait_processed()

    # Get abstract and overview of the resource
    abstract = client.abstract(root_uri)
    overview = client.overview(root_uri)
    print(f"Abstract:\n{abstract}\n\nOverview:\n{overview}\n")

    # Perform semantic search
    results = client.find("what is openviking", target_uri=root_uri)
    print("Search results:")
    for r in results.resources:
        print(f"  {r.uri} (score: {r.score:.4f})")

    # Close the client
    client.close()

except Exception as e:
    print(f"Error: {e}")
```

### 运行脚本

```bash
python example.py
```

### 预期输出

```
Directory structure:
...

Content preview: ...

Wait for semantic processing...
Abstract:
...

Overview:
...

Search results:
  viking://resources/... (score: 0.8523)
  ...
```

恭喜!你已成功运行 OpenViking。

## 下一步

- [配置详解](../configuration/configuration.md) - 详细配置选项
- [客户端 API](../api/01-client.md) - 客户端使用指南
- [资源管理](../api/02-resources.md) - 资源管理 API

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…