diff --git a/README.md b/README.md index 28b626b..3cde65f 100644 --- a/README.md +++ b/README.md @@ -159,6 +159,93 @@ npm i npm run dev ``` +### 与人工智能集成 + +如果要在 UAI Editor 中使用 AI 功能,需要在初始化 UAIEditor 的时候配置相关的配置项: + +```js +new UAIEditor({ + element: "#uai-editor", + content: 'UAI Editor 是一个面向 AI 的、现代 UI 风格的下一代富文本编辑器。开箱即用、支持所有前端框架。', + ai: { // AI 配置项 + chat: { // 聊天配置项 + models: { // 模型配置项 + "default": { + modelType: 'openai', + baseUrl: 'https://open.bigmodel.cn/api/paas/v4', + apiKey: process.env.CHATGLM_APIKEY, + model: 'glm-4-flash' + }, + "GLM-4": { // 聊天功能选择使用的模型,配置智谱AI的GLM-4-Flash模型 + modelType: 'openai', + baseUrl: 'https://open.bigmodel.cn/api/paas/v4', + apiKey: process.env.CHATGLM_APIKEY, // 此处填写您智谱AI的 API Key + model: 'glm-4-flash' + }, + "InternLM2.5": { // 聊天功能选择使用的模型,配置上海人工智能实验室的InternLM2.5模型 + modelType: 'openai', + baseUrl: 'https://internlm-chat.intern-ai.org.cn/puyu/api/v1', + apiKey: process.env.INTERNLM_TOKEN, // 此处填写您上海人工智能实验室的 API Key + model: 'internlm2.5-latest' + }, + }, + }, + image: { // 图像配置项 + models: { // 模型配置项 + text2image: { // 文本生成图像模型配置项 + "default": { + modelType: 'openai', + baseUrl: 'https://open.bigmodel.cn/api/paas/v4', // images/generations + apiKey: process.env.CHATGLM_APIKEY, + model: 'cogview-3-flash' + }, + "CogView-3": { // 绘图功能选择使用的模型,配置智谱AI的CogView-3-Flash模型 + modelType: 'openai', + baseUrl: 'https://open.bigmodel.cn/api/paas/v4', // images/generations + apiKey: process.env.CHATGLM_APIKEY, // 此处填写您智谱AI的 API Key + model: 'cogview-3-flash' + }, + } + } + } + } +}) +``` + +## 帮助文档 + +UAI Editor 提供了一份使用文档,您可以通过以下方式访问: + +安装必要的软件`docsify`: + +```bash +npm i docsify -g +``` + +### 用户文档 + +启动文档服务: + +```bash +docsify serve docs/user --port 3010 +``` + +访问文档: + +[http://localhost:3010](http://localhost:3010)。 + +### 开发者文档 + +启动文档服务: + +```bash +docsify serve docs/developer --port 3020 +``` + +访问文档: + +[http://localhost:3020](http://localhost:3020)。 + ## 开源优势 * **免费使用:** 作为开源项目,UAI Editor 采用 [MIT 许可证](LICENSE) 对所有用户免费开放,无需担心版权问题。 diff --git a/index.html b/index.html index 119c8f1..74a3b02 100644 --- a/index.html +++ b/index.html @@ -14,7 +14,7 @@ -
+
diff --git a/src/components/menus/statusbar/Feedback.ts b/src/components/menus/statusbar/Feedback.ts index 6e02df3..187300f 100644 --- a/src/components/menus/statusbar/Feedback.ts +++ b/src/components/menus/statusbar/Feedback.ts @@ -50,7 +50,7 @@ export class Feedback extends HTMLElement implements UAIEditorEventListener { this.addEventListener("click", () => { if (this.menuButtonOptions.enable) { const anchor = document.createElement('a'); - anchor.href = "https://gitee.com/AI-Labs/uai-editor/issues"; + anchor.href = "https://gitee.com/uai-team/uai-editor/issues"; anchor.target = '_blank'; anchor.click(); } diff --git a/src/components/menus/statusbar/PoweredBy.ts b/src/components/menus/statusbar/PoweredBy.ts index 5f9ba14..b3c83bf 100644 --- a/src/components/menus/statusbar/PoweredBy.ts +++ b/src/components/menus/statusbar/PoweredBy.ts @@ -50,7 +50,7 @@ export class PoweredBy extends HTMLElement implements UAIEditorEventListener { this.addEventListener("click", () => { if (this.menuButtonOptions.enable) { const anchor = document.createElement('a'); - anchor.href = "https://wux-labs.github.io/UAI-Editor"; + anchor.href = "https://gitee.com/uai-team/uai-editor"; anchor.target = '_blank'; anchor.click(); } diff --git a/src/styles/uaieditor.less b/src/styles/uaieditor.less index c624e9b..3eca917 100644 --- a/src/styles/uaieditor.less +++ b/src/styles/uaieditor.less @@ -10,6 +10,7 @@ --td-text-color-disabled: var(--uai-text-color-disabled); width: 100%; height: 100%; + overflow: hidden; display: flex; flex-direction: column; color: var(--uai-text-color);