mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2025-08-02 14:49:51 +00:00
Deploying to docs from @ LiteyukiStudio/nonebot-plugin-marshoai@2afe3c48ce ๐
This commit is contained in:
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as t,ae as i,o as e}from"./chunks/framework.BzDBnRMZ.js";const c=JSON.parse('{"title":"config","description":"","frontmatter":{"title":"config","order":100},"headers":[],"relativePath":"dev/api/config.md","filePath":"zh/dev/api/config.md","lastUpdated":1734175019000}'),o={name:"dev/api/config.md"};function r(n,a,l,h,d,m){return e(),t("div",null,a[0]||(a[0]=[i("",50)]))}const k=s(o,[["render",r]]);export{c as __pageData,k as default};
|
||||
import{_ as s,c as t,ae as i,o as e}from"./chunks/framework.BzDBnRMZ.js";const c=JSON.parse('{"title":"config","description":"","frontmatter":{"title":"config","order":100},"headers":[],"relativePath":"dev/api/config.md","filePath":"zh/dev/api/config.md","lastUpdated":1738311067000}'),o={name:"dev/api/config.md"};function r(n,a,l,h,d,m){return e(),t("div",null,a[0]||(a[0]=[i("",50)]))}const k=s(o,[["render",r]]);export{c as __pageData,k as default};
|
1
assets/dev_api_index.md.DCRutF9O.js
Normal file
1
assets/dev_api_index.md.DCRutF9O.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as i,c as n,j as e,a as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const I=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/index.md","filePath":"zh/dev/api/index.md","lastUpdated":1734175019000}'),s={name:"dev/api/index.md"};function r(l,t,d,T,p,O){return a(),n("div",null,t[0]||(t[0]=[e("h1",{id:"ๆจกๅ-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"ๆจกๅ"),o(),e("code",null,"nonebot_plugin_marshoai"),o(),e("a",{class:"header-anchor",href:"#ๆจกๅ-nonebot-plugin-marshoai","aria-label":'Permalink to "**ๆจกๅ** `nonebot_plugin_marshoai`"'},"โ")],-1),e("p",null,"MIT License",-1),e("p",null,"Copyright (c) 2025 Asankilp & LiteyukiStudio",-1),e("p",null,'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:',-1),e("p",null,"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",-1),e("p",null,'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',-1)]))}const c=i(s,[["render",r]]);export{I as __pageData,c as default};
|
1
assets/dev_api_index.md.DCRutF9O.lean.js
Normal file
1
assets/dev_api_index.md.DCRutF9O.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as i,c as n,j as e,a as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const I=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/index.md","filePath":"zh/dev/api/index.md","lastUpdated":1734175019000}'),s={name:"dev/api/index.md"};function r(l,t,d,T,p,O){return a(),n("div",null,t[0]||(t[0]=[e("h1",{id:"ๆจกๅ-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"ๆจกๅ"),o(),e("code",null,"nonebot_plugin_marshoai"),o(),e("a",{class:"header-anchor",href:"#ๆจกๅ-nonebot-plugin-marshoai","aria-label":'Permalink to "**ๆจกๅ** `nonebot_plugin_marshoai`"'},"โ")],-1),e("p",null,"MIT License",-1),e("p",null,"Copyright (c) 2025 Asankilp & LiteyukiStudio",-1),e("p",null,'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:',-1),e("p",null,"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",-1),e("p",null,'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',-1)]))}const c=i(s,[["render",r]]);export{I as __pageData,c as default};
|
@ -1 +0,0 @@
|
||||
import{_ as t,c as o,j as e,a as n,o as r}from"./chunks/framework.BzDBnRMZ.js";const u=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/index.md","filePath":"zh/dev/api/index.md","lastUpdated":1734175019000}'),i={name:"dev/api/index.md"};function d(s,a,l,p,c,m){return r(),o("div",null,a[0]||(a[0]=[e("h1",{id:"ๆจกๅ-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"ๆจกๅ"),n(),e("code",null,"nonebot_plugin_marshoai"),n(),e("a",{class:"header-anchor",href:"#ๆจกๅ-nonebot-plugin-marshoai","aria-label":'Permalink to "**ๆจกๅ** `nonebot_plugin_marshoai`"'},"โ")],-1)]))}const h=t(i,[["render",d]]);export{u as __pageData,h as default};
|
@ -1 +0,0 @@
|
||||
import{_ as t,c as o,j as e,a as n,o as r}from"./chunks/framework.BzDBnRMZ.js";const u=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/index.md","filePath":"zh/dev/api/index.md","lastUpdated":1734175019000}'),i={name:"dev/api/index.md"};function d(s,a,l,p,c,m){return r(),o("div",null,a[0]||(a[0]=[e("h1",{id:"ๆจกๅ-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"ๆจกๅ"),n(),e("code",null,"nonebot_plugin_marshoai"),n(),e("a",{class:"header-anchor",href:"#ๆจกๅ-nonebot-plugin-marshoai","aria-label":'Permalink to "**ๆจกๅ** `nonebot_plugin_marshoai`"'},"โ")],-1)]))}const h=t(i,[["render",d]]);export{u as __pageData,h as default};
|
@ -1,9 +0,0 @@
|
||||
import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/plugins_test/marshoai_basic/index.md","filePath":"zh/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),h={name:"dev/api/plugins_test/marshoai_basic/index.md"};function e(k,s,l,p,r,E){return t(),a("div",null,s[0]||(s[0]=[n(`<h1 id="ๆจกๅ-nonebot-plugin-marshoai-plugins-test-marshoai-basic" tabindex="-1"><strong>ๆจกๅ</strong> <code>nonebot_plugin_marshoai.plugins_test.marshoai_basic</code> <a class="header-anchor" href="#ๆจกๅ-nonebot-plugin-marshoai-plugins-test-marshoai-basic" aria-label="Permalink to "**ๆจกๅ** \`nonebot_plugin_marshoai.plugins_test.marshoai_basic\`"">โ</a></h1><hr><p><code>@on_function_call(description='่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ')</code></p><h3 id="async-func-get-current-time-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_time() -> str</code> <a class="header-anchor" href="#async-func-get-current-time-str" aria-label="Permalink to "***async func*** \`get_current_time() -> str\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ่ทๅๅฝๅ็ๆถ้ดๅๆฅๆ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins_test/marshoai_basic/__init__.py#L17" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@on_function_call</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_current_time</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Y.%m.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_weekday </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().weekday()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> weekdays </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไธ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไบ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไธ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไบ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๅ
ญ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๆฅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_weekday_name </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> weekdays[current_weekday]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_lunar_date </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().to_lunar().date_hanzify()[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'็ฐๅจ็ๆถ้ดๆฏ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_weekday_name</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผๅๅ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_lunar_date</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ใ'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt</span></span></code></pre></div></details>`,6)]))}const o=i(h,[["render",e]]);export{g as __pageData,o as default};
|
@ -1 +0,0 @@
|
||||
import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/plugins_test/marshoai_basic/index.md","filePath":"zh/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),h={name:"dev/api/plugins_test/marshoai_basic/index.md"};function e(k,s,l,p,r,E){return t(),a("div",null,s[0]||(s[0]=[n("",6)]))}const o=i(h,[["render",e]]);export{g as __pageData,o as default};
|
@ -0,0 +1 @@
|
||||
import{_ as i,c as a,ae as t,o as n}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/plugins_test/marshoai_basic/index.md","filePath":"zh/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"dev/api/plugins_test/marshoai_basic/index.md"};function h(p,s,l,r,k,d){return n(),a("div",null,s[0]||(s[0]=[t('<h1 id="ๆจกๅ-nonebot-plugin-marshoai-plugins-test-marshoai-basic" tabindex="-1"><strong>ๆจกๅ</strong> <code>nonebot_plugin_marshoai.plugins_test.marshoai_basic</code> <a class="header-anchor" href="#ๆจกๅ-nonebot-plugin-marshoai-plugins-test-marshoai-basic" aria-label="Permalink to "**ๆจกๅ** `nonebot_plugin_marshoai.plugins_test.marshoai_basic`"">โ</a></h1><hr><p><code>@on_function_call(description='่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ')</code></p><h3 id="async-func-get-current-time-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_time() -> str</code> <a class="header-anchor" href="#async-func-get-current-time-str" aria-label="Permalink to "***async func*** `get_current_time() -> str`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ่ทๅๅฝๅ็ๆถ้ดๅๆฅๆ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins_test/marshoai_basic/__init__.py#L20" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@on_function_call</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_current_time</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '็ฐๅจ็ๆถ้ดๆฏ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.format(current_time.strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Y.%m.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), weekdays[current_time.weekday()], current_time.chinesize.date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅๅ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฐๅบๆฅ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt</span></span></code></pre></div></details>',6)]))}const c=i(e,[["render",h]]);export{g as __pageData,c as default};
|
@ -0,0 +1 @@
|
||||
import{_ as i,c as a,ae as t,o as n}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"dev/api/plugins_test/marshoai_basic/index.md","filePath":"zh/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"dev/api/plugins_test/marshoai_basic/index.md"};function h(p,s,l,r,k,d){return n(),a("div",null,s[0]||(s[0]=[t("",6)]))}const c=i(e,[["render",h]]);export{g as __pageData,c as default};
|
@ -76,21 +76,20 @@ import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> nickname_json </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> json.loads(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> f.read())</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> except</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> Exception</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> logger.error(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅทๆฐ nickname_json ่กจ้่ฏฏ๏ผๆ ๆณ่ฝฝๅ
ฅ nickname.json ๆไปถ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="func-get-prompt" tabindex="-1"><em><strong>func</strong></em> <code>get_prompt()</code> <a class="header-anchor" href="#func-get-prompt" aria-label="Permalink to "***func*** \`get_prompt()\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ่ทๅ็ณป็ปๆ็คบ่ฏ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L255" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_prompt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_additional_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_additional_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_enable_praises:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> praises_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> build_praises()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> praises_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_enable_time_prompt:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _time_prompt.format(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">date_time</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()).strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Yๅนด%mๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">weekday_name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">_weekdays[current_time.weekday()], </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">lunar_date</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.to_lunar().date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฅๆ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _time_prompt.format(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">date_time</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()).strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Yๅนด%mๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">weekday_name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">_weekdays[current_time.weekday()], </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">lunar_date</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.chinesize.date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅๅ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฅๆ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> marsho_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> SystemMessage(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">content</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">marsho_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts).as_dict()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell</span></span></code></pre></div></details><hr><h3 id="func-suggest-solution-errinfo-str-str" tabindex="-1"><em><strong>func</strong></em> <code>suggest_solution(errinfo: str) -> str</code> <a class="header-anchor" href="#func-suggest-solution-errinfo-str-str" aria-label="Permalink to "***func*** \`suggest_solution(errinfo: str) -> str\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L279" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> suggest_solution</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(errinfo: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell</span></span></code></pre></div></details><hr><h3 id="func-suggest-solution-errinfo-str-str" tabindex="-1"><em><strong>func</strong></em> <code>suggest_solution(errinfo: str) -> str</code> <a class="header-anchor" href="#func-suggest-solution-errinfo-str-str" aria-label="Permalink to "***func*** \`suggest_solution(errinfo: str) -> str\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L278" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> suggest_solution</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(errinfo: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> suggestions </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'content_filter'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆถๆฏๅทฒ่ขซๅ
ๅฎน่ฟๆปคๅจ่ฟๆปคใ่ฏท่ฐๆด่ๅคฉๅ
ๅฎนๅ้่ฏใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'RateLimitReached'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆจกๅ่พพๅฐ่ฐ็จ้็้ๅถใ่ฏท็จ็ญไธๆฎตๆถ้ดๆ่็ณปBot็ฎก็ๅใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'tokens_limit_reached'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฏทๆฑtoken่พพๅฐไธ้ใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'content_length_limit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฏทๆฑไฝ่ฟๅคงใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'unauthorized'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฎฟ้ฎtokenๆ ๆใ่ฏท่็ณปBot็ฎก็ๅใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'invalid type: parameter messages.content is of type array but should be of type string.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ๅคฉ่ฏทๆฑไฝๅ
ๅซๆญคๆจกๅไธๆฏๆ็ๆฐๆฎ็ฑปๅใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'At most 1 image(s) may be provided in one request.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆญคๆจกๅๅช่ฝๅจไธไธๆไธญๅ
ๅซ1ๅผ ๅพ็ใๅฆๆๆญคๅ็่ๅคฉๅทฒ็ปๅ้่ฟๅพ็๏ผ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> key, suggestion </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> suggestions.items():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> errinfo:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\n{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">suggestion</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="async-func-get-backup-context-target-id-str-target-private-bool-list" tabindex="-1"><em><strong>async func</strong></em> <code>get_backup_context(target_id: str, target_private: bool) -> list</code> <a class="header-anchor" href="#async-func-get-backup-context-target-id-str-target-private-bool-list" aria-label="Permalink to "***async func*** \`get_backup_context(target_id: str, target_private: bool) -> list\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ่ทๅๅๅฒไธไธๆ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L298" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_backup_context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(target_id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, target_private: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="async-func-get-backup-context-target-id-str-target-private-bool-list" tabindex="-1"><em><strong>async func</strong></em> <code>get_backup_context(target_id: str, target_private: bool) -> list</code> <a class="header-anchor" href="#async-func-get-backup-context-target-id-str-target-private-bool-list" aria-label="Permalink to "***async func*** \`get_backup_context(target_id: str, target_private: bool) -> list\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ่ทๅๅๅฒไธไธๆ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L297" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_backup_context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(target_id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, target_private: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> global</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_private:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_uid </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'private_</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">target_id</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
@ -99,12 +98,12 @@ import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_uid </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">not</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list.append(target_uid)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> load_context_from_json(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'back_up_context_</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">target_uid</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'contexts/backup'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> []</span></span></code></pre></div></details><h3 id="var-latex-convert" tabindex="-1">var <code>latex_convert</code> <a class="header-anchor" href="#var-latex-convert" aria-label="Permalink to "var \`latex_convert\`"">โ</a></h3><ul><li><p><strong>่ฏดๆ</strong>: ๅผๅฏไธไธช่ฝฌๆขๅฎไพ</p></li><li><p><strong>้ป่ฎคๅผ</strong>: <code>ConvertLatex()</code></p></li></ul><hr><p><code>@get_driver().on_bot_connect</code></p><h3 id="async-func-load-latex-convert" tabindex="-1"><em><strong>async func</strong></em> <code>load_latex_convert()</code> <a class="header-anchor" href="#async-func-load-latex-convert" aria-label="Permalink to "***async func*** \`load_latex_convert()\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L336" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@get_driver</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic;">.on_bot_connect</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> []</span></span></code></pre></div></details><h3 id="var-latex-convert" tabindex="-1">var <code>latex_convert</code> <a class="header-anchor" href="#var-latex-convert" aria-label="Permalink to "var \`latex_convert\`"">โ</a></h3><ul><li><p><strong>่ฏดๆ</strong>: ๅผๅฏไธไธช่ฝฌๆขๅฎไพ</p></li><li><p><strong>้ป่ฎคๅผ</strong>: <code>ConvertLatex()</code></p></li></ul><hr><p><code>@get_driver().on_bot_connect</code></p><h3 id="async-func-load-latex-convert" tabindex="-1"><em><strong>async func</strong></em> <code>load_latex_convert()</code> <a class="header-anchor" href="#async-func-load-latex-convert" aria-label="Permalink to "***async func*** \`load_latex_convert()\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L335" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@get_driver</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic;">.on_bot_connect</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> load_latex_convert</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> latex_convert.load_channel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">None</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])</code> <a class="header-anchor" href="#async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" aria-label="Permalink to "***async func*** \`get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L339" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_uuid_back2codeblock</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, code_blank_uuid_map: list[tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]]):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> latex_convert.load_channel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">None</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])</code> <a class="header-anchor" href="#async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" aria-label="Permalink to "***async func*** \`get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])\`"">โ</a></h3><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L338" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_uuid_back2codeblock</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, code_blank_uuid_map: list[tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]]):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> torep, rep </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> code_blank_uuid_map:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg.replace(torep, rep)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg</span></span></code></pre></div></details><hr><h3 id="async-func-parse-richtext-msg-str-unimessage" tabindex="-1"><em><strong>async func</strong></em> <code>parse_richtext(msg: str) -> UniMessage</code> <a class="header-anchor" href="#async-func-parse-richtext-msg-str-unimessage" aria-label="Permalink to "***async func*** \`parse_richtext(msg: str) -> UniMessage\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ไบบๅทฅๆบ่ฝ็ปๅบ็ๅ็ญไธ่ฌไธไผๅ
ๅซ HTML ๅตๅ
ฅๅ
ถไธญ๏ผไฝๆฏๅ
ๅซๅพ็ๆ่
LaTeX ๅ
ฌๅผใไปฃ็ ๅ๏ผ้ฝๅพๆญฃๅธธใ ่ฟไธชๅฝๆฐไผๆ่ฟไบ้ฝไปฅๅพ็ๅฝขๅผๅตๅ
ฅๆถๆฏไฝใ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L348" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> parse_richtext</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> UniMessage:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg</span></span></code></pre></div></details><hr><h3 id="async-func-parse-richtext-msg-str-unimessage" tabindex="-1"><em><strong>async func</strong></em> <code>parse_richtext(msg: str) -> UniMessage</code> <a class="header-anchor" href="#async-func-parse-richtext-msg-str-unimessage" aria-label="Permalink to "***async func*** \`parse_richtext(msg: str) -> UniMessage\`"">โ</a></h3><p><strong>่ฏดๆ</strong>: ไบบๅทฅๆบ่ฝ็ปๅบ็ๅ็ญไธ่ฌไธไผๅ
ๅซ HTML ๅตๅ
ฅๅ
ถไธญ๏ผไฝๆฏๅ
ๅซๅพ็ๆ่
LaTeX ๅ
ฌๅผใไปฃ็ ๅ๏ผ้ฝๅพๆญฃๅธธใ ่ฟไธชๅฝๆฐไผๆ่ฟไบ้ฝไปฅๅพ็ๅฝขๅผๅตๅ
ฅๆถๆฏไฝใ</p><details><summary><b>ๆบไปฃ็ </b> ๆ <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L347" target="_blank">ๅจGitHubไธๆฅ็</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> parse_richtext</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> UniMessage:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> IMG_LATEX_PATTERN</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.search(msg):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> UniMessage(msg)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_msg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> UniMessage()</span></span>
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as s,c as t,ae as i,o as e}from"./chunks/framework.BzDBnRMZ.js";const c=JSON.parse('{"title":"config","description":"","frontmatter":{"title":"config","order":100},"headers":[],"relativePath":"en/dev/api/config.md","filePath":"en/dev/api/config.md","lastUpdated":1734175019000}'),o={name:"en/dev/api/config.md"};function r(n,a,l,h,d,m){return e(),t("div",null,a[0]||(a[0]=[i("",50)]))}const k=s(o,[["render",r]]);export{c as __pageData,k as default};
|
||||
import{_ as s,c as t,ae as i,o as e}from"./chunks/framework.BzDBnRMZ.js";const c=JSON.parse('{"title":"config","description":"","frontmatter":{"title":"config","order":100},"headers":[],"relativePath":"en/dev/api/config.md","filePath":"en/dev/api/config.md","lastUpdated":1738311067000}'),o={name:"en/dev/api/config.md"};function r(n,a,l,h,d,m){return e(),t("div",null,a[0]||(a[0]=[i("",50)]))}const k=s(o,[["render",r]]);export{c as __pageData,k as default};
|
@ -1 +0,0 @@
|
||||
import{_ as o,c as t,j as e,a as n,o as d}from"./chunks/framework.BzDBnRMZ.js";const _=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/index.md","filePath":"en/dev/api/index.md","lastUpdated":1734175019000}'),r={name:"en/dev/api/index.md"};function i(l,a,s,p,c,m){return d(),t("div",null,a[0]||(a[0]=[e("h1",{id:"module-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"Module"),n(),e("code",null,"nonebot_plugin_marshoai"),n(),e("a",{class:"header-anchor",href:"#module-nonebot-plugin-marshoai","aria-label":'Permalink to "**Module** `nonebot_plugin_marshoai`"'},"โ")],-1)]))}const x=o(r,[["render",i]]);export{_ as __pageData,x as default};
|
@ -1 +0,0 @@
|
||||
import{_ as o,c as t,j as e,a as n,o as d}from"./chunks/framework.BzDBnRMZ.js";const _=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/index.md","filePath":"en/dev/api/index.md","lastUpdated":1734175019000}'),r={name:"en/dev/api/index.md"};function i(l,a,s,p,c,m){return d(),t("div",null,a[0]||(a[0]=[e("h1",{id:"module-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"Module"),n(),e("code",null,"nonebot_plugin_marshoai"),n(),e("a",{class:"header-anchor",href:"#module-nonebot-plugin-marshoai","aria-label":'Permalink to "**Module** `nonebot_plugin_marshoai`"'},"โ")],-1)]))}const x=o(r,[["render",i]]);export{_ as __pageData,x as default};
|
1
assets/en_dev_api_index.md.PTQTSFQN.js
Normal file
1
assets/en_dev_api_index.md.PTQTSFQN.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as i,c as n,j as e,a as t,o as a}from"./chunks/framework.BzDBnRMZ.js";const I=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/index.md","filePath":"en/dev/api/index.md","lastUpdated":1734175019000}'),s={name:"en/dev/api/index.md"};function r(l,o,d,T,p,O){return a(),n("div",null,o[0]||(o[0]=[e("h1",{id:"module-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"Module"),t(),e("code",null,"nonebot_plugin_marshoai"),t(),e("a",{class:"header-anchor",href:"#module-nonebot-plugin-marshoai","aria-label":'Permalink to "**Module** `nonebot_plugin_marshoai`"'},"โ")],-1),e("p",null,"MIT License",-1),e("p",null,"Copyright (c) 2025 Asankilp & LiteyukiStudio",-1),e("p",null,'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:',-1),e("p",null,"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",-1),e("p",null,'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',-1)]))}const c=i(s,[["render",r]]);export{I as __pageData,c as default};
|
1
assets/en_dev_api_index.md.PTQTSFQN.lean.js
Normal file
1
assets/en_dev_api_index.md.PTQTSFQN.lean.js
Normal file
@ -0,0 +1 @@
|
||||
import{_ as i,c as n,j as e,a as t,o as a}from"./chunks/framework.BzDBnRMZ.js";const I=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/index.md","filePath":"en/dev/api/index.md","lastUpdated":1734175019000}'),s={name:"en/dev/api/index.md"};function r(l,o,d,T,p,O){return a(),n("div",null,o[0]||(o[0]=[e("h1",{id:"module-nonebot-plugin-marshoai",tabindex:"-1"},[e("strong",null,"Module"),t(),e("code",null,"nonebot_plugin_marshoai"),t(),e("a",{class:"header-anchor",href:"#module-nonebot-plugin-marshoai","aria-label":'Permalink to "**Module** `nonebot_plugin_marshoai`"'},"โ")],-1),e("p",null,"MIT License",-1),e("p",null,"Copyright (c) 2025 Asankilp & LiteyukiStudio",-1),e("p",null,'Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:',-1),e("p",null,"The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",-1),e("p",null,'THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',-1)]))}const c=i(s,[["render",r]]);export{I as __pageData,c as default};
|
@ -0,0 +1 @@
|
||||
import{_ as i,c as a,ae as t,o as n}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/plugins_test/marshoai_basic/index.md","filePath":"en/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"en/dev/api/plugins_test/marshoai_basic/index.md"};function h(l,s,p,r,k,d){return n(),a("div",null,s[0]||(s[0]=[t('<h1 id="module-nonebot-plugin-marshoai-plugins-test-marshoai-basic" tabindex="-1"><strong>Module</strong> <code>nonebot_plugin_marshoai.plugins_test.marshoai_basic</code> <a class="header-anchor" href="#module-nonebot-plugin-marshoai-plugins-test-marshoai-basic" aria-label="Permalink to "**Module** `nonebot_plugin_marshoai.plugins_test.marshoai_basic`"">โ</a></h1><hr><p><code>@on_function_call(description='่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ')</code></p><h3 id="async-func-get-current-time-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_time() -> str</code> <a class="header-anchor" href="#async-func-get-current-time-str" aria-label="Permalink to "***async func*** `get_current_time() -> str`"">โ</a></h3><p><strong>Description</strong>: ่ทๅๅฝๅ็ๆถ้ดๅๆฅๆ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins_test/marshoai_basic/__init__.py#L20" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@on_function_call</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_current_time</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()</span></span>\n<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> '็ฐๅจ็ๆถ้ดๆฏ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.format(current_time.strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Y.%m.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), weekdays[current_time.weekday()], current_time.chinesize.date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅๅ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฐๅบๆฅ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>\n<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt</span></span></code></pre></div></details>',6)]))}const c=i(e,[["render",h]]);export{g as __pageData,c as default};
|
@ -1 +1 @@
|
||||
import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/plugins_test/marshoai_basic/index.md","filePath":"en/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"en/dev/api/plugins_test/marshoai_basic/index.md"};function h(k,s,l,p,r,d){return t(),a("div",null,s[0]||(s[0]=[n("",6)]))}const o=i(e,[["render",h]]);export{g as __pageData,o as default};
|
||||
import{_ as i,c as a,ae as t,o as n}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/plugins_test/marshoai_basic/index.md","filePath":"en/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"en/dev/api/plugins_test/marshoai_basic/index.md"};function h(l,s,p,r,k,d){return n(),a("div",null,s[0]||(s[0]=[t("",6)]))}const c=i(e,[["render",h]]);export{g as __pageData,c as default};
|
@ -1,9 +0,0 @@
|
||||
import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g=JSON.parse('{"title":"index","description":"","frontmatter":{"title":"index","order":100,"collapsed":true},"headers":[],"relativePath":"en/dev/api/plugins_test/marshoai_basic/index.md","filePath":"en/dev/api/plugins_test/marshoai_basic/index.md","lastUpdated":null}'),e={name:"en/dev/api/plugins_test/marshoai_basic/index.md"};function h(k,s,l,p,r,d){return t(),a("div",null,s[0]||(s[0]=[n(`<h1 id="module-nonebot-plugin-marshoai-plugins-test-marshoai-basic" tabindex="-1"><strong>Module</strong> <code>nonebot_plugin_marshoai.plugins_test.marshoai_basic</code> <a class="header-anchor" href="#module-nonebot-plugin-marshoai-plugins-test-marshoai-basic" aria-label="Permalink to "**Module** \`nonebot_plugin_marshoai.plugins_test.marshoai_basic\`"">โ</a></h1><hr><p><code>@on_function_call(description='่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ')</code></p><h3 id="async-func-get-current-time-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_current_time() -> str</code> <a class="header-anchor" href="#async-func-get-current-time-str" aria-label="Permalink to "***async func*** \`get_current_time() -> str\`"">โ</a></h3><p><strong>Description</strong>: ่ทๅๅฝๅ็ๆถ้ดๅๆฅๆ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins_test/marshoai_basic/__init__.py#L17" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@on_function_call</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ทๅๅฝๅๆถ้ด๏ผๆฅๆๅๆๆ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_current_time</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">() -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Y.%m.</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_weekday </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().weekday()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> weekdays </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> [</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไธ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไบ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไธ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆไบ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๅ
ญ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆๆๆฅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_weekday_name </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> weekdays[current_weekday]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> current_lunar_date </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now().to_lunar().date_hanzify()[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">5</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:]</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'็ฐๅจ็ๆถ้ดๆฏ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_weekday_name</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">๏ผๅๅ </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_lunar_date</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ใ'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> time_prompt</span></span></code></pre></div></details>`,6)]))}const o=i(e,[["render",h]]);export{g as __pageData,o as default};
|
@ -76,21 +76,20 @@ import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> nickname_json </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> json.loads(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> f.read())</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> except</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> Exception</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> logger.error(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅทๆฐ nickname_json ่กจ้่ฏฏ๏ผๆ ๆณ่ฝฝๅ
ฅ nickname.json ๆไปถ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="func-get-prompt" tabindex="-1"><em><strong>func</strong></em> <code>get_prompt()</code> <a class="header-anchor" href="#func-get-prompt" aria-label="Permalink to "***func*** \`get_prompt()\`"">โ</a></h3><p><strong>Description</strong>: ่ทๅ็ณป็ปๆ็คบ่ฏ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L255" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_prompt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_additional_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_additional_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_enable_praises:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> praises_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> build_praises()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> praises_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_enable_time_prompt:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _time_prompt.format(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">date_time</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()).strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Yๅนด%mๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">weekday_name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">_weekdays[current_time.weekday()], </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">lunar_date</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.to_lunar().date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฅๆ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> _time_prompt.format(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">date_time</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(current_time </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> DateTime.now()).strftime(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'%Yๅนด%mๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">%d</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆฅ %H:%M:%S'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">), </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">weekday_name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">_weekdays[current_time.weekday()], </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">lunar_date</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">current_time.chinesize.date_hanzify(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๅๅ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๅนฒๆฏๅนด}{็่}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๅนด</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆไปฝ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">ๆ</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{ๆฅๆ}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">))</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> marsho_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> config.marshoai_prompt</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> SystemMessage(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;">content</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">marsho_prompt </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">+</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> prompts).as_dict()</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell</span></span></code></pre></div></details><hr><h3 id="func-suggest-solution-errinfo-str-str" tabindex="-1"><em><strong>func</strong></em> <code>suggest_solution(errinfo: str) -> str</code> <a class="header-anchor" href="#func-suggest-solution-errinfo-str-str" aria-label="Permalink to "***func*** \`suggest_solution(errinfo: str) -> str\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L279" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> suggest_solution</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(errinfo: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> spell</span></span></code></pre></div></details><hr><h3 id="func-suggest-solution-errinfo-str-str" tabindex="-1"><em><strong>func</strong></em> <code>suggest_solution(errinfo: str) -> str</code> <a class="header-anchor" href="#func-suggest-solution-errinfo-str-str" aria-label="Permalink to "***func*** \`suggest_solution(errinfo: str) -> str\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L278" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> suggest_solution</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(errinfo: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> suggestions </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'content_filter'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆถๆฏๅทฒ่ขซๅ
ๅฎน่ฟๆปคๅจ่ฟๆปคใ่ฏท่ฐๆด่ๅคฉๅ
ๅฎนๅ้่ฏใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'RateLimitReached'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆจกๅ่พพๅฐ่ฐ็จ้็้ๅถใ่ฏท็จ็ญไธๆฎตๆถ้ดๆ่็ณปBot็ฎก็ๅใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'tokens_limit_reached'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฏทๆฑtoken่พพๅฐไธ้ใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'content_length_limit'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฏทๆฑไฝ่ฟๅคงใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'unauthorized'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ฎฟ้ฎtokenๆ ๆใ่ฏท่็ณปBot็ฎก็ๅใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'invalid type: parameter messages.content is of type array but should be of type string.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'่ๅคฉ่ฏทๆฑไฝๅ
ๅซๆญคๆจกๅไธๆฏๆ็ๆฐๆฎ็ฑปๅใ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'At most 1 image(s) may be provided in one request.'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'ๆญคๆจกๅๅช่ฝๅจไธไธๆไธญๅ
ๅซ1ๅผ ๅพ็ใๅฆๆๆญคๅ็่ๅคฉๅทฒ็ปๅ้่ฟๅพ็๏ผ่ฏท้็ฝฎไธไธๆใ'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> key, suggestion </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> suggestions.items():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> key </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> errinfo:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">\\n{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">suggestion</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="async-func-get-backup-context-target-id-str-target-private-bool-list" tabindex="-1"><em><strong>async func</strong></em> <code>get_backup_context(target_id: str, target_private: bool) -> list</code> <a class="header-anchor" href="#async-func-get-backup-context-target-id-str-target-private-bool-list" aria-label="Permalink to "***async func*** \`get_backup_context(target_id: str, target_private: bool) -> list\`"">โ</a></h3><p><strong>Description</strong>: ่ทๅๅๅฒไธไธๆ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L298" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_backup_context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(target_id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, target_private: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ''</span></span></code></pre></div></details><hr><h3 id="async-func-get-backup-context-target-id-str-target-private-bool-list" tabindex="-1"><em><strong>async func</strong></em> <code>get_backup_context(target_id: str, target_private: bool) -> list</code> <a class="header-anchor" href="#async-func-get-backup-context-target-id-str-target-private-bool-list" aria-label="Permalink to "***async func*** \`get_backup_context(target_id: str, target_private: bool) -> list\`"">โ</a></h3><p><strong>Description</strong>: ่ทๅๅๅฒไธไธๆ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L297" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_backup_context</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(target_id: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, target_private: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">bool</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">list</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> global</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_private:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_uid </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'private_</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">target_id</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span></span>
|
||||
@ -99,12 +98,12 @@ import{_ as i,c as a,ae as n,o as t}from"./chunks/framework.BzDBnRMZ.js";const g
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> target_uid </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">not</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> loaded_target_list.append(target_uid)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> load_context_from_json(</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'back_up_context_</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">{</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">target_uid</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">}</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">'contexts/backup'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> []</span></span></code></pre></div></details><h3 id="var-latex-convert" tabindex="-1">var <code>latex_convert</code> <a class="header-anchor" href="#var-latex-convert" aria-label="Permalink to "var \`latex_convert\`"">โ</a></h3><ul><li><p><strong>Description</strong>: ๅผๅฏไธไธช่ฝฌๆขๅฎไพ</p></li><li><p><strong>Default</strong>: <code>ConvertLatex()</code></p></li></ul><hr><p><code>@get_driver().on_bot_connect</code></p><h3 id="async-func-load-latex-convert" tabindex="-1"><em><strong>async func</strong></em> <code>load_latex_convert()</code> <a class="header-anchor" href="#async-func-load-latex-convert" aria-label="Permalink to "***async func*** \`load_latex_convert()\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L336" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@get_driver</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic;">.on_bot_connect</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> []</span></span></code></pre></div></details><h3 id="var-latex-convert" tabindex="-1">var <code>latex_convert</code> <a class="header-anchor" href="#var-latex-convert" aria-label="Permalink to "var \`latex_convert\`"">โ</a></h3><ul><li><p><strong>Description</strong>: ๅผๅฏไธไธช่ฝฌๆขๅฎไพ</p></li><li><p><strong>Default</strong>: <code>ConvertLatex()</code></p></li></ul><hr><p><code>@get_driver().on_bot_connect</code></p><h3 id="async-func-load-latex-convert" tabindex="-1"><em><strong>async func</strong></em> <code>load_latex_convert()</code> <a class="header-anchor" href="#async-func-load-latex-convert" aria-label="Permalink to "***async func*** \`load_latex_convert()\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L335" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">@get_driver</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">()</span><span style="--shiki-light:#B31D28;--shiki-light-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic;">.on_bot_connect</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> load_latex_convert</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">():</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> latex_convert.load_channel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">None</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])</code> <a class="header-anchor" href="#async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" aria-label="Permalink to "***async func*** \`get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L339" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_uuid_back2codeblock</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, code_blank_uuid_map: list[tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]]):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> await</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> latex_convert.load_channel(</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">None</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div></details><hr><h3 id="async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" tabindex="-1"><em><strong>async func</strong></em> <code>get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])</code> <a class="header-anchor" href="#async-func-get-uuid-back2codeblock-msg-str-code-blank-uuid-map-list-tuple-str-str" aria-label="Permalink to "***async func*** \`get_uuid_back2codeblock(msg: str, code_blank_uuid_map: list[tuple[str, str]])\`"">โ</a></h3><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L338" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> get_uuid_back2codeblock</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, code_blank_uuid_map: list[tuple[</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">]]):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> torep, rep </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">in</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> code_blank_uuid_map:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg.replace(torep, rep)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg</span></span></code></pre></div></details><hr><h3 id="async-func-parse-richtext-msg-str-unimessage" tabindex="-1"><em><strong>async func</strong></em> <code>parse_richtext(msg: str) -> UniMessage</code> <a class="header-anchor" href="#async-func-parse-richtext-msg-str-unimessage" aria-label="Permalink to "***async func*** \`parse_richtext(msg: str) -> UniMessage\`"">โ</a></h3><p><strong>Description</strong>: ไบบๅทฅๆบ่ฝ็ปๅบ็ๅ็ญไธ่ฌไธไผๅ
ๅซ HTML ๅตๅ
ฅๅ
ถไธญ๏ผไฝๆฏๅ
ๅซๅพ็ๆ่
LaTeX ๅ
ฌๅผใไปฃ็ ๅ๏ผ้ฝๅพๆญฃๅธธใ ่ฟไธชๅฝๆฐไผๆ่ฟไบ้ฝไปฅๅพ็ๅฝขๅผๅตๅ
ฅๆถๆฏไฝใ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L348" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> parse_richtext</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> UniMessage:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> msg</span></span></code></pre></div></details><hr><h3 id="async-func-parse-richtext-msg-str-unimessage" tabindex="-1"><em><strong>async func</strong></em> <code>parse_richtext(msg: str) -> UniMessage</code> <a class="header-anchor" href="#async-func-parse-richtext-msg-str-unimessage" aria-label="Permalink to "***async func*** \`parse_richtext(msg: str) -> UniMessage\`"">โ</a></h3><p><strong>Description</strong>: ไบบๅทฅๆบ่ฝ็ปๅบ็ๅ็ญไธ่ฌไธไผๅ
ๅซ HTML ๅตๅ
ฅๅ
ถไธญ๏ผไฝๆฏๅ
ๅซๅพ็ๆ่
LaTeX ๅ
ฌๅผใไปฃ็ ๅ๏ผ้ฝๅพๆญฃๅธธใ ่ฟไธชๅฝๆฐไผๆ่ฟไบ้ฝไปฅๅพ็ๅฝขๅผๅตๅ
ฅๆถๆฏไฝใ</p><details><summary><b>Source code</b> or <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/util.py#L347" target="_blank">View on GitHub</a></summary><div class="language-python vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">python</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">async</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> def</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> parse_richtext</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(msg: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -> UniMessage:</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> if</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> not</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> IMG_LATEX_PATTERN</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">.search(msg):</span></span>
|
||||
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> return</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> UniMessage(msg)</span></span>
|
||||
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> result_msg </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> UniMessage()</span></span>
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as e,c as d,ae as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en/start/install.md","filePath":"en/start/install.md","lastUpdated":1737975015000}'),s={name:"en/start/install.md"};function i(r,t,n,l,c,h){return a(),d("div",null,t[0]||(t[0]=[o("",29)]))}const m=e(s,[["render",i]]);export{u as __pageData,m as default};
|
||||
import{_ as e,c as d,ae as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const u=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"en/start/install.md","filePath":"en/start/install.md","lastUpdated":1738311067000}'),s={name:"en/start/install.md"};function i(r,t,n,l,c,h){return a(),d("div",null,t[0]||(t[0]=[o("",29)]))}const m=e(s,[["render",i]]);export{u as __pageData,m as default};
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as d,c as e,ae as a,o}from"./chunks/framework.BzDBnRMZ.js";const k=JSON.parse('{"title":"ๅฎ่ฃ
","description":"","frontmatter":{"title":"ๅฎ่ฃ
"},"headers":[],"relativePath":"start/install-old.md","filePath":"zh/start/install-old.md","lastUpdated":1737825849000}'),s={name:"start/install-old.md"};function i(n,t,r,l,h,c){return o(),e("div",null,t[0]||(t[0]=[a("",24)]))}const E=d(s,[["render",i]]);export{k as __pageData,E as default};
|
||||
import{_ as d,c as e,ae as a,o}from"./chunks/framework.BzDBnRMZ.js";const k=JSON.parse('{"title":"ๅฎ่ฃ
","description":"","frontmatter":{"title":"ๅฎ่ฃ
"},"headers":[],"relativePath":"start/install-old.md","filePath":"zh/start/install-old.md","lastUpdated":1738311067000}'),s={name:"start/install-old.md"};function i(n,t,r,l,h,c){return o(),e("div",null,t[0]||(t[0]=[a("",24)]))}const E=d(s,[["render",i]]);export{k as __pageData,E as default};
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as d,c as e,ae as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const A=JSON.parse('{"title":"ๅฎ่ฃ
","description":"","frontmatter":{"title":"ๅฎ่ฃ
"},"headers":[],"relativePath":"start/install.md","filePath":"zh/start/install.md","lastUpdated":1737975015000}'),s={name:"start/install.md"};function i(r,t,n,l,c,h){return a(),e("div",null,t[0]||(t[0]=[o("",29)]))}const E=d(s,[["render",i]]);export{A as __pageData,E as default};
|
||||
import{_ as d,c as e,ae as o,o as a}from"./chunks/framework.BzDBnRMZ.js";const A=JSON.parse('{"title":"ๅฎ่ฃ
","description":"","frontmatter":{"title":"ๅฎ่ฃ
"},"headers":[],"relativePath":"start/install.md","filePath":"zh/start/install.md","lastUpdated":1738311067000}'),s={name:"start/install.md"};function i(r,t,n,l,c,h){return a(),e("div",null,t[0]||(t[0]=[o("",29)]))}const E=d(s,[["render",i]]);export{A as __pageData,E as default};
|
Reference in New Issue
Block a user