Skip to content

feat: Add buttplug.io integration#517

Merged
lalalune merged 6 commits into
elizaOS:mainfrom
8times4:main
Nov 26, 2024
Merged

feat: Add buttplug.io integration#517
lalalune merged 6 commits into
elizaOS:mainfrom
8times4:main

Conversation

@8times4
Copy link
Copy Markdown
Contributor

@8times4 8times4 commented Nov 22, 2024

Relates to:

https://fxtwitter.com/shawmakesmagic/status/1859888258358137158

Risks

Low (may buzz your bum tho')

Background

What does this PR do?

This adds a Buttplug.io service to allow Eliza to vibrate intimate toys using a local intiface server.

What kind of change is this?

Features (non-breaking change which adds functionality)

Documentation changes needed?

If a docs change is needed: I have updated the documentation accordingly.

Testing

Detailed testing steps

Requires bun for now:
(assumes that packages have been built, as intiface-engine is downloaded within build.sh )

cd packages/plugin-buttplug && pnpm run test-via-bun

Expected output:

> @ai16z/plugin-buttplug@0.1.4-alpha.3 test-via-bun .../eliza/packages/plugin-buttplug
> bun test/simulate.ts

[fake-buttplug] Starting simulator service
[fake-buttplug] Connecting Lovense Nora to port 54817
[fake-buttplug] Lovense Nora error: WebSocket connection to 'ws://127.0.0.1:54817/' failed: Failed to connect
[fake-buttplug] Lovense Nora disconnected
Couldn't connect to Buttplug server, attempting to start Intiface Engine...
[fake-buttplug] Connecting Lovense Nora to port 54817
[fake-buttplug] Lovense Nora error: WebSocket connection to 'ws://127.0.0.1:54817/' failed: Failed to connect
[fake-buttplug] Lovense Nora disconnected
[fake-buttplug] Connecting Lovense Nora to port 54817
[fake-buttplug] Lovense Nora connected
[fake-buttplug] Lovense Nora received: DeviceType;
[fake-buttplug] Sent device type response: A:696969696969:10
Using real Buttplug device: Lovense Nora
Starting test sequence with: Lovense Nora

=== Testing Battery Level ===
[fake-buttplug] Lovense Nora received: Battery;
[fake-buttplug] Battery query received, responding with: 90;
[Simulation] Battery level for Lovense Nora: 90%
Battery level: 90%

=== Testing Vibration ===
Vibrating at 25%
[Simulation] Vibrating Lovense Nora at 25%
[fake-buttplug] Lovense Nora received: Vibrate:5;
[fake-buttplug] Vibrate command logged: Vibrate:5;
Vibrating at 75%
[Simulation] Vibrating Lovense Nora at 75%
[fake-buttplug] Lovense Nora received: Vibrate:15;
[fake-buttplug] Vibrate command logged: Vibrate:15;
Stopping vibration
[Simulation] Stopping Lovense Nora
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;
[fake-buttplug] Lovense Nora received: Rotate:0;

=== Testing Rapid Changes ===
Quick pulse 1/5
[Simulation] Vibrating Lovense Nora at 80%
[fake-buttplug] Lovense Nora received: Vibrate:16;
[fake-buttplug] Vibrate command logged: Vibrate:16;
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;
[Simulation] Stopping Lovense Nora
Quick pulse 2/5
[Simulation] Vibrating Lovense Nora at 80%
[fake-buttplug] Lovense Nora received: Vibrate:16;
[fake-buttplug] Vibrate command logged: Vibrate:16;
[Simulation] Stopping Lovense Nora
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;
Quick pulse 3/5
[Simulation] Vibrating Lovense Nora at 80%
[fake-buttplug] Lovense Nora received: Vibrate:16;
[fake-buttplug] Vibrate command logged: Vibrate:16;
[Simulation] Stopping Lovense Nora
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;
Quick pulse 4/5
[Simulation] Vibrating Lovense Nora at 80%
[fake-buttplug] Lovense Nora received: Vibrate:16;
[fake-buttplug] Vibrate command logged: Vibrate:16;
[Simulation] Stopping Lovense Nora
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;
Quick pulse 5/5
[Simulation] Vibrating Lovense Nora at 80%
[fake-buttplug] Lovense Nora received: Vibrate:16;
[fake-buttplug] Vibrate command logged: Vibrate:16;
[Simulation] Stopping Lovense Nora
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;

=== Checking Battery After Usage ===
[fake-buttplug] Lovense Nora received: Battery;
[fake-buttplug] Battery query received, responding with: 90;
[Simulation] Battery level for Lovense Nora: 90%
Battery level after tests: 90%

=== Test Sequence Complete ===
[Simulation] Stopping Lovense Nora

Other test:

start Eliza with some character conf, i.e:

    plugins: [buttplugPlugin],
    // clients: [],
    modelProvider: ModelProviderName.GROQ,
    settings: {
        secrets: {},
        buttplug: true,
        voice: {
            model: "en_US-hfc_female-medium",
        },
    },

run: bun run packages/plugin-buttplug/test/fake-buttplug.ts

[fake-buttplug] Starting simulator service
[fake-buttplug] Connecting Lovense Nora to port 54817
[fake-buttplug] Lovense Nora connected
[fake-buttplug] Lovense Nora received: DeviceType;
[fake-buttplug] Sent device type response: A:696969696969:10

Ask Eliza: "Make it buzz at max power for 5 seconds"

Output:


You: Make it buzz at max power for 5 seconds
 ["◎ Querying knowledge for: make it buzz at max power for 5 seconds"] 

 ["◎ Genarating message response.."] 

 ["◎ Genarating text..."] 

Initializing Groq model.
Received response from Groq model.
 ◎ LOGS
   Evaluating 
   GET_FACTS 

 ◎ LOGS
   Evaluating 
   UPDATE_GOAL 

 ["✓ Normalized action: vibrate"] 

 ["✓ Executing handler for action: VIBRATE"] 

Agent: Vibrating at 50% intensity for 2000ms

fake-buttplug.ts output, unless you own a device:

[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Lovense Nora received: Rotate:0;
[fake-buttplug] Lovense Nora received: Vibrate:10;
[fake-buttplug] Vibrate command logged: Vibrate:10;
[fake-buttplug] Lovense Nora received: Vibrate:0;
[fake-buttplug] Vibrate command logged: Vibrate:0;

Same for Battery:


You: check my battery
 ["◎ Querying knowledge for: check my battery"] 

 ["◎ Genarating message response.."] 

 ["◎ Genarating text..."] 

Initializing Groq model.
Received response from Groq model.
 ◎ LOGS
   Evaluating 
   GET_FACTS 

 ◎ LOGS
   Evaluating 
   UPDATE_GOAL 

 ["✓ Normalized action: battery"] 

 ["✓ Executing handler for action: BATTERY"] 

Battery level for Lovense Nora: 90%
Agent: Device battery level is at 90%

..

[fake-buttplug] Lovense Nora received: Battery;
[fake-buttplug] Battery query received, responding with: 90;

@awidearray
Copy link
Copy Markdown
Contributor

what do i need to buy to test this though, ya know... for research

@8times4
Copy link
Copy Markdown
Contributor Author

8times4 commented Nov 22, 2024

what do i need to buy to test this though, ya know... for research

here’s an affiliate link just for ya ☠️: https://www.lovense.com/r/rf3aal

@lalalune
Copy link
Copy Markdown
Member

DUDE you are awesome. DM or drop your wallet address please

@8times4 8times4 marked this pull request as ready for review November 22, 2024 21:33
@elizaOS elizaOS deleted a comment Nov 26, 2024
@lalalune lalalune merged commit 7c83578 into elizaOS:main Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants