Chaz คือ Chaz
นี่คือบอทเมทริกซ์ที่เชื่อมต่อกับผู้ให้บริการ LLM หลายรายเพื่ออนุญาตให้แชทกับรุ่น LLM ใด ๆ มันเข้ากันได้กับรุ่นใด ๆ โดยใช้ OpenAI API
นอกจากนี้ยังเป็นไปได้ที่จะใช้ AICHAT เป็นผู้ให้บริการดังนั้นรุ่นใดก็ตามที่มีให้ผ่าน AICHAT สามารถเข้าถึงได้เช่นกัน
คุณจะต้องใช้คีย์ API ของคุณเองหรือ AI ท้องถิ่นของคุณเองที่กำหนดค่าไว้แล้ว
โพสต์บล็อกประกาศ: Chaz: LLM <-> Matrix Chatbot
มีห้องเมทริกซ์สาธารณะที่ #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 repo นี้มีเกล็ด nix ดูส่วนการตั้งค่าสำหรับรายละเอียดเกี่ยวกับการกำหนดค่า
มีภาพนักเทียบท่าบน Docker Hub นี่คือตัวอย่างที่เขียนจากนักเทียบท่า:
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 ของคุณ
ไฟล์ config chaz ควรมีลักษณะเช่นนี้:
homeserver_url : https://matrix.jackson.dev
username : " chaz "
password : " "
state_dir : " /state "
aichat_config_dir : " /aichat "
allow_list : " @.*:jackson.dev|@arcuru:matrix.org " ขั้นแรกให้ตั้งค่าบัญชีบนเซิร์ฟเวอร์เมทริกซ์ใด ๆ เพื่อให้บอทใช้
สร้างไฟล์กำหนดค่าสำหรับบอทด้วยข้อมูลการเข้าสู่ระบบ
สำคัญ : ตรวจสอบให้แน่ใจว่าคุณตั้งค่า ALLED_LIST หรือบอทจะไม่ตอบสนอง
ค่าเริ่มต้นถูกกำหนดค่าใน 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 Flakes
❯ nix run github:arcuru/chazเกล็ดมีการซ้อนทับเพื่อให้นำเข้าง่ายขึ้นในการกำหนดค่าเกล็ดของคุณเอง หากต้องการใช้เพิ่มลงในอินพุตของคุณ:
inputs . chaz . url = "github:arcuru/chaz" ; จากนั้นเพิ่ม inputs.chaz.overlays.default ทับ chaz.overlays.default ไปยัง PKG ของคุณ
เกล็ดยังมีโมดูลผู้จัดการที่บ้านสำหรับการติดตั้ง Chaz เป็นบริการ นำเข้าโมดูลลงในการกำหนดค่าผู้จัดการที่บ้านของคุณและคุณสามารถกำหนดค่า chaz ทั้งหมดจากภายใน nix:
{ 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 เป็น repo อย่างเป็นทางการ แต่ใช้ repo ทั้งสองเพื่อมีส่วนร่วม ปัญหาไม่สามารถซิงค์ได้ดังนั้นอาจมีบางอย่างที่ซ้ำกัน