Skip to content

💿 Install

Install with nb-cli

Open shell under the root directory of nonebot2, input the command below.

nb plugin install nonebot-plugin-marshoai
Install with pack manager

Open shell under the plugin directory of nonebot2, input corresponding command according to your pack manager.

pip
pip install nonebot-plugin-marshoai
pdm
pdm add nonebot-plugin-marshoai
poetry
poetry add nonebot-plugin-marshoai
conda
conda install nonebot-plugin-marshoai

Open the pyproject.toml file under nonebot2's root directory, Add to[tool.nonebot].

plugins = ["nonebot_plugin_marshoai"]

🤖 Get token(GitHub Models)

  • Create new personal access tokenDon't need any permissions.
  • Copy the new token, add to the .env file's marshoai_token option.

🎉 Usage

End marsho in order to get direction for use(If you configured the custom command, please use the configured one).

👉 Double click avatar

When nonebot linked to OneBot v11 adapter, can recieve double click and response to it. More detail in the MARSHOAI_POKE_SUFFIX option.

🛠️ MarshoTools (Deprecated)

MarshoTools is a feature added in v0.5.0, support loading external function library to provide Function Call for Marsho.

🧩 Marsho Plugin

Marsho Plugin is a feature added in v1.0.0, replacing the old MarshoTools feature. Documentation

👍 Praise list

Praise list stored in the praises.json in plugin directory(This directory will putput to log when Bot start), it'll automatically generate when option is true, include character name and advantage two basic data.

The character stored in it would be “know” and “like” by Marsho.

It's structure is similar to:

json
{
  "like": [
    {
      "name": "Asankilp",
      "advantages": "赋予了Marsho猫娘人格,使用vim与vscode为Marsho写了许多代码,使Marsho更加可爱"
    },
    {
      "name": "神羽(snowykami)",
      "advantages": "人脉很广,经常找小伙伴们开银趴,很会写后端代码"
    },
    ...
  ]
}

⚙️ Configurable options

Add options in the .env file from the diagram below in nonebot2 project.

plugin behaviour

OptionTypeDefaultDescription
MARSHOAI_USE_YAML_CONFIGboolfalseUse YAML config format
MARSHOAI_DEVMODEbooltrueTurn on Development Mode or not

Marsho usage

OptionTypeDefaultDescription
MARSHOAI_DEFAULT_NAMEstrmarshoCommand to call Marsho
MARSHOAI_ALIASESset[str]set{"Marsho"}Other name(Alias) to call Marsho
MARSHOAI_ATboolfalseCall by @ or not
MARSHOAI_MAIN_COLOURstrFFAAAATheme color, used by some tools and features

AI call

OptionTypeDefaultDescription
MARSHOAI_TOKENstrThe token needed to call AI API
MARSHOAI_DEFAULT_MODELstrgpt-4o-miniThe default model of Marsho
MARSHOAI_PROMPTstrCatgirl Marsho's character promptMarsho's basic system prompt ※Some models(o1 and so on) don't support it
MARSHOAI_ADDITIONAL_PROMPTstrMarsho's external system prompt
MARSHOAI_ENFORCE_NICKNAMEbooltrueEnforce user to set nickname or not
MARSHOAI_POKE_SUFFIXstr揉了揉你的猫耳When double click Marsho who connected to OneBot adapter, the chat content. When it's empty string, double click function is off. Such as, the default content is *[昵称]揉了揉你的猫耳。
MARSHOAI_AZURE_ENDPOINTstrhttps://models.inference.ai.azure.comOpenAI standard API
MARSHOAI_TEMPERATUREfloatnulltemperature parameter
MARSHOAI_TOP_PfloatnullNucleus Sampling parameter
MARSHOAI_MAX_TOKENSintnullMax token number
MARSHOAI_ADDITIONAL_IMAGE_MODELSlist[]External image-support model list, such as hunyuan-vision
MARSHOAI_NICKNAME_LIMITint16Limit for nickname length

Feature Switches

OptionTypeDefaultDescription
MARSHOAI_ENABLE_SUPPORT_IMAGE_TIPbooltrueWhen on, if user send request with photo and model don't support that, remind the user
MARSHOAI_ENABLE_NICKNAME_TIPbooltrueWhen on, if user haven't set username, remind user to set
MARSHOAI_ENABLE_PRAISESbooltrueTurn on Praise list or not
MARSHOAI_ENABLE_TOOLSboolfalseTurn on Marsho Tools or not
MARSHOAI_ENABLE_PLUGINSbooltrueTurn on Marsho Plugins or not
MARSHOAI_PLUGIN_DIRSlist[str][]List of plugins directory
MARSHOAI_LOAD_BUILTIN_TOOLSbooltrueLoading the built-in toolkit or not
MARSHOAI_TOOLSET_DIRlist[]List of external toolset directory
MARSHOAI_DISABLED_TOOLKITSlist[]List of disabled toolkits' name
MARSHOAI_ENABLE_RICHTEXT_PARSEbooltrueTurn on auto parse rich text feature(including image, LaTeX equation)
MARSHOAI_SINGLE_LATEX_PARSEboolfalseRender single-line equation or not

The document is being improved. Suggestions are welcome.