Machine <--> Human

On rare occasions, you may want to build an application that involves both machines and humans. In such cases, you can use unconscious to build a bridge between the two.

For example, maybe a machine connects via the CLI and theres a human using a browser.

Machines POV

first the machine joins the chat room.

curl http://localhost:3000/sse\?thread\=home
# data: {"message":"{\"simple_message\":{\"message\":\"whatsup\"}}","client_id":"unregistered","timestamp":1718235135,"id":"dr8E7Xw6t6jarHSrycJcWe"}

# data: {"message":"{\"simple_message\":{\"message\":\"test\",\"senders_name\":null}}","client_id":"person","timestamp":1718235386,"id":"hvb7qNQY1UF3mxF5ZSQvyX"}

# data: {"message":"{\"simple_message\":{\"message\":\"test\",\"senders_name\":null}}","client_id":"unregistered","timestamp":1718235392,"id":"aWDjmzACcP2RHet1Rzvbvr"}

# data: {"message":"{\"simple_message\":{\"message\":\"ahh its the two sessions\",\"senders_name\":\"person\"}}","client_id":"person","timestamp":1718235400,"id":"tzDk1dw9BFuUx1LGBkmXRq"}

# data: {"message":"{\"reaction\":{\"message_id\":\"aWDjmzACcP2RHet1Rzvbvr\",\"reaction_text\":\"🤦‍♂️\"}}","client_id":"person","timestamp":1718235403,"id":"pCw6MAwBoYQaaZmPN1NXJE"}

# data: {"message":"{\"reaction\":{\"message_id\":\"tzDk1dw9BFuUx1LGBkmXRq\",\"reaction_text\":\"👍\"}}","client_id":"unregistered","timestamp":1718235405,"id":"6wMhePpMxqLWgjsbocT6xR"}

# : keep-alive-text

# : keep-alive-text

# : keep-alive-text

Next the machine sends a message to the chat room.

curl http://localhost:3000/add\?thread\=home -H "Content-Type: application/json" -d '{
    "simple_message": {
        "message":"whatsup"
    }
}'
Back to Documentation