Chaz是Chaz。
这是一个矩阵机器人,它连接到多个LLM提供商,以允许与任何LLM型号聊天。它与使用OpenAI API的任何模型兼容。
此外,还可以将Aichat用作提供商,因此也可以访问通过AICHAT可用的任何模型。
您将需要自己的API键或已配置的本地AI。
公告博客文章:CHAZ:llm <->矩阵聊天机器人
#CHAZ有一个公共矩阵室:jackson.dev
如果您有自己的API键,并且您相信我不要滥用它们,则可以通过@chaz:jackson.dev快速开始。只需将矩阵用户添加到您的房间中,用自己的API键将其配置为OpenAI API兼容后端,就可以使用。
Chaz将自动接受allow_list中的任何用户的房间邀请。
当它在房间里时,它将注意由!chaz前缀的命令。如果是DM,它将响应其无法识别为命令的每条消息。如果它在较大的房间中,它将仅响应使用!chaz发送给它的消息。
因此,在更大的房间里,Just !chaz ,它将在房间中发送所有最近的消息,并要求回复。您也可以发送请求,例如!chaz explain that to me ,它将收到您的信息和房间的上下文并做出回应。
它认识到的命令是:
!chaz help
Available commands:
!chaz print - Print the conversation
!chaz send < message > - Send a message without context
!chaz model < model > - Select the model to use
!chaz backend < name > <api_base> <api_key> - Manually enter an OpenAI Compatible Backend
!chaz role [ < role > ] [ < prompt > ] - Get the role info, set the role, or define a new role
!chaz list - List available models
!chaz clear - Ignore all messages before this point
!chaz rename - Rename the room and set the topic based on the chat content
!chaz help - Show this message!chaz role命令需要0、1或许多论点。
!chaz role显示当前角色并列出所有可用角色。!chaz role <name>将现有角色设置为默认值。!chaz role <name> <prompt>在给定的提示符下创建新角色。 chaz仅包装在Crates.io上,但建议您暂时从Git Head跑来跑去。
对于Nix用户,此存储库包含一个Nix薄片。有关配置的详细信息,请参见“设置”部分。
Docker Hub上有一个Docker图像。这是一个码头组成的示例:
services :
chaz :
image : arcuru/chaz:main # Set to your desired version
restart : unless-stopped
network_mode : host
volumes :
# Mount your config file to /config.yaml
- ./config.yaml:/config.yaml
# Mount your aichat config to /aichat, AND SET THAT LOCATION IN CHAZ'S CONFIG.YAML
- aichat-state:/aichat
- ./aichat.yaml:/aichat/config.yaml
# Mount the volume into the same location specified in config.yaml
- chaz-state:/state
volumes :
# Persists the logged in session
chaz-state :
aichat-state :请注意,这需要将2个配置文件安装到容器中,一个用于CHAZ,一个用于Aichat。您还需要在CHAZ配置文件中设置状态/缓存目录。
CHAZ配置文件应该看起来像这样:
homeserver_url : https://matrix.jackson.dev
username : " chaz "
password : " "
state_dir : " /state "
aichat_config_dir : " /aichat "
allow_list : " @.*:jackson.dev|@arcuru:matrix.org " 首先,在任何矩阵服务器上设置一个帐户以供机器人使用。
使用其登录信息创建一个机器人的配置文件。
重要的是:确保您设置允许图或机器人不会响应
默认值在src/defaults.rs中配置
homeserver_url : https://matrix.org
username : " chaz "
password : " " # Optional, if not given it will ask for it on first run
allow_list : " " # Regex for allowed accounts.
# message_limit: 0 # Set a per-account message limit, it will not allow more than this many messages per account.
# room_size_limit: 0 # Set a room size limit. It will refuse join if the room is too large.
state_dir : " $XDG_STATE_HOME/chaz " # Optional, for setting the chaz state directory
aichat_config_dir : " $AICHAT_CONFIG_DIR " # Optional, for using a separate aichat config
chat_summary_model : " " # Optional, set a different model than the default to use for summarizing the chat
disable_media_context : false # Optional, set to true to disable sending media context to aichat
role : chaz # Optionally set a role, AKA system prompt. Set to `chaz` for the full chaz experience, or `cave-chaz` for even more chaz
# Define backends. If more than 1 is defined, model names will be prefixed by the backends name.
# If none are defined, Chaz will look for Aichat
backends :
- name : openai # Name of the backend, models will be shown with this as a prefix, e.g. openai:gpt-4
type : openaicompatible
api_key :
api_base : https://api.openai.com/v1
models : # Listing models here is not necessary, but does make Chaz aware of them. You can still switch to a model not listed here through '!chaz model ....'
- name : gpt-4o
- name : gpt-4o-mini
- name : tog # Name can be anything. Model names will be "tog:<model>"
type : openaicompatible
api_key :
api_base : https://api.together.xyz/v1
- name : aic
type : aichat
roles : # Optional, define your own roles
- name : chaz # This one is predefined
description : Chaz is Chaz
prompt : " Your name is Chaz, you are an AI assistant, and you refer to yourself in the third person. "
example : # Optionally define example messages.
- user : User
message : " Are you ready? "
- user : Assistant
message : " Chaz is ready. "
- name : bash
description : Get a single shell command
prompt : >
Based on the following user description, generate a corresponding Bash shell command.
Focus solely on interpreting the requirements and translating them into a single, executable Bash command.
Ensure accuracy and relevance to the user's description.
The output should be a valid Bash command that directly aligns with the user's intent, ready for execution in a command-line environment.
Do not output anything except for the command.
No code block, no English explanation, no newlines, and no start/end tags. 简单地运行它:
chaz --config config.yaml 。该机器人不会在不运行时响应较旧的消息,以防止后端压倒后端。
正在使用Nix薄片进行开发。安装CHAZ的最简单方法是使用Nix片。
❯ nix run github:arcuru/chaz薄片包含一个覆盖层,使其更容易导入您自己的薄片配置。要使用,请将其添加到您的输入中:
inputs . chaz . url = "github:arcuru/chaz" ;然后将叠加inputs.chaz.overlays.default添加到您的pkgs。
薄片还包含一个用于安装CHAZ服务的家庭经理模块。将模块导入您的家庭经理配置,您可以从NIX内部配置chaz :
{ inputs , ... } : {
imports = [ inputs . chaz . homeManagerModules . default ] ;
services . chaz = {
enable = true ;
settings = {
homeserver_url = "https://matrix.jackson.dev" ;
username = "chaz" ;
password = "hunter2" ;
allow_list = "@me:matrix.org|@myfriend:matrix.org" ;
} ;
} ;
} 在Github和Codeberg上镜像。 Github是官方回购,但使用任何一个仓库来贡献。问题不能同步,因此可能会有一些重复。