> 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/cha-jian-yu-ji-cheng/web-plugins/playcanvas-plugin/adding-external-script.md).

# 添加外部脚本

添加外部脚本——Convai 集成的 PlayCanvas 插件指南。

在这里我们将添加 [Convai Web SDK](https://www.npmjs.com/package/convai-web-sdk) 到我们的项目中，它是一个用于实现对话式 AI 功能集成的 JavaScript 库。

1. 登录后创建一个空白项目。
2. 在 SETTINGS 面板中打开设置部分。
3. 将 Array Size 增加到 1，以添加 1 个外部脚本。
4. 添加 [Convai web-sdk-cdn](https://github.com/Conv-AI/web-sdk-cdn) 在 url 部分中的链接。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2F2rfzZ2InTV4sd7fOpeWQ%2FScreenshot%20(18).png?alt=media&amp;token=4ffb3e38-e8c2-419a-97c9-5987d05d09c0" alt=""><figcaption><p>空白项目</p></figcaption></figure>

### ![](https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FCrAEuZ8JswYIdzoEqxdr%2FScreenshot%20\(19\).png?alt=media\&token=7049caa6-c1a8-41d0-9201-941ec6ad3827)


---

# 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/cha-jian-yu-ji-cheng/web-plugins/playcanvas-plugin/adding-external-script.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.
