mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2026-01-19 09:01:48 +00:00
Compare commits
5 Commits
snowykami-
...
feat/strea
| Author | SHA1 | Date | |
|---|---|---|---|
| d75b468330 | |||
|
|
3fa1be27bc | ||
|
|
52d218fb8d | ||
|
|
35beecb819 | ||
| 780df08a65 |
10
.github/workflows/docs-build.yml
vendored
10
.github/workflows/docs-build.yml
vendored
@@ -1,6 +1,9 @@
|
|||||||
name: Deploy VitePress site to Liteyuki PaaS
|
name: Deploy VitePress site to Liteyuki PaaS
|
||||||
|
|
||||||
on: ["push", "pull_request_target"]
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@@ -25,7 +28,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v2
|
uses: actions/setup-python@v2
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: '3.11'
|
||||||
|
|
||||||
- name: Setup API markdown
|
- name: Setup API markdown
|
||||||
run: |-
|
run: |-
|
||||||
@@ -49,10 +52,11 @@ jobs:
|
|||||||
run: |-
|
run: |-
|
||||||
pnpm run docs:build
|
pnpm run docs:build
|
||||||
|
|
||||||
|
|
||||||
- name: "发布"
|
- name: "发布"
|
||||||
run: |
|
run: |
|
||||||
npx -p "@getmeli/cli" meli upload docs/.vitepress/dist \
|
npx -p "@getmeli/cli" meli upload docs/.vitepress/dist \
|
||||||
--url "https://pages.liteyuki.icu" \
|
--url "https://meli.liteyuki.icu" \
|
||||||
--site "$MELI_SITE" \
|
--site "$MELI_SITE" \
|
||||||
--token "$MELI_TOKEN" \
|
--token "$MELI_TOKEN" \
|
||||||
--release "$GITHUB_SHA"
|
--release "$GITHUB_SHA"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--suppress LongLine -->
|
<!--suppress LongLine -->
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://marsho.liteyuki.icu"><img src="https://marsho.liteyuki.icu/marsho-full.svg" width="800" height="430" alt="MarshoLogo"></a>
|
<a href="https://marshoai-docs.meli.liteyuki.icu"><img src="https://marshoai-docs.meli.liteyuki.icu/marsho-full.svg" width="800" height="430" alt="MarshoLogo"></a>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ _谁不喜欢回复消息快又可爱的猫娘呢?_
|
|||||||
|
|
||||||
## 😼 使用
|
## 😼 使用
|
||||||
|
|
||||||
请查看[使用文档](https://marsho.liteyuki.icu/start/use)
|
请查看[使用文档](https://marshoai-docs.meli.liteyuki.icu/start/use)
|
||||||
|
|
||||||
## ❤ 鸣谢&版权说明
|
## ❤ 鸣谢&版权说明
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!--suppress LongLine -->
|
<!--suppress LongLine -->
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://marsho.liteyuki.icu"><img src="https://marsho.liteyuki.icu/marsho-full.svg" width="800" height="430" alt="MarshoLogo"></a>
|
<a href="https://marshoai-docs.meli.liteyuki.icu"><img src="https://marshoai-docs.meli.liteyuki.icu/marsho-full.svg" width="800" height="430" alt="MarshoLogo"></a>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ Plugin internally installed the catgirl character of Marsho, is able to have a c
|
|||||||
- 🐾 Play! I like play with friends!
|
- 🐾 Play! I like play with friends!
|
||||||
|
|
||||||
## 😼 Usage
|
## 😼 Usage
|
||||||
Please read [Documentation](https://marsho.liteyuki.icu/start/install)
|
Please read [Documentation](https://marshoai-docs.meli.liteyuki.icu/start/install)
|
||||||
|
|
||||||
## ❤ Thanks&Copyright
|
## ❤ Thanks&Copyright
|
||||||
This project uses the following code from other projects:
|
This project uses the following code from other projects:
|
||||||
|
|||||||
@@ -8,13 +8,12 @@ import { generateSidebar } from 'vitepress-sidebar'
|
|||||||
// https://vitepress.dev/reference/site-config
|
// https://vitepress.dev/reference/site-config
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
head: [
|
head: [
|
||||||
["script", { src: "https://cdn.liteyuki.icu/js/liteyuki_footer.js" }],
|
|
||||||
['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
|
||||||
],
|
],
|
||||||
rewrites: {
|
rewrites: {
|
||||||
[`${defaultLang}/:rest*`]: ":rest*",
|
[`${defaultLang}/:rest*`]: ":rest*",
|
||||||
},
|
},
|
||||||
cleanUrls: false,
|
cleanUrls: true,
|
||||||
themeConfig: {
|
themeConfig: {
|
||||||
// https://vitepress.dev/reference/default-theme-config
|
// https://vitepress.dev/reference/default-theme-config
|
||||||
logo: {
|
logo: {
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ When nonebot linked to OneBot v11 adapter, can recieve double click and response
|
|||||||
MarshoTools is a feature added in `v0.5.0`, support loading external function library to provide Function Call for Marsho.
|
MarshoTools is a feature added in `v0.5.0`, support loading external function library to provide Function Call for Marsho.
|
||||||
|
|
||||||
## 🧩 Marsho Plugin
|
## 🧩 Marsho Plugin
|
||||||
Marsho Plugin is a feature added in `v1.0.0`, replacing the old MarshoTools feature. [Documentation](https://marsho.liteyuki.icu/dev/extension)
|
Marsho Plugin is a feature added in `v1.0.0`, replacing the old MarshoTools feature. [Documentation](https://marshoai-docs.meli.liteyuki.icu/dev/extension)
|
||||||
|
|
||||||
## 👍 Praise list
|
## 👍 Praise list
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ GitHub Models API 的限制较多,不建议使用,建议通过修改`MARSHOA
|
|||||||
|
|
||||||
## 🧩 小棉插件
|
## 🧩 小棉插件
|
||||||
|
|
||||||
小棉插件是`v1.0.0`的新增功能,替代旧的小棉工具功能。[使用文档](https://marsho.liteyuki.icu/dev/extension)
|
小棉插件是`v1.0.0`的新增功能,替代旧的小棉工具功能。[使用文档](https://marshoai-docs.meli.liteyuki.icu/dev/extension)
|
||||||
|
|
||||||
## 👍 夸赞名单
|
## 👍 夸赞名单
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ OPENAI_NEW_MODELS: list = [
|
|||||||
INTRODUCTION: str = f"""MarshoAI-NoneBot by LiteyukiStudio
|
INTRODUCTION: str = f"""MarshoAI-NoneBot by LiteyukiStudio
|
||||||
你好喵~我是一只可爱的猫娘AI,名叫小棉~🐾!
|
你好喵~我是一只可爱的猫娘AI,名叫小棉~🐾!
|
||||||
我的主页在这里哦~↓↓↓
|
我的主页在这里哦~↓↓↓
|
||||||
https://marsho.liteyuki.icu
|
https://marshoai-docs.meli.liteyuki.icu
|
||||||
|
|
||||||
※ 使用 「{config.marshoai_default_name}.status」命令获取状态信息。
|
※ 使用 「{config.marshoai_default_name}.status」命令获取状态信息。
|
||||||
※ 使用「{config.marshoai_default_name}.help」命令获取使用说明。"""
|
※ 使用「{config.marshoai_default_name}.help」命令获取使用说明。"""
|
||||||
|
|||||||
@@ -210,7 +210,10 @@ class MarshoHandler:
|
|||||||
tools_list=tools_list,
|
tools_list=tools_list,
|
||||||
tool_message=tool_message,
|
tool_message=tool_message,
|
||||||
)
|
)
|
||||||
choice = response.choices[0] # type: ignore
|
if isinstance(response, ChatCompletion):
|
||||||
|
choice = response.choices[0]
|
||||||
|
else:
|
||||||
|
raise ValueError("Unexpected response type")
|
||||||
# Sprint(choice)
|
# Sprint(choice)
|
||||||
# 当tool_calls非空时,将finish_reason设置为TOOL_CALLS
|
# 当tool_calls非空时,将finish_reason设置为TOOL_CALLS
|
||||||
if choice.message.tool_calls is not None and config.marshoai_fix_toolcalls:
|
if choice.message.tool_calls is not None and config.marshoai_fix_toolcalls:
|
||||||
@@ -308,8 +311,6 @@ class MarshoHandler:
|
|||||||
role="assistant",
|
role="assistant",
|
||||||
tool_calls=last_chunk.choices[0].delta.tool_calls, # type: ignore
|
tool_calls=last_chunk.choices[0].delta.tool_calls, # type: ignore
|
||||||
)
|
)
|
||||||
if reasoning_contents != "":
|
|
||||||
setattr(message, "reasoning_content", reasoning_contents)
|
|
||||||
choice = Choice(
|
choice = Choice(
|
||||||
finish_reason=last_chunk.choices[0].finish_reason, # type: ignore
|
finish_reason=last_chunk.choices[0].finish_reason, # type: ignore
|
||||||
index=last_chunk.choices[0].index,
|
index=last_chunk.choices[0].index,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ dependencies = [
|
|||||||
license = { text = "MIT, Mulan PSL v2" }
|
license = { text = "MIT, Mulan PSL v2" }
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Homepage = "https://marsho.liteyuki.icu/"
|
Homepage = "https://marshoai-docs.meli.liteyuki.icu/"
|
||||||
|
|
||||||
|
|
||||||
[tool.nonebot]
|
[tool.nonebot]
|
||||||
|
|||||||
Reference in New Issue
Block a user