> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/convai-playground/get-started/character-versioning.md).

# 角色版本管理

管理角色的多个版本，并根据需要在它们之间切换。

## 简介

在本节中，我们将介绍角色版本管理，即维护角色的不同状态。这样，用户就可以在尝试更多更改之前保留一个先前的稳定状态。现在你可以放心地进行试验，而不用担心丢失角色的旧状态；如果你想放弃当前更改并返回到先前的版本，现在也可以恢复该版本，并从那里继续工作。我们将这些保存下来的状态称为 **快照** 角色的快照。

本节将介绍这些功能及其使用方法。

{% hint style="info" %}
这个概念 **快照** 和 **版本** 在文中可互换使用；不过，它们指的是同一个概念：在特定时间点定义角色的状态/内容。
{% endhint %}

***

## 概述

角色版本管理选项位于角色编辑器区域的右上角，紧挨着 **Update** 按钮

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fl2rY9dv4kT54lCOi7hob%2Fcv-1.png?alt=media&amp;token=38fd70af-e4c3-4e2b-af1d-03e867d4f984" alt=""><figcaption></figcaption></figure>

点击后，你就能看到按日期排序的所有先前已保存修订版本列表。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FxmskYVPB5I7mmzBbJbFS%2F2.png?alt=media" alt=""><figcaption><p>角色版本管理部分。这里还没有快照。</p></figcaption></figure>

在下一节中，我们将从零开始介绍创建和维护快照的步骤。

***

## 创建版本

让我们从一个已经保存的角色开始。打开角色相关详情时看到的数据表示 **当前快照** 角色的状态。当你与角色交互时，本质上是在引用此快照中的所有数据 **当前快照** 角色的快照。

1. 要创建新版本，首先打开 **角色版本管理** 部分，然后点击 **+ 添加快照** 顶部的符号。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FO87OyqDP1i9rf19iL3fZ%2Fcv-3.png?alt=media&amp;token=375c0149-695d-4336-9f93-d590d85db20d" alt=""><figcaption><p>让我们创建第一个快照。</p></figcaption></figure>
2. 会弹出一个窗口，要求你为快照填写名称和描述。请注意， **快照名称** 是创建新版本的必填字段。填写完详细信息后，点击 **提交** 按钮。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F27CIDJfBUMezGcpfq1av%2Fcv-4.png?alt=media&amp;token=1258c8a2-d2ab-4594-b50b-9401ff18e3fd" alt=""><figcaption><p>我们填写一个名称和简短描述。</p></figcaption></figure>
3. 现在，你可以在快照列表中看到新版本。那这个版本实际上代表什么呢？\
   这个快照存储了该时刻与角色相关的所有数据。角色的所有信息，从角色描述、化身到知识库文件、叙事设计结构以及其他细节，都会被保存在其中。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fa6jlIoKtz12aF63UtakB%2Fcv-5.png?alt=media&amp;token=7abd0b8e-754c-40e7-ba8d-69b2336dae15" alt=""><figcaption><p>快照出现在列表中</p></figcaption></figure>

***

## 恢复版本

假设你继续对该角色进行了进一步编辑，但你对结果不满意，想返回并从之前的版本开始。这时，你可以将旧快照恢复到当前状态，并再次使用它们。以下是要遵循的步骤：

1. 要恢复某个版本，请打开 **角色版本管理** 部分，并选择你要恢复的快照。你会看到 **恢复版本** 下方的按钮变为可用。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FRb8XT0vbcTa5rhQDto09%2Fcv-6.png?alt=media&amp;token=b06cf47b-110e-4fab-b87b-de1a7ee5173e" alt=""><figcaption><p>我们将恢复第一个快照中的数据。</p></figcaption></figure>
2. 一旦你点击 **恢复版本** 按钮，就会弹出一个窗口，询问你是否要将当前更改保存为新的快照，还是将其丢弃。你也可以选择把当前更改保存为某个测试版本，以便日后再参考。<br>

   <figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FvR0Zd5Wm6HPTpTGGL6bC%2Fcv-7.png?alt=media&amp;token=1bb36dd2-daa8-44b5-af6d-11d80a1bede0" alt=""><figcaption><p>让我们直接将快照中的数据恢复到当前快照</p></figcaption></figure>
3. 目前，我们打算放弃这些更改，因此我们将点击 **恢复** 按钮。这样就会把所选版本中的数据带回到 **当前快照** 角色的快照。
4. 要保存这些更改，你始终可以 **取消** 并返回，带着你的进度创建一个新的快照，并恢复它。

***

## 删除快照

你也可以删除不再需要的快照。为此，你可以点击角色版本列表中对应快照旁边的三点菜单，并选择 **删除版本**

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fum3kJwDnlCD5I5oXEcRH%2F8.png?alt=media" alt=""><figcaption><p>点击快照旁边的三点菜单即可查看所有选项。</p></figcaption></figure>

### 一些需要记住的重要事项

在任何时候，你都可以与 **当前快照** 角色的当前版本进行交互。如果你有任何公开可用并使用该角色的应用，用户将只能与这个当前版本交互。

{% hint style="info" %}
我们目前正在开发一项功能，帮助开发者拥有独立的部署版本，而不是 **当前快照**.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/zh/convai-playground/get-started/character-versioning.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
