一个平台,让研究人员可以将智能 AI 直接连接到实时通信网络和 3D 世界。您的 AI,随时随地。
Digital Beings is a software that connects AI agents with a range of IM and VR software, making their deployment easier. You pick a bot, fill the account data and you're able to converse with a bot using SMS, Twitter or other social media.
Made in partnership with SuperReality, a free open source teaching platform for everyone.
Digital Beings is written in Typescript and Python. Typescript is used for the clients of most known social networks, as well as XR-Engine, a 3D metaverse architecture. A layer that connects the AI agents is called the server, and is written in Python.
Digital Being supports:
The Client is using either the API for connecting to the different services like Discord, Messenger, etc, or Puppeteer for emulating the browser to connect to the XR-Engine and Zoom.
Out of the box, the server supports these AI bots:
The server can fetch chat history and transform it to a list.
The client is connected with the server using TCP sockets, sending JSON-encoded packets.
Right now these TCP packets may contain:
sendMessage - chat packet messagesendSlashCommand - Discord slash command - can be implemented to other clients toosendUserUpdateEvent - on Discord join server, leave, on online, idle or offline, all events can be fed to agentssendGetAgents - returns a list of the active agentssendSetAgentsFields - this command can be used to update the context of an agentsendPingSoloAgent - this command can be used to ping an agent directly, if many agents are activesendMessageReaction - this command is sent when a user reacts to a message, currently implemented in DiscordsendMessageEdit - this command is sent when a message is edited, in order to update the agent’s response toosendMetadata - this command is used to send the metadata of the current server - currently implemented in Discord and the XR-EngineNew packets can be implemented easily, the only thing to be noted is that the ID should be different from the old packets, also the packet should be sent as a JSON string, like the examples, to avoid any issues with the server.
More info about Networking
Digital Being requires the following to run:
Node.JSdocker-composedocker-compose build command to build the containersdocker-compose up (if in Putty you can use docker-compose up -d to keep the image open after closing)Ctrl + Alt + Crequirements.txtC++ build tools through Visual Studio Communitygit clone [email protected]:XRFoundation/DigitalBeing.git) and open the DigitalBeing directorynpm installpip install -r requirements.txt.env.default to .env (or make a new copy) and update the variablesPG* in an .env file and run the init.sql (root folder)npm run start in the command lineNode.JS, NPM and Python)npm installpip install -r requirements.txtPostgres, setup the user and the database and run the init.sql (root folder).env.default to .env (or make a new copy) and update the variablesnpm run in the command lineIf you get this error ERROR: for testbot_editor_1 Cannot start service editor: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "./editor.sh": permission denied: unknown before running the command docker-compose up run: chmod +x editor.sh in the root folder
sudo apt-get install postgresql - installs the postgresql service on the machinesudo passwd postgres - the user postgres is created, with this command you can set a password, as the service runs on this user, close and reopen terminal if on WSL otherwise rebootsudo service postgresql start - to start the postgres servicesudo -u postgres psql - to connect to postgres as the postgres user - the user can be changed to a custom user sudo -u postgres createuser alter user with encrypted password '';create database ; to create the new database for the botgrant all privileges on database to ;\c init.sql file that can be located in the root folder in order to create the databaseAttention: applies to installed agent code.
Open server/agent_params.py and add / remove the SELECT_AGENTS list using the agent name string.
Attention: applies to the installed clients only.
Open src/initialize.ts and comment/uncomment the clients you need, if you need a client that uses a web server (ex. Twilio), go to client/webserver.ts and uncomment line 17 otherwise you can leave it commented.
Go to server/agent_params.py and add the agent name in SELECTED_AGENTS array, or delete / comment unwanted agents, like this.
Go to the src/initialize.ts and comment/uncomment the needed clients, like this.
Port forwarding is needed in order to enable public access to a service, like the database, web server or the bot manager. Twilio needs an access to notify the DigitalBeing about SMS events.
In order to expose a port in the public inside docker go to docker-compose.yaml, edit the contaier you want to change and add the port according to this syntax.
ports:
- "HOST_PORT:CONTAINER_PORT"Example:
More details on the syntax are available in Compose documentation.
ngrok)A software called ngrok may help if you are using a home network and are beyond the nat.
It creates a tunnel that enables public access to your computer.
In order to use ngrok, you will need to install it (it supports both windows and linux) and run ngrok http port through the command line.
This command will generate a new URL that will be later use for public access.
This step can be used for the Editor, Twilio or Messenger, which needs public access to the computer.
In order to run Twilio, you will need to have your ports forwarded. Puppeteer error, that it cant find Chrome: WSL can cause an error with puppeteer that it cant find chromium driver, in order to fix it you will need to install chrome manually, running the following commands:
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.debsudo apt -y install ./google-chrome-stable_current_amd64.debDigitalBeing is able to connect to the XR-Engine using Puppeteer.
DigitalBeing is able to imitate a character in XR-engine and access its functions. It currently selects a random model.
It works using a virtual headful client (runs like headless, but in headful mode virtual, as puppeteer doesn't support Audio and Video in headless mode) in the engine.
Currently, DigitalBeing has a builtin support for the chat, which allows it to talk with users and use chat commands. It also has access to the client-logs, which have info about the bot, be it scene metadata or something else.
Available Commands - all commands start with a slash (/):
/move x,y,z moves to x,y,z position using navmesh/metadata scene gets the scene metadata/metadata world,max_distance (from bot) gets the world metadata (objects) around the bot/listAllusers sends a client log with all users/goTo landmark (based on world metadata) moves towards a landmark/emote emote_name players an emote/getPosition user get the position of a user/getRotation user get the rotation of a user/getScale user get the scale of a user/getTransform user get the transform of a user (position, rotation, scale)/subscribe system subscribe to chat system/unsubscribe system unsubscribe from a chat system/getSubscribed get the current subscribed chat systems/follow user follow a user/follow stop stop following a user/getChatHistory get the recent chat history as client log/getLocalUserId get the local user id as client logNote: the xrengine-client.ts has all the functions needed to send commands or generally a chat message.
The [XR-Engine](https://github.com/EtherealEngine/etherealengi
暂无开放 Issues,或尚未同步最近议题。