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是官方回購,但使用任何一個倉庫來貢獻。問題不能同步,因此可能會有一些重複。