Skip to content

carlostkd/Lumo-Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

48 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Lumo API 🧠

Please read the version-3 for extended features.

Copyright @Carlostkd

warning ⚠️ If you have installed the previous version to use the new features you need install:

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. πŸŽ‰

Key Features ✨

  • 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

Installation πŸ› οΈ

1. Clone this repository:

git clone https://github.com/carlostkd/lumo-api.git
cd lumo-api

2. Install dependencies:

npm init -y

npm install express puppeteer-core puppeteer body-parser cors multer nodemailer yaml


run the app

node index.js

3. Set up your token:

In index.js, replace YOUR_SECRET_TOKEN_HERE with your secret token for API authentication.

4. Run the server:

node index.js

and wait until you see "login detected"

The server will be running on http://localhost:3000.

Usage πŸ„β€β™‚οΈ

Sending a Prompt to Lumo

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."

Enabling Web Search

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}'

Disabling Web Search

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}'

Enabling Ghost mode

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}' 

Disabling Ghost mode

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}'

Start New Chat

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 Files (max 10 dont know the real limit of Lumo...)

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"            

Delete Files

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 chat Logging

Chat logs are saved when you START A NEW CHAT

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"}'

Disable chat Logging

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}'

Show all available commands

curl http://localhost:3000/api/help

πŸ”„ Lumo vs. Lumo: The Evolving Function Showdown! πŸ€–βš‘

πŸ₯Š 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

Troubleshooting ⚠️

  • 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 Authorization header.

Contributing πŸ’‘

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

About

Lumo AI by Pronto - API to intregate on your personal projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published