NEW Introducing Lumo Chat
A new Headless version of the Api just arrived : Take a Look
*** Create Project ***
curl -X POST http://localhost:3000/api/create-project \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{
"projectName": "My Test Project",
"projectInstructions": "Use a formal tone and be concise"
}'*** Upload File or multiple files to the Project ***
curl -X POST http://localhost:3000/api/upload-file \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-F "files=@./test2.txt"*** Send prompt to sumarize the files ***
curl -X POST http://localhost:3000/api/send-prompt \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{ "prompt": "Summarize the last uploaded file." }'*** To delete files you can use the same previous commands ***
*** Leave the project and return to normal chat ***
curl -X POST http://localhost:3000/api/start-new-chat \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json"*** To Open a project you need to know the project name ***
curl -X POST http://localhost:3000/api/open-project \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{ "projectName": "My Project" }'Copyright @Carlostkd
warning
npm install multer yaml nodemailer
warning β οΈ chat loggin function logs the Ghost chats too useful to keep saved chats on your end but not online.
Welcome to Lumo API! π A powerful and flexible API for interacting with the Lumo AI powered by Proton.
This API allows you to integrate Proton Lumo Assistante in any of your Projects - web apps or mobile apps. π
- Send Prompts: Send messages to Lumo and receive responses to interact with Proton Lumo.
- Web Search Toggle: Enable or disable the web search functionality when needed. π
- Secure API: Authentication via token security to make sure only authorized users can send requests. π
- Turn on/off Ghost mode:π» No one can sees you
- Start Fresh:π¬ Start a new chat when you want
- Upload and delete files:π¬ Always like a pro
- Chat Logging:π¬ Gives you full controle of yours chat
- Help Function: List all available commands
- Talk with Hmas Api: π¬ Get Hacker Messages as Service in your projects
- Lumo-Api can analyze your computer: π¬ Like a real cybersecurity Cat
git clone https://github.com/carlostkd/lumo-api.git
cd lumo-apinpm init -y
npm install express puppeteer-core puppeteer body-parser cors multer nodemailer yaml axios
run the app
node index.js
In index.js, replace YOUR_SECRET_TOKEN_HERE with your secret token for API authentication.
node index.js
and wait until you see "login detected"The server will be running on http://localhost:3000.
You can send a prompt using curl:
curl -X POST http://localhost:3000/api/send-prompt
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE"
-H "Content-Type: application/json"
-d '{"prompt": "What is the weather in Zurich?"}'Youβll receive a response from the Lumo like:
"The weather in Zurich is clear skies with a temperature of 15Β°C."To enable web search (useful for weather, news, etc.):
curl -X POST http://localhost:3000/api/set-websearch
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE"
-H "Content-Type: application/json"
-d '{"enabled": true}'To disable web search:
curl -X POST http://localhost:3000/api/set-websearch
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE"
-H "Content-Type: application/json"
-d '{"enabled": false}'To enable Ghost Mode :
curl -X POST http://localhost:3000/api/set-ghostmode \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"enabled": true}' To disable Ghost Mode:
curl -X POST http://localhost:3000/api/set-ghostmode \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'To start a new chat:
curl -X POST http://localhost:3000/api/start-new-chat \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json"Upload file or multi files:
curl -X POST http://localhost:3000/api/upload-file \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-F "files=@./test.html" \
-F "files=@./test2.txt" \
-F "files=@./test3.txt"curl -X POST http://localhost:3000/api/upload-file \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-F "files=@./test.html" To delete one by one or all:
curl -X POST http://localhost:3000/api/remove-file \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"mode":"all"}'curl -X POST http://localhost:3000/api/remove-file \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"mode":"single"}'Enable Loggin and choose the format (json is default available is txt and csv):
curl -X POST http://localhost:3000/api/set-save-chat \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"enabled": true, "format": "csv"}'Chat logs are saved when you START A NEW CHAT you can always disable:
curl -X POST http://localhost:3000/api/set-save-chat \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"enabled": false}'curl http://localhost:3000/api/helpπ₯ Round 1: Lumo vs Lumo-api
π¬ How It Works
Send Your Prompt βοΈ
Type in your initial question or topic Let Lumo know what you're curious about
Set the Turns βοΈ
Choose how many back-and-forth exchanges you want From quick chats to deep dives you're in control!
π Behind the Scenes
Our enhanced code works its magic by:
Analyzing responses in real-time Identifying key topics and themes Generating context-aware follow-up questions Gracefully handling errors to maintain flow
π― Why It's Awesome
β Natural Conversations: Feels more like talking to a friend than a bot
β Smooth Transitions: Effortlessly moves between related topics
β Error Resistant: Keeps the conversation going even when things get tricky
β Customizable Length: You decide how long the chat should be
β Engaging Interactions: Smart follow-ups make conversations more interesting
π‘ Try It Out!
curl -X POST http://localhost:3000/api/send-automated-dialogue \
-H "Authorization: Bearer YOUR_SECRET_TOKEN_HERE" \
-H "Content-Type: application/json" \
-d '{"initialPrompt": "what is proton lumo", "maxTurns": 30}'Watch the Conversation Flow π
Sit back and enjoy the natural, engaging dialogue See Lumo smoothly transition between topics Witness intelligent follow-up questions that keep the conversation lively
-
Issue: No response after sending a prompt.
- Solution: Make sure you're logged in manually in the browser window launched by Puppeteer.
-
Issue: Invalid token errors.
- Solution: Ensure you are passing the correct token in the
Authorizationheader.
- Solution: Ensure you are passing the correct token in the
If you find Lumo API useful, consider buying me a coffee (or a whole espresso machine).
Your donation helps keep the AI sharp, the jokes fresh, and the servers humming.
If you'd like to contribute to this project, feel free to fork it, make changes, and open a pull request!
Any improvement, whether big or small, is welcome. π±
added python UI Interface
