nonebot-plugin-marshoai/assets/dev_api_plugins_builtin_tools_utils.md.BQ_zIszy.js

2 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{_ as t,c as i,ae as a,o as n}from"./chunks/framework.BzDBnRMZ.js";const u=JSON.parse('{"title":"utils","description":"","frontmatter":{"title":"utils","order":100},"headers":[],"relativePath":"dev/api/plugins/builtin_tools/utils.md","filePath":"zh/dev/api/plugins/builtin_tools/utils.md","lastUpdated":null}'),l={name:"dev/api/plugins/builtin_tools/utils.md"};function e(h,s,o,r,p,g){return n(),i("div",null,s[0]||(s[0]=[a('<h1 id="模块-nonebot-plugin-marshoai-plugins-builtin-tools-utils" tabindex="-1"><strong>模块</strong> <code>nonebot_plugin_marshoai.plugins.builtin_tools.utils</code> <a class="header-anchor" href="#模块-nonebot-plugin-marshoai-plugins-builtin-tools-utils" aria-label="Permalink to &quot;**模块** `nonebot_plugin_marshoai.plugins.builtin_tools.utils`&quot;"></a></h1><hr><h3 id="async-func-make-html-summary-html-content-str-language-str-english-length-int-3-str" tabindex="-1"><em><strong>async func</strong></em> <code>make_html_summary(html_content: str, language: str = &#39;english&#39;, length: int = 3) -&gt; str</code> <a class="header-anchor" href="#async-func-make-html-summary-html-content-str-language-str-english-length-int-3-str" aria-label="Permalink to &quot;***async func*** `make_html_summary(html_content: str, language: str = &#39;english&#39;, length: int = 3) -&gt; str`&quot;"></a></h3><p><strong>说明</strong>: 使用html内容生成摘要</p><p><strong>参数</strong>:</p><blockquote><ul><li>html_content (str): html内容</li><li>language (str, optional): 语言. Defaults to &quot;english&quot;.</li><li>length (int, optional): 摘要长度. Defaults to 3.</li></ul></blockquote><p><strong>返回</strong>: str: 摘要</p><details><summary><b>源代码</b> 或 <a href="https://github.com/LiteyukiStudio/nonebot-plugin-marshoai/tree/main/nonebot_plugin_marshoai/plugins/builtin_tools/utils.py#L12" 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;"> make_html_summary</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(html_content: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, language: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">str</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&#39;english&#39;</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">, length: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">int</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">3</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">) -&gt; </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;"> loop </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> asyncio.get_event_loop()</span></span>\n<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;"> loop.run_in_executor(executor, _make_summary, html_content, language, length)</span></span></code></pre></div></details>',8)]))}const d=t(l,[["render",e]]);export{u as __pageData,d as default};