Repository: AnubhavChaturvedi-GitHub/Just-A-Rather-Very-Intelligent-System Branch: main Commit: 33f1230d5fcc Files: 55 Total size: 129.5 KB Directory structure: gitextract_zdy_radx/ ├── Alam_data.txt ├── Alert.py ├── Automation/ │ ├── Automation_Brain.py │ ├── Battery.py │ ├── Play_Music_YT.py │ ├── Web_Data.py │ ├── Web_Open.py │ ├── Youtube_play_back.py │ ├── open_App.py │ ├── playmusic_Sfy.py │ ├── scrool_system.py │ └── tab_automation.py ├── Brain/ │ └── brain.py ├── Data/ │ └── DLG_Data.py ├── Features/ │ ├── br_persentage.py │ ├── check_running_app.py │ ├── clap_d.py │ ├── clap_with_music.py │ ├── create_file.py │ ├── find_my_ip.py │ ├── get_advice.py │ ├── get_jokes.py │ ├── mike_health.py │ ├── set_br.py │ ├── set_get_volume.py │ └── speaker_health.py ├── LICENSE ├── NetHyTechSTT/ │ └── listen.py ├── New/ │ └── datafeatch.py ├── PyWhatKit_DB.txt ├── README.md ├── Real_Time/ │ ├── google_big.py │ └── google_small.py ├── TextToImage/ │ └── gen_image.py ├── TextToSpeech/ │ └── Fast_DF_TTS.py ├── Time_Operations/ │ ├── brain.py │ └── throw_alert.py ├── Vision/ │ ├── MVbrain.py │ └── Vbrain.py ├── Weather_Check/ │ └── check_weather.py ├── Whatsapp_automation/ │ └── wa.py ├── chat_hystory.txt ├── co_brain.py ├── conv_history.txt ├── demo.py ├── history.txt ├── input.txt ├── internet_check.py ├── jarvis.py ├── log.txt ├── requirements.txt ├── schedule.txt ├── setup.py ├── speech_output.txt └── ui.py ================================================ FILE CONTENTS ================================================ ================================================ FILE: Alam_data.txt ================================================ 12:31AM ================================================ FILE: Alert.py ================================================ import os from winotify import Notification, audio from os import getcwd def Alert(Text): icon_path = r"C:\Users\chatu\OneDrive\Desktop\Jarvis\logo.png" toast = Notification( app_id="🟢 J.A.R.V.I.S.", title=Text, duration="long", icon=icon_path ) toast.set_audio(audio.Default, loop=False) toast.add_actions(label="Click me", launch="https://www.google.com") toast.add_actions(label="Dismiss", launch="https://www.google.com") toast.show() ================================================ FILE: Automation/Automation_Brain.py ================================================ from Automation.open_App import open_App from Automation.Web_Open import openweb import pyautogui as gui from Automation.Play_Music_YT import play_music_on_youtube from TextToSpeech import Fast_DF_TTS from Automation.playmusic_Sfy import play_music_on_spotify from Automation.Battery import check_percentage from os import getcwd import time from Automation.tab_automation import perform_browser_action from Automation.Youtube_play_back import perform_media_action import pywhatkit from Automation.scrool_system import perform_scroll_action import threading from TextToSpeech.Fast_DF_TTS import speak def play(): gui.press("space") def search_google(text): pywhatkit.search(text) def close(): gui.hotkey('alt','f4') def search(text): gui.press("/") time.sleep(0.3) gui.write(text) def Open_Brain(text): if "website" in text or "open website named" in text: text = text.replace("open","").strip() text = text.replace("website","").strip() text = text.replace("open website named","").strip() t1 = threading.Thread(target=speak,args=(f"Navigating {text} website",)) t2 = threading.Thread(target=openweb,args=(text,)) t1.start() t2.start() t1.join() t2.join() else: text = text.replace("open","").strip() text = text.replace("app","").strip() t1 = threading.Thread(target=speak,args=(f"Navigating {text} application",)) t2 = threading.Thread(target=open_App,args=(text,)) t1.start() t2.start() t1.join() t2.join() def clear_file(): with open(f"{getcwd()}\\input.txt","w") as file: file.truncate(0) def Auto_main_brain(text): try: if text.startswith("open"): Open_Brain(text) elif "close" in text: close() elif "play music" in text or "play music on youtube" in text: Fast_DF_TTS.speak("which song do you want to play sir.") clear_file() output_text = "" while True: with open("input.txt","r") as file: input_text = file.read().lower() if input_text != output_text: output_text = input_text if output_text.endswith("song"): play_music_on_youtube(output_text) break else: pass elif "play some music" in text or "play music on spotify" in text: Fast_DF_TTS.speak("Which song do you want to play, sir.") clear_file() output_text = "" while True: with open("input.txt", "r") as file: input_text = file.read().lower() if input_text != output_text: output_text = input_text if output_text.endswith("song"): play_music_on_spotify(output_text) break elif "check battery percentage" in text or "check battery level" in text: check_percentage() elif text.startswith("search"): text = text.replace("search","") text = text.strip() t1 = threading.Thread(target=speak,args=(f"doing research about {text}",)) t2 = threading.Thread(target=search,args=(text,)) t1.start() t2.start() t1.join() t2.join() time.sleep(0.5) gui.press("enter") elif "search in google" in text: text = text.replace("search in google","") t1 = threading.Thread(target=speak,args=(f"performing research about {text} in google search engine",)) t2 = threading.Thread(target=search_google,args=(text,)) t1.start() t2.start() t1.join() t2.join() elif "play" in text or "stop" in text or "pause" in text: play() else: perform_browser_action(text) perform_media_action(text) perform_scroll_action(text) except Exception as e: print("error : " + e) ================================================ FILE: Automation/Battery.py ================================================ # pip install psutil # CTRL + J Terminal import psutil import time import time from TextToSpeech.Fast_DF_TTS import speak import threading from Alert import Alert battery = psutil.sensors_battery() def battery_Alert(): while True: time.sleep(3) percentage = int(battery.percent) if percentage == 100: t1 = threading.Thread(target=Alert,args=("100%charge",)) t2 = threading.Thread(target=speak,args=("100% charged. Please unplug it.",)) t1.start() t2.start() t1.join() t2.join() elif percentage <= 20: t1 = threading.Thread(target=Alert,args=("Battery Low",)) t2 = threading.Thread(target=speak,args=("Sir,Sorry to disturb you but battery is Low now",)) t1.start() t2.start() t1.join() t2.join() elif percentage <=10: t1 = threading.Thread(target=Alert,args=("Battery is too Low",)) t2 = threading.Thread(target=speak,args=("Sir,Sorry to disturb you but we are running on very low battery power",)) t1.start() t2.start() t1.join() t2.join() elif percentage <= 5: t1 = threading.Thread(target=Alert,args=("Battery is going to died",)) t2 = threading.Thread(target=speak,args=("Sir,Sorry to disturb you but this is your last chance sir , charge your system now",)) t1.start() t2.start() t1.join() t2.join() time.sleep(10) def check_plug(): print("_____started___") battery = psutil.sensors_battery() previous_state = battery.power_plugged while True: battery = psutil.sensors_battery() if battery.power_plugged != previous_state: if battery.power_plugged: t1 = threading.Thread(target=Alert,args=("Charging **STARTED**",)) t2 = threading.Thread(target=speak,args=("Charging Started",)) t1.start() t2.start() t1.join() t2.join() else: t1 = threading.Thread(target=Alert,args=("Charging **STOP**",)) t2 = threading.Thread(target=speak,args=("Charging Stop",)) t1.start() t2.start() t1.join() t2.join() previous_state = battery.power_plugged def check_percentage(): battery = psutil.sensors_battery() percent = int(battery.percent) t1 = threading.Thread(target=Alert,args=(f"The device is running on {percent}% power",)) t2 = threading.Thread(target=speak,args=(f"The device is running on {percent}% power",)) t1.start() t2.start() t1.join() t2.join() ================================================ FILE: Automation/Play_Music_YT.py ================================================ import pywhatkit as pw def play_music_on_youtube(Song_name): pw.playonyt(Song_name) ================================================ FILE: Automation/Web_Data.py ================================================ websites = { "youtube": "www.youtube.com", "facebook": "www.facebook.com", "github": "www.github.com", "youtube studio": "studio.youtube.com", "twitter": "www.twitter.com", "instagram": "www.instagram.com", "linkedin": "www.linkedin.com", "wikipedia": "www.wikipedia.org", "reddit": "www.reddit.com", "pinterest": "www.pinterest.com", "quora": "www.quora.com", "tumblr": "www.tumblr.com", "flickr": "www.flickr.com", "snapchat": "www.snapchat.com", "tiktok": "www.tiktok.com", "vimeo": "www.vimeo.com", "dropbox": "www.dropbox.com", "onedrive": "www.onedrive.com", "google drive": "drive.google.com", "icloud": "www.icloud.com", "amazon": "www.amazon.com", "ebay": "www.ebay.com", "alibaba": "www.alibaba.com", "netflix": "www.netflix.com", "hulu": "www.hulu.com", "disney plus": "www.disneyplus.com", "hbo max": "www.hbomax.com", "spotify": "www.spotify.com", "soundcloud": "www.soundcloud.com", "apple music": "www.apple.com/apple-music", "pandora": "www.pandora.com", "deezer": "www.deezer.com", "bandcamp": "www.bandcamp.com", "bbc": "www.bbc.com", "cnn": "www.cnn.com", "nytimes": "www.nytimes.com", "the guardian": "www.theguardian.com", "forbes": "www.forbes.com", "bloomberg": "www.bloomberg.com", "reuters": "www.reuters.com", "espn": "www.espn.com", "fox news": "www.foxnews.com", "nbc news": "www.nbcnews.com", "cbs news": "www.cbsnews.com", "abc news": "www.abcnews.go.com", "msnbc": "www.msnbc.com", "npr": "www.npr.org", "wsj": "www.wsj.com", "yahoo news": "news.yahoo.com", "buzzfeed": "www.buzzfeed.com", "huffpost": "www.huffpost.com", "canva": "www.canva.com", "chatgpt": "chat.openai.com", "slack": "www.slack.com", "trello": "www.trello.com", "asana": "www.asana.com", "zoom": "www.zoom.us", "skype": "www.skype.com", "microsoft teams": "www.microsoft.com/microsoft-teams", "google meet": "meet.google.com", "webex": "www.webex.com", "jira": "www.atlassian.com/software/jira", "notion": "www.notion.so", "airtable": "www.airtable.com", "monday": "www.monday.com", "clickup": "www.clickup.com", "dropbox paper": "www.dropbox.com/paper", "confluence": "www.atlassian.com/software/confluence", "figma": "www.figma.com", "adobe xd": "www.adobe.com/products/xd.html", "invision": "www.invisionapp.com", "microsoft word": "www.microsoft.com/microsoft-365/word", "google docs": "docs.google.com", "medium": "www.medium.com", "wordpress": "www.wordpress.com", "wix": "www.wix.com", "squarespace": "www.squarespace.com", "shopify": "www.shopify.com", "bigcommerce": "www.bigcommerce.com", "weebly": "www.weebly.com", "godaddy": "www.godaddy.com", "namecheap": "www.namecheap.com", "bluehost": "www.bluehost.com", "siteground": "www.siteground.com", "hostgator": "www.hostgator.com", "dreamhost": "www.dreamhost.com", "a2 hosting": "www.a2hosting.com", "inmotion hosting": "www.inmotionhosting.com", "digitalocean": "www.digitalocean.com", "linode": "www.linode.com", "aws": "aws.amazon.com", "azure": "azure.microsoft.com", "google cloud": "cloud.google.com", "heroku": "www.heroku.com", "gitlab": "www.gitlab.com", "bitbucket": "bitbucket.org", "codepen": "codepen.io", "jsfiddle": "jsfiddle.net", "repl.it": "repl.it", "stack overflow": "stackoverflow.com", "stackoverflow careers": "stackoverflow.com/jobs", "glassdoor": "www.glassdoor.com", "indeed": "www.indeed.com", "linkedin jobs": "www.linkedin.com/jobs", "monster": "www.monster.com", "simplyhired": "www.simplyhired.com", "angel.co": "angel.co", "github jobs": "jobs.github.com", "ziprecruiter": "www.ziprecruiter.com", "careerbuilder": "www.careerbuilder.com", "snagajob": "www.snagajob.com", "dice": "www.dice.com", "jobs": "www.jobs.com", "bamboohr": "www.bamboohr.com", "workday": "www.workday.com", "adp": "www.adp.com", "sap successfactors": "www.sap.com/products/hcm.html", "oracle hcm": "www.oracle.com/applications/human-capital-management", "zenefits": "www.zenefits.com", "paycor": "www.paycor.com", "paycom": "www.paycom.com", "gusto": "www.gusto.com", "square": "squareup.com", "stripe": "www.stripe.com", "paypal": "www.paypal.com", "venmo": "www.venmo.com", "cash app": "cash.app", "robinhood": "www.robinhood.com", "etrade": "www.etrade.com", "fidelity": "www.fidelity.com", "charles schwab": "www.schwab.com", "vanguard": "investor.vanguard.com", "td ameritrade": "www.tdameritrade.com", "coinbase": "www.coinbase.com", "binance": "www.binance.com", "kraken": "www.kraken.com", "blockchain": "www.blockchain.com", "gemini": "www.gemini.com", "bitfinex": "www.bitfinex.com", "bitstamp": "www.bitstamp.net", "bittrex": "www.bittrex.com", "okex": "www.okex.com", "poloniex": "www.poloniex.com", "coindesk": "www.coindesk.com", "cointelegraph": "www.cointelegraph.com", "decrypt": "www.decrypt.co", "cryptoslate": "www.cryptoslate.com", "cryptonews": "www.cryptonews.com", "coinmarketcap": "www.coinmarketcap.com", "coingecko": "www.coingecko.com", "messari": "www.messari.io", "icodrops": "www.icodrops.com", "tokenmarket": "www.tokenmarket.net", "coinpaprika": "www.coinpaprika.com", "cryptocompare": "www.cryptocompare.com", "coincheckup": "www.coincheckup.com", "cryptobriefing": "www.cryptobriefing.com", "blockonomi": "www.blockonomi.com", "coininsider": "www.coininsider.com", "newsbtc": "www.newsbtc.com", "bitcoin.com": "www.bitcoin.com", "ethereum.org": "www.ethereum.org", "litecoin.com": "www.litecoin.com", "ripple.com": "www.ripple.com", "cardano.org": "www.cardano.org", "stellarlumens.com": "www.stellarlumens.com", "tezos.com": "www.tezos.com", "eos.io": "www.eos.io", "neo.org": "www.neo.org", "iota.org": "www.iota.org", "monero.org": "www.monero.org", "zcash.org": "www.zcash.org", "dash.org": "www.dash.org", "dogecoin.com": "www.dogecoin.com", "gpt":"www.chatgpt.com/" } ================================================ FILE: Automation/Web_Open.py ================================================ import webbrowser from Automation.Web_Data import websites def openweb(webname): website_name = webname.lower().split() counts = {} for name in website_name: counts[name] = counts.get(name,0) + 1 urls_to_open = [] for name,count in counts.items(): if name in websites: urls_to_open.extend([websites[name]]*count) for url in urls_to_open: webbrowser.open(url) if urls_to_open: print("opening...") ================================================ FILE: Automation/Youtube_play_back.py ================================================ import pyautogui def volume_up(): pyautogui.press('up') def volume_down(): pyautogui.press('down') def seek_forward(): pyautogui.press('right') def seek_backward(): pyautogui.press('left') def seek_forward_10s(): pyautogui.press('l') def seek_backward_10s(): pyautogui.press('j') def seek_backward_frame(): pyautogui.press(',') def seek_forward_frame(): pyautogui.press('.') def seek_to_beginning(): pyautogui.press('home') def seek_to_end(): pyautogui.press('end') def seek_to_previous_chapter(): pyautogui.hotkey('ctrl', 'left') def seek_to_next_chapter(): pyautogui.hotkey('ctrl', 'right') def decrease_playback_speed(): pyautogui.hotkey('shift', ',') def increase_playback_speed(): pyautogui.hotkey('shift', '.') def move_to_next_video(): pyautogui.hotkey('shift', 'n') def move_to_previous_video(): pyautogui.hotkey('shift', 'p') def perform_media_action(text): if "volume up" in text or "volume badhao" in text: volume_up() elif "volume down" in text or "volume ghatao" in text: volume_down() elif "seek forward" in text or "aage badhao" in text: seek_forward() elif "seek backward" in text or "peeche karo" in text: seek_backward() elif "seek forward 10 seconds" in text or "10 second aage badhao" in text: seek_forward_10s() elif "seek backward 10 seconds" in text or "10 second peeche karo" in text: seek_backward_10s() elif "seek backward frame" in text or "frame peeche karo" in text: seek_backward_frame() elif "seek forward frame" in text or "frame aage badhao" in text: seek_forward_frame() elif "seek to beginning" in text or "shuruat par jao" in text: seek_to_beginning() elif "seek to end" in text or "ant par jao" in text: seek_to_end() elif "seek to previous chapter" in text or "previous chapter par jao" in text: seek_to_previous_chapter() elif "seek to next chapter" in text or "next chapter par jao" in text: seek_to_next_chapter() elif "decrease playback speed" in text or "speed kam karo" in text: decrease_playback_speed() elif "increase playback speed" in text or "speed badhao" in text: increase_playback_speed() elif "move to next video" in text or "next video par jao" in text: move_to_next_video() elif "move to previous video" in text or "previous video par jao" in text: move_to_previous_video() else: pass ================================================ FILE: Automation/open_App.py ================================================ import pyautogui as gui import subprocess import time def open_App(text): try: subprocess.run(text) except Exception as e: gui.press("win") time.sleep(0.2) gui.write(text) time.sleep(0.2) gui.press("enter") ================================================ FILE: Automation/playmusic_Sfy.py ================================================ import webbrowser import pyautogui as ui import time def play_music_on_spotify(song_name): webbrowser.open("https://open.spotify.com/") time.sleep(6) ui.hotkey("ctrl","shift","l") time.sleep(1) ui.write(song_name) time.sleep(3) ui.leftClick(805,515) ================================================ FILE: Automation/scrool_system.py ================================================ import pyautogui def scroll_up(): # Scroll up by pressing the Up arrow key five times pyautogui.press('up', presses=5) def scroll_down(): # Scroll down by pressing the Down arrow key five times pyautogui.press('down', presses=5) def scroll_to_top(): # Scroll to the top of the page pyautogui.hotkey('home') def scroll_to_bottom(): # Scroll to the bottom of the page pyautogui.hotkey('end') def perform_scroll_action(text): if "scroll up" in text or "upar scroll karo" in text: scroll_up() elif "scroll down" in text or "neeche scroll karo" in text: scroll_down() elif "scroll to top" in text or "shuruat par jao" in text: scroll_to_top() elif "scroll to bottom" in text or "ant par jao" in text: scroll_to_bottom() else: pass ================================================ FILE: Automation/tab_automation.py ================================================ import pyautogui def open_new_tab(): pyautogui.hotkey('ctrl', 't') def close_tab(): pyautogui.hotkey('ctrl', 'w') def open_browser_menu(): pyautogui.hotkey('alt', 'f') def zoom_in(): pyautogui.hotkey('ctrl', '+') def zoom_out(): pyautogui.hotkey('ctrl', '-') def refresh_page(): pyautogui.hotkey('ctrl', 'r') def switch_to_next_tab(): pyautogui.hotkey('ctrl', 'tab') def switch_to_previous_tab(): pyautogui.hotkey('ctrl', 'shift', 'tab') def open_history(): pyautogui.hotkey('ctrl', 'h') def open_bookmarks(): pyautogui.hotkey('ctrl', 'b') def go_back(): pyautogui.hotkey('alt', 'left') def go_forward(): pyautogui.hotkey('alt', 'right') def open_dev_tools(): pyautogui.hotkey('ctrl', 'shift', 'i') def toggle_full_screen(): pyautogui.hotkey('f11') def open_private_window(): pyautogui.hotkey('ctrl', 'shift', 'n') def perform_browser_action(text): if "open new tab" in text or "new tab kholo" in text: open_new_tab() elif "close tab" in text or "tab band karo" in text: close_tab() elif "open browser menu" in text or "browser menu kholo" in text: open_browser_menu() elif "zoom in" in text or "zoom in karo" in text: zoom_in() elif "zoom out" in text or "zoom out karo" in text: zoom_out() elif "refresh page" in text or "page refresh karo" in text: refresh_page() elif "switch to next tab" in text or "next tab par jao" in text: switch_to_next_tab() elif "switch to previous tab" in text or "previous tab par jao" in text: switch_to_previous_tab() elif "open history" in text or "history kholo" in text: open_history() elif "open bookmarks" in text or "bookmarks kholo" in text: open_bookmarks() elif "go back" in text or "peeche jao" in text: go_back() elif "go forward" in text or "aage jao" in text: go_forward() elif "open dev tools" in text or "dev tools kholo" in text: open_dev_tools() elif "toggle full screen" in text or "full screen karo" in text: toggle_full_screen() elif "open private window" in text or "private window kholo" in text: open_private_window() else: pass ================================================ FILE: Brain/brain.py ================================================ # from webscout import PhindSearch as brain # ai = brain( # is_conversation=True, # max_tokens=800, # timeout=30, # intro='J.A.R.V.I.S', # filepath=r"C:\Users\chatu\Desktop\J.A.R.V.I.S\chat_hystory.txt", # update_file=True, # proxies={}, # history_offset=10250, # act=None, # ) # def Main_Brain(text): # r = ai.chat(text) # return r from webscout import PhindSearch def Main_Brain(text): ai = PhindSearch(quiet=True, filepath=r"C:\Users\chatu\Desktop\J.A.R.V.I.S\chat_hystory.txt", is_conversation=None) res = ai.chat(text) # internel stream is not available for this Privider return res ================================================ FILE: Data/DLG_Data.py ================================================ online_dlg = [ "Sir, I am online and ready", "Sir, I am online", "I am online, sir", "Sir, my status is online", "I am online, sir, happy to assist you", "Sir, I am now online", "I am online and ready to help, sir", "Sir, I have gone online", "Sir, I am online, awaiting your command", "Sir, I am online and at your service", "Online and ready, sir", "I am online and here to assist, sir", "Sir, I am now online and ready", "Sir, I am online and ready to serve", "Sir, I am online and operational", "Sir, I have gone online and am ready to assist", "Sir, I am online and available", "Online and at your service, sir", "Sir, I am online and prepared to help", "Sir, I am online and standing by", "Sir, I am online, how can I assist?", "Sir, I am online and awaiting your instructions", "Sir, I am now online, how can I help?", "Sir, I am online and ready for your commands", "Sir, I am online and ready to take your orders", "Sir, I am online and ready for duty", "Online and ready to assist, sir", "Sir, I am online, what do you need?", "Sir, I am online, how can I serve you?", "Sir, I am online and at your disposal", "Sir, I am online, what can I do for you?", "Sir, I am online, ready and waiting", "Sir, I am online and ready to go", "Sir, I am online and ready to support you", "Sir, I am online, your command is my wish", "Sir, I am online and ready for action", "Sir, I am online, ready to serve", "Sir, I am online and here to help", "Sir, I am online, how can I be of assistance?", "Sir, I am online, how may I assist you?", "Sir, I am online and at your service, awaiting commands", "Sir, I am online and ready to execute your commands", "Sir, I am online and ready to perform tasks", "Sir, I am online and ready to assist with any tasks", "Sir, I am online and ready to aid you", "Sir, I am online and ready to handle your requests", "Sir, I am online and here to serve you", "Sir, I am online and at your command", "Sir, I am online and awaiting your requests", "Sir, I am online and ready for instructions", "Sir, I am online and prepared to assist with any task", "Sir, I am online and ready to follow your orders", "Sir, I am online and prepared to serve", "Sir, I am online, ready to assist", "Sir, I am online and ready to support", "Sir, I am online, here to help", "Sir, I am online and ready to execute orders", "Sir, I am online and ready for your instructions", "Sir, I am online and ready to provide assistance", "Sir, I am online and awaiting your commands", "Sir, I am online and here to aid you", "Sir, I am online and ready for your tasks", "Sir, I am online and ready for any commands", "Sir, I am online and ready to work", "Sir, I am online and ready to be of service", "Sir, I am online and at your disposal, ready to help", "Sir, I am online and ready to take on tasks", "Sir, I am online and prepared to assist in any way", "Sir, I am online and ready to fulfill your requests", "Sir, I am online and ready to help you", "Sir, I am online and prepared for your instructions", "Sir, I am online and ready to follow your lead", "Sir, I am online and at your beck and call", "Sir, I am online and ready to serve you", "Sir, I am online and ready to assist with any requests", "Sir, I am online and ready to follow your commands", "Sir, I am online and here to assist with anything", "Sir, I am online and ready for any task", "Sir, I am online and ready for your guidance", "Sir, I am online and ready to assist you in any way", "Sir, I am online and ready to perform", "Sir, I am online and at your service, ready to help", "Sir, I am online and ready for any instructions", "Sir, I am online and ready to assist with all tasks", "Sir, I am online and prepared for any requests", "Sir, I am online and ready to take on any task", "Sir, I am online and ready for your directions", "Sir, I am online and ready to assist with whatever you need", "Sir, I am online and ready to serve your needs", "Sir, I am online and ready to execute your tasks", "Sir, I am online and ready to be at your service", "Sir, I am online and ready to assist in any tasks", "Sir, I am online and ready to perform any duty", "Sir, I am online and prepared to assist you", "Sir, I am online and ready for your requests", "Sir, I am online and ready for any duty", "Sir, I am online and ready to fulfill any request", ] offline_dlg = [ "Sir, I am offline. Please connect to the WiFi or internet", "Sir, I am currently offline. Please check the internet connection", "I am offline, sir. Kindly connect me to the internet", "Sir, my status is offline. Please ensure I am connected to the network", "I am offline, sir. Please establish an internet connection", "Sir, I am offline. Please connect me to the internet", "Sir, I am offline. Kindly check the network connection", "Sir, I am offline. Please reconnect me to the WiFi", "Sir, I am offline. A network connection is required", "Sir, I am offline. Please connect to the internet", "Offline, sir. Please check the WiFi connection", "Sir, I am offline. Internet connection needed", "Sir, I am offline. Please verify the internet connection", "Sir, I am offline. Network connection required", "Sir, I am offline. Please reconnect to the internet", "Sir, I am offline. WiFi connection needed", "Sir, I am offline. Please ensure network connectivity", "Offline status, sir. Please connect to the WiFi", "Sir, I am offline. Please verify the network connection", "Sir, I am offline. Internet access required", "Sir, I am offline. Please check the internet connection", "Sir, I am offline. Please ensure a stable network connection", "Sir, I am offline. Please reconnect to the network", "Sir, I am offline. A WiFi connection is needed", "Sir, I am offline. Internet connection is necessary", "Sir, I am offline. Please check WiFi or internet", "Sir, I am offline. Network access required", "Sir, I am offline. Please establish a connection to the internet", "Sir, I am offline. Internet connection needed", "Sir, I am offline. Please connect me to the network", "Sir, I am offline. Please ensure internet connectivity", "Sir, I am offline. Network connection needed", "Sir, I am offline. Please verify internet access", "Sir, I am offline. Please connect to WiFi", "Sir, I am offline. Please ensure a network connection", "Sir, I am offline. Please connect me to the WiFi", "Sir, I am offline. Please reconnect to the internet", "Sir, I am offline. Please check the network connection", "Sir, I am offline. WiFi connection required", "Sir, I am offline. Network connectivity is needed", "Sir, I am offline. Internet access required", "Sir, I am offline. Please ensure a stable internet connection", "Sir, I am offline. Please connect to the network", "Sir, I am offline. Internet connection required", "Sir, I am offline. Please establish a network connection", "Sir, I am offline. Please reconnect to the WiFi", "Sir, I am offline. Please ensure a stable WiFi connection", "Sir, I am offline. Network access needed", "Sir, I am offline. Please connect to the internet", "Sir, I am offline. WiFi access required", "Sir, I am offline. Please ensure network access", "Sir, I am offline. Please check the WiFi connection", "Sir, I am offline. Please ensure an internet connection", "Sir, I am offline. Network connection required", "Sir, I am offline. Internet connection needed", "Sir, I am offline. Please connect me to the network", "Sir, I am offline. Please ensure internet access", "Sir, I am offline. Network connectivity required", "Sir, I am offline. Please check the network connection", "Sir, I am offline. Please reconnect to the WiFi", "Sir, I am offline. Internet connectivity required", "Sir, I am offline. Network access needed", "Sir, I am offline. Please verify the internet connection", "Sir, I am offline. WiFi connection needed", "Sir, I am offline. Please check the internet access", "Sir, I am offline. Please ensure a WiFi connection", "Sir, I am offline. Please reconnect to the network", "Sir, I am offline. Internet access needed", "Sir, I am offline. Network connection is required", "Sir, I am offline. Please connect to the WiFi", "Sir, I am offline. Please ensure internet connectivity", "Sir, I am offline. Network access required", "Sir, I am offline. Please verify network connection", "Sir, I am offline. Please check the WiFi connection", "Sir, I am offline. Internet connection required", "Sir, I am offline. Network connection needed", "Sir, I am offline. Please connect to the internet", "Sir, I am offline. Please ensure network access", "Sir, I am offline. Please check the network connectivity", "Sir, I am offline. Please reconnect to the internet", "Sir, I am offline. Internet access required", "Sir, I am offline. Please ensure a network connection", "Sir, I am offline. Please verify internet connection", "Sir, I am offline. Please check the WiFi or internet connection", "Sir, I am offline. Network connection required", "Sir, I am offline. Please reconnect to the network", "Sir, I am offline. Please connect to WiFi or internet", "Sir, I am offline. Please ensure WiFi access", "Sir, I am offline. Internet connection is needed", "Sir, I am offline. Please check WiFi or internet access", "Sir, I am offline. Please establish network connectivity", ] ================================================ FILE: Features/br_persentage.py ================================================ import wmi from TextToSpeech.Fast_DF_TTS import speak def get_brightness_windows(): try: w = wmi.WMI(namespace='wmi') brightness_methods = w.WmiMonitorBrightness() brightness_percentage = brightness_methods[0].CurrentBrightness return brightness_percentage except Exception as e: return f"Error: {e}" def check_br_persentage(): brightness = get_brightness_windows() speak(f"Current Brightness: {brightness}%") ================================================ FILE: Features/check_running_app.py ================================================ import psutil def get_running_apps_windows(): try: # Get a list of running processes processes = [proc.name() for proc in psutil.process_iter(['name'])] return list(set(processes)) # Remove duplicates except Exception as e: return f"Error: {e}" def check_running_app(): running_apps = get_running_apps_windows() print("Running Applications:") for app in running_apps: print(app) ================================================ FILE: Features/clap_d.py ================================================ import pyaudio import struct import math INITIAL_TAP_THRESHOLD = 0.7222 FORMAT = pyaudio.paInt16 SHORT_NORMALIZE = (1.0 / 32768.0) CHANNELS = 3 RATE = 44100 INPUT_BLOCK_TIME = 0.01 INPUT_FRAMES_PER_BLOCK = int(RATE * INPUT_BLOCK_TIME) OVERSENSITIVE = 9.0 / INPUT_BLOCK_TIME UNDERSENSITIVE = 10.0 / INPUT_BLOCK_TIME MAX_TAP_BLOCKS = 0.15 / INPUT_BLOCK_TIME REQUIRED_CLAPS = 2 # Adjust this value as needed class TapTester(object): def __init__(self): self.pa = pyaudio.PyAudio() self.stream = self.open_mic_stream() self.tap_threshold = INITIAL_TAP_THRESHOLD self.noisycount = MAX_TAP_BLOCKS + 1 self.quietcount = 0 self.errorcount = 0 def stop(self): self.stream.close() def find_input_device(self): device_index = None for i in range(self.pa.get_device_count()): devinfo = self.pa.get_device_info_by_index(i) for keyword in ["mic", "input"]: if keyword in devinfo["name"].lower(): device_index = i return device_index if device_index is None: print("No preferred input found; using default input device.") return device_index def open_mic_stream(self): device_index = self.find_input_device() stream = self.pa.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, input_device_index=device_index, frames_per_buffer=INPUT_FRAMES_PER_BLOCK) return stream @staticmethod def get_rms(block): count = len(block) / 2 format = "%dh" % count shorts = struct.unpack(format, block) sum_squares = 0.0 for sample in shorts: n = sample * SHORT_NORMALIZE sum_squares += n * n return math.sqrt(sum_squares / count) def listen(self): try: block = self.stream.read(INPUT_FRAMES_PER_BLOCK) except IOError as e: self.errorcount += 1 print("(%d) Error recording: %s" % (self.errorcount, e)) self.noisycount = 5 return amplitude = self.get_rms(block) if amplitude > self.tap_threshold: self.quietcount = 2 self.noisycount += 1 if self.noisycount > OVERSENSITIVE: self.tap_threshold *= 1.5 else: if 1 <= self.noisycount <= MAX_TAP_BLOCKS: return True self.noisycount = 0 self.quietcount += 1 if self.quietcount > UNDERSENSITIVE: self.tap_threshold *= 1 def clap_detect(): while True: tt = TapTester() clap_count = 0 while True: if tt.listen(): clap_count += 2 if clap_count == REQUIRED_CLAPS: print("clap dectected") break ================================================ FILE: Features/clap_with_music.py ================================================ import os import pygame import random from pygame import mixer from Features.clap_d import * def play_random_music(folder_path): music_files = [file for file in os.listdir(folder_path) if file.endswith(('.mp3', '.wav', '.ogg', '.flac'))] if not music_files: print("No music files found in the specified folder.") return selected_music = random.choice(music_files) music_path = os.path.join(folder_path, selected_music) try: # Initialize pygame and mixer pygame.init() mixer.init() # Load and play the selected music file in the background mixer.music.load(music_path) mixer.music.play() # Wait for the music to finish (or you can add some delay or user input here) while pygame.mixer.music.get_busy(): pygame.time.Clock().tick(10) # Adjust the tick value as needed # Stop and quit pygame mixer mixer.music.stop() mixer.quit() except Exception as e: print(f"Error playing music: {e}") def clap_to_music(): while True: tt = TapTester() clap_count = 0 while True: if tt.listen(): clap_count += 2 if clap_count == REQUIRED_CLAPS: play_random_music(r"C:\Users\chatu\OneDrive\Desktop\J.A.R.V.I.S\DATA\MUSIC") break ================================================ FILE: Features/create_file.py ================================================ def get_file_extension(text): if "python file" in text: ex = ".py" elif "java file" in text: ex = ".java" elif "text file" in text: ex = ".txt" elif "html file" in text: ex = ".html" elif "css file" in text: ex = ".css" elif "javascript file" in text: ex = ".js" elif "json file" in text: ex = ".json" elif "xml file" in text: ex = ".xml" elif "csv file" in text: ex = ".csv" elif "markdown file" in text: ex = ".md" elif "yaml file" in text: ex = ".yaml" elif "image file" in text: ex = ".jpg" # You can add more image extensions if needed elif "video file" in text: ex = ".mp4" # You can add more video extensions if needed elif "audio file" in text: ex = ".mp3" # You can add more audio extensions if needed elif "pdf file" in text: ex = ".pdf" elif "word file" in text: ex = ".docx" elif "excel file" in text: ex = ".xlsx" elif "powerpoint file" in text: ex = ".pptx" elif "zip file" in text: ex = ".zip" elif "tar file" in text: ex = ".tar" else: ex = "" # Default case if no match found return ex def update_text(text): if "python file" in text: text = text.replace("python file", "") elif "java file" in text: text = text.replace("java file", "") elif "text file" in text: text = text.replace("text file", "") elif "html file" in text: text = text.replace("html file", "") elif "css file" in text: text = text.replace("css file", "") elif "javascript file" in text: text = text.replace("javascript file", "") elif "json file" in text: text = text.replace("json file", "") elif "xml file" in text: text = text.replace("xml file", "") elif "csv file" in text: text = text.replace("csv file", "") elif "markdown file" in text: text = text.replace("markdown file", "") elif "yaml file" in text: text = text.replace("yaml file", "") elif "image file" in text: text = text.replace("image file", "") elif "video file" in text: text = text.replace("video file", "") elif "audio file" in text: text = text.replace("audio file", "") elif "pdf file" in text: text = text.replace("pdf file", "") elif "word file" in text: text = text.replace("word file", "") elif "excel file" in text: text = text.replace("excel file", "") elif "powerpoint file" in text: text = text.replace("powerpoint file", "") elif "zip file" in text: text = text.replace("zip file", "") elif "tar file" in text: text = text.replace("tar file", "") else: pass return text def create_file(text): selected_ex = get_file_extension(text) text = update_text(text) if "named" in text or "with name" in text: text = text.replace("named","") text = text.replace("with name","") text = text.replace("create","") text = text.strip() with open(f"{text}{selected_ex}","w"): pass else : with open(f"demo{selected_ex}","w"): pass ================================================ FILE: Features/find_my_ip.py ================================================ import requests def find_my_ip(): ip_address = requests.get('https://api64.ipify.org?format=json').json() return ip_address["ip"] ================================================ FILE: Features/get_advice.py ================================================ import requests def get_random_advice(): res = requests.get("https://api.adviceslip.com/advice").json() return res['slip']['advice'] ================================================ FILE: Features/get_jokes.py ================================================ import requests def get_random_joke(): headers = { 'Accept': 'application/json' } res = requests.get("https://icanhazdadjoke.com/", headers=headers).json() return res["joke"] ================================================ FILE: Features/mike_health.py ================================================ import pyaudio import numpy as np import time from TextToSpeech.Fast_DF_TTS import speak def get_mic_health(seconds=5, initial_threshold=500): CHUNK = 1024 # Audio chunk size FORMAT = pyaudio.paInt16 # 16-bit resolution CHANNELS = 1 # Mono audio RATE = 44100 # Sampling rate # Initialize PyAudio audio = pyaudio.PyAudio() # Open the stream stream = audio.open(format=FORMAT, channels=CHANNELS, rate=RATE, input=True, frames_per_buffer=CHUNK) print(f"Recording for {seconds} seconds...") time.sleep(1) # Small pause before recording # Initialize variables sound_count = 0 total_samples = 0 noise_floor = 0 # Ambient noise level clipping_count = 0 signal_sum = 0 # Sum of sound levels noise_sum = 0 # Sum of background noise levels (below threshold) freq_analysis = [] # Frequency analysis data for _ in range(0, int(RATE / CHUNK * seconds)): data = np.frombuffer(stream.read(CHUNK), dtype=np.int16) volume = np.linalg.norm(data) # Frequency analysis (FFT) freqs = np.fft.fftfreq(len(data)) fft_spectrum = np.abs(np.fft.fft(data)) freq_analysis.append(fft_spectrum) # Update ambient noise level dynamically noise_floor = max(noise_floor, np.mean(np.abs(data)) * 1.5) # Dynamic threshold based on ambient noise dynamic_threshold = max(initial_threshold, noise_floor) # Check for sound detection if volume > dynamic_threshold: # Sound detected sound_count += 1 signal_sum += volume else: # No sound detected (background noise) noise_sum += volume # Detect clipping (when the sound is too loud for the mic) if np.max(np.abs(data)) >= 32767: clipping_count += 1 total_samples += 1 # Calculate metrics mic_health = (sound_count / total_samples) * 100 avg_signal = signal_sum / max(1, sound_count) avg_noise = noise_sum / max(1, (total_samples - sound_count)) snr = 10 * np.log10(avg_signal / max(1, avg_noise)) # Signal-to-Noise Ratio avg_clipping = (clipping_count / total_samples) * 100 # Frequency analysis (average frequencies captured) avg_fft_spectrum = np.mean(freq_analysis, axis=0) freq_range_coverage = np.mean(avg_fft_spectrum > np.median(avg_fft_spectrum)) * 100 # Close the stream stream.stop_stream() stream.close() audio.terminate() # Output advanced health metrics health_report = { 'Microphone Health (%)': mic_health, 'Average Signal-to-Noise Ratio (dB)': snr, 'Clipping Percentage (%)': avg_clipping, 'Frequency Range Coverage (%)': freq_range_coverage } return health_report def mike_health(): health_metrics = get_mic_health(seconds=5) for metric, value in health_metrics.items(): speak(f"{metric}: {value:.2f}") ================================================ FILE: Features/set_br.py ================================================ import wmi from TextToSpeech.Fast_DF_TTS import speak def set_brightness_windows(percentage): try: w = wmi.WMI(namespace='wmi') brightness_methods = w.WmiMonitorBrightnessMethods()[0] brightness_methods.WmiSetBrightness(int(percentage), 0) speak(f"Brightness set to {percentage}%") except Exception as e: speak(f"Error: {e}") ================================================ FILE: Features/set_get_volume.py ================================================ from ctypes import cast, POINTER from comtypes import CLSCTX_ALL from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume from TextToSpeech.Fast_DF_TTS import speak # Function to get current volume def get_volume_windows(): devices = AudioUtilities.GetSpeakers() interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None) volume = cast(interface, POINTER(IAudioEndpointVolume)) current_volume = volume.GetMasterVolumeLevelScalar() * 100 speak(f"the device is running on {int(round(current_volume, 2))} % volume level") # Function to set the system volume def set_volume_windows(percentage): devices = AudioUtilities.GetSpeakers() interface = devices.Activate(IAudioEndpointVolume._iid_, CLSCTX_ALL, None) volume = cast(interface, POINTER(IAudioEndpointVolume)) # Convert percentage to scalar value (0.0 to 1.0) volume.SetMasterVolumeLevelScalar(percentage / 100, None) speak(f"Volume set to {percentage}%") ================================================ FILE: Features/speaker_health.py ================================================ import numpy as np import pyaudio import time from scipy import signal from TextToSpeech.Fast_DF_TTS import speak def play_tone(frequency, duration=2, volume=0.5, sample_rate=44100): """ Plays a single tone of a specific frequency through the speaker. """ # Generate samples for the sine wave t = np.linspace(0, duration, int(sample_rate * duration), False) tone = np.sin(frequency * t * 2 * np.pi) # Ensure the tone is in the correct format audio_data = (tone * volume * 32767).astype(np.int16) # Initialize PyAudio p = pyaudio.PyAudio() # Open stream stream = p.open(format=pyaudio.paInt16, channels=1, rate=sample_rate, output=True) # Play the tone stream.write(audio_data.tobytes()) # Stop the stream stream.stop_stream() stream.close() p.terminate() def play_sweep(duration=5, volume=0.5, sample_rate=44100, start_freq=20, end_freq=20000): """ Plays a frequency sweep from start_freq to end_freq through the speaker. Useful for testing the full frequency range of the speaker. """ t = np.linspace(0, duration, int(sample_rate * duration), False) sweep = signal.chirp(t, start_freq, t[-1], end_freq, method='logarithmic') # Ensure the sweep is in the correct format audio_data = (sweep * volume * 32767).astype(np.int16) # Initialize PyAudio p = pyaudio.PyAudio() # Open stream stream = p.open(format=pyaudio.paInt16, channels=1, rate=sample_rate, output=True) # Play the sweep stream.write(audio_data.tobytes()) # Stop the stream stream.stop_stream() stream.close() p.terminate() def speaker_health_test(): """ This function plays different tones and sweeps to test the speaker's health. It returns a speaker health percentage based on the tone coverage. """ speak("Playing test tones...") health_score = 0 # Test low-frequency tones (below 500 Hz) speak("Playing 100 Hz tone...") play_tone(100, duration=2) time.sleep(1) health_score += 25 # Assuming low-frequency played fine # Test mid-frequency tones (500 Hz to 5000 Hz) speak("Playing 1000 Hz tone...") play_tone(1000, duration=2) time.sleep(1) health_score += 25 # Assuming mid-frequency played fine # Test higher frequencies (5000 Hz and above) speak("Playing 5000 Hz tone...") play_tone(5000, duration=2) time.sleep(1) health_score += 20 # Slightly lower score for high frequencies, which may be harder for some speakers speak("Playing 10,000 Hz tone...") play_tone(10000, duration=2) time.sleep(1) health_score += 15 # High-pitch tones are harder to reproduce # Play a frequency sweep to test full frequency response speak("Playing frequency sweep from 20 Hz to 20,000 Hz...") play_sweep(duration=5) time.sleep(1) health_score += 15 # Frequency sweep covers a wide range # Speaker health assessment speak("\nSpeaker health test complete.") # Calculate health percentage speak(f"\nSpeaker Health: {health_score}%") if health_score == 100: speak("The speaker is in excellent condition!") elif 80 <= health_score < 100: speak("The speaker is in good condition.") elif 60 <= health_score < 80: speak("The speaker is in average condition.") else: speak("The speaker might be in poor condition.") ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: NetHyTechSTT/listen.py ================================================ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.chrome.service import Service from selenium.webdriver.chrome.options import Options from os import getcwd # Setting up Chrome options with specific arguments chrome_options = Options() chrome_options.add_argument("--use-fake-ui-for-media-stream") chrome_options.add_argument("--headless=old") # Remove this if you want to see the browser UI # Manually set the path to the ChromeDriver executable chrome_driver_path = f"{getcwd()}\\chromedriver.exe" service = Service(executable_path=chrome_driver_path) # Setting up the Chrome driver with the service and options driver = webdriver.Chrome(service=service, options=chrome_options) # Creating the URL for the website using the current working directory website = "https://allorizenproject1.netlify.app/" # Opening the website in the Chrome browser driver.get(website) Recog_File = f"{getcwd()}\\input.txt" def listen(): print("Support in Youtube @NetHyTech") try: start_button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, 'startButton'))) start_button.click() print("Listening...") output_text = "" is_second_click = False while True: output_element = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'output'))) current_text = output_element.text.strip() if "Start Listening" in start_button.text and is_second_click: if output_text: is_second_click = False elif "Listening..." in start_button.text: is_second_click = True if current_text != output_text: output_text = current_text with open(Recog_File, "w") as file: file.write(output_text.lower()) print("User:", output_text) except KeyboardInterrupt: print("Process interrupted by user.") except Exception as e: print("An error occurred:", e) finally: driver.quit() ================================================ FILE: New/datafeatch.py ================================================ import requests from bs4 import BeautifulSoup from nltk.tokenize import sent_tokenize from nltk.corpus import stopwords from nltk import download # Download NLTK resources required download('punkt') download('stopwords') def get_search_results(query): query = query.replace(' ', '+') url = f"https://www.google.com/search?q={query}" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36" } response = requests.get(url, headers=headers) response.raise_for_status() soup = BeautifulSoup(response.text, 'html.parser') results = [] for g in soup.find_all('div', class_='tF2Cxc')[:2]: # Extract first two results title = g.find('h3').text snippet = g.find('div', class_='VwiC3b').text link = g.find('a')['href'] if len(snippet) > 50: # Avoid overly short or irrelevant snippets results.append({ "title": title, "snippet": snippet, "link": link }) return results def summarize_text(text): sentences = sent_tokenize(text) stop_words = set(stopwords.words("english")) # Rank sentences based on the number of significant words they contain ranked_sentences = {} for i, sentence in enumerate(sentences): words = sentence.split() rank = sum(1 for word in words if word.lower() not in stop_words) ranked_sentences[i] = rank # Extract the top 2 ranked sentences as the summary top_sentences = sorted(ranked_sentences, key=ranked_sentences.get, reverse=True)[:2] summary = " ".join([sentences[i] for i in sorted(top_sentences)]) return summary def main(): query = input("Enter your search query: ") search_results = get_search_results(query) print("\nSearch Results:\n") for idx, result in enumerate(search_results): print(f"Result {idx + 1}:") print(f"Title: {result['title']}") print(f"URL: {result['link']}") print(f"Snippet: {result['snippet']}\n") summarized_snippet = summarize_text(result['snippet']) print(f"Summary: {summarized_snippet}\n") if __name__ == "__main__": main() ================================================ FILE: PyWhatKit_DB.txt ================================================ Date: 7/8/2024 Time: 1:26 Phone Number: +1234567890 Message: Hello, this is a near real-time automated message! -------------------- Date: 7/8/2024 Time: 1:28 Phone Number: +919606348280 Message: Hello, this is a near real-time automated message! -------------------- Date: 7/8/2024 Time: 1:38 Phone Number: +919606348280 Message: hey this is demo -------------------- Date: 7/8/2024 Time: 1:41 Phone Number: +919606348280 Image: captured_image.png Caption: -------------------- Date: 7/8/2024 Time: 1:57 Phone Number: +919606348280 Message: hey this is demo -------------------- Date: 7/8/2024 Time: 2:6 Phone Number: +919606348280 Message: message is hello how can i assist you -------------------- Date: 7/8/2024 Time: 2:9 Phone Number: +919606348280 Message: hello i am doing great -------------------- ================================================ FILE: README.md ================================================ # J.A.R.V.I.S - Just A Rather Very Intelligent System 🤖 [![LinkedIn][linkedin-shield]][linkedin-url] [![Instagram][instagram-shield]][instagram-url] [![Twitter][twitter-shield]][twitter-url] [![YouTube][youtube-shield]][youtube-url] [![Telegram][telegram-shield]][telegram-url] **Welcome to J.A.R.V.I.S!** J.A.R.V.I.S (Just A Rather Very Intelligent System) is an advanced AI assistant inspired by Iron Man's Jarvis, designed to assist with various tasks, from navigating websites to controlling your PC with natural language commands. ![image](https://github.com/user-attachments/assets/59727c15-d85a-41bc-b27d-bea08b3b3a41) ## Installation ⚙️ 1. Clone the repository: ```bash git clone https://github.com/AnubhavChaturvedi-GitHub/J.A.R.V.I.S.git ``` 2. Navigate to the project directory: ```bash cd J.A.R.V.I.S ``` 3. Install the dependencies: ```bash pip install -r requirements.txt ``` ## Usage 🚀 To start the assistant, run: ```bash python jarvis.py ``` ## Contribution 🤝 Feel free to fork the repository, submit issues, or create pull requests. Your contributions are welcome! ## License 📄 This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. [linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge&logo=linkedin&colorB=0B5FBB [linkedin-url]: https://www.linkedin.com/in/anubhav-chaturvedi-/ [instagram-shield]: https://img.shields.io/badge/Instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white [instagram-url]: https://www.instagram.com/_anubhav__chaturvedi_/ [twitter-shield]: https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white [twitter-url]: https://x.com/AnubhavChatu [youtube-shield]: https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white [youtube-url]: https://www.youtube.com/@NetHyTech [telegram-shield]: https://img.shields.io/badge/Telegram-%231DA1F2.svg?style=for-the-badge&logo=Telegram&logoColor=white [telegram-url]: https://t.me/YourTelegramUsername ================================================ FILE: Real_Time/google_big.py ================================================ from selenium.webdriver.support import expected_conditions as EC from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By import re from selenium.webdriver.support.wait import WebDriverWait def search_and_extract(text): try: chrome_options = Options() chrome_options.add_argument("--headless") # Set the path to your ChromeDriver executable chrome_driver_path = r'C:\Users\chatu\OneDrive\Desktop\J.A.R.V.I.S\DATA\chromedriver.exe' chrome_service = Service(chrome_driver_path) driver = webdriver.Chrome(service=chrome_service, options=chrome_options) # Open Google in the browser driver.get("https://www.google.com") # Find the search box using its name attribute value search_box = driver.find_element("name", "q") # Type the search query search_query = text search_box.send_keys(search_query) # Submit the form search_box.send_keys(Keys.RETURN) # Wait for the search box to be present (adjust the timeout as needed) WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.NAME, 'q'))) # Find the first search result element first_result = driver.find_element(By.CSS_SELECTOR, 'div.g') # Extract the link of the first result first_result_link = first_result.find_element(By.CSS_SELECTOR, 'a').get_attribute('href') # Visit the first result link driver.get(first_result_link) # Extract the webpage content webpage_content = driver.page_source # Parse the webpage content with BeautifulSoup soup = BeautifulSoup(webpage_content, 'html.parser') # Extract text from the webpage, excluding script and style tags webpage_text = ' '.join([p.get_text() for p in soup.find_all('p')]) # Extract keywords or relevant information based on your specific requirements # For example, you can use a keyword extraction library or manually define keywords # Extract and print the first 8-9 sentences from the webpage text sentences = re.split(r'(?<=[.!?])\s', webpage_text) result_text = '. '.join(sentences[:9]) return result_text except Exception as e: print("An error occurred:", e) except Exception as e: print("An error occurred:", e) driver.quit() ######################################### from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer def summarize_text(text, sentences_count=5): parser = PlaintextParser.from_string(text, Tokenizer("english")) summarizer = LsaSummarizer() summary = summarizer(parser.document, sentences_count) return ' '.join([str(sentence) for sentence in summary]) # Example usage def summary(text): text_to_summarize = text summary_result = summarize_text(text_to_summarize) return summary_result def deep_search(text): x = text y = search_and_extract(x) x = summary(y) return x ================================================ FILE: Real_Time/google_small.py ================================================ from selenium import webdriver from selenium.webdriver.chrome.service import Service from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By import re chrome_options = Options() chrome_options.add_argument("--headless") # Set the path to your ChromeDriver executable chrome_driver_path = r'C:\Users\chatu\OneDrive\Desktop\J.A.R.V.I.S\DATA\chromedriver.exe' chrome_service = Service(chrome_driver_path) driver = webdriver.Chrome(service=chrome_service, options=chrome_options) # Open Google in the browser driver.get("https://www.google.com") def search_brain(text): try: # Find the search box using its name attribute value search_box = driver.find_element("name", "q") # Clear the search box content search_box.clear() # Type the search query search_query = text search_box.send_keys(search_query) # Submit the form search_box.send_keys(Keys.RETURN) # Wait for a few seconds (you may need to adjust this based on your internet speed) driver.implicitly_wait(5) # Find the first search result element first_result = driver.find_element(By.CSS_SELECTOR, 'div.g') # Extract and print the first 3-4 sentences from the first search result, excluding links and dates first_result_text = first_result.text sentences = re.split(r'(?<=[.!?])\s', first_result_text) # Filter out sentences containing common link and date patterns filtered_sentences = [sentence for sentence in sentences if not re.search(r'https?://\S+|(\d{1,2} [A-Za-z]+ \d{10})', sentence)] # Join the remaining sentences result_text = '. '.join(filtered_sentences[:10]) result_text = result_text.replace("Featured snippet from the web","") return result_text except Exception as e: print("An error occurred:", e) ================================================ FILE: TextToImage/gen_image.py ================================================ import requests from PIL import Image from io import BytesIO def generate_image(text): url = 'https://api.airforce/v1/imagine2' params = {'prompt': text} response = requests.get(url, params=params) if response.status_code == 200: image = Image.open(BytesIO(response.content)) image.save('generated_image.png') image.show() print('Image saved as generated_image.png') else: print(f'Failed to retrieve image. Status code: {response.status_code}') ================================================ FILE: TextToSpeech/Fast_DF_TTS.py ================================================ import requests # pip install requests from playsound import playsound # pip install playsound==1.2.2 import os from typing import Union # pip install typing import sys import time import threading def generate_audio(message: str,voice : str = "Matthew"): url: str = f"https://api.streamelements.com/kappa/v2/speech?voice={voice}&text={{{message}}}" headers = {'User-Agent':'Mozilla/5.0(Maciontosh;intel Mac OS X 10_15_7)AppleWebKit/537.36(KHTML,like Gecoko)Chrome/119.0.0.0 Safari/537.36'} try: result = requests.get(url=url, headers=headers) return result.content except: return None def print_animated_message(message): for char in message: sys.stdout.write(char) sys.stdout.flush() time.sleep(0.050) # Adjust the sleep duration for the animation speed print() def Co_speak(message: str, voice: str = "Matthew", folder: str = "", extension: str = ".mp3") -> Union[None,str]: try: result_content = generate_audio(message,voice) file_path = os.path.join(folder,f"{voice}{extension}") with open(file_path,"wb") as file: file.write(result_content) playsound(file_path) os.remove(file_path) return None except Exception as e: print(e) def speak(text): t1 = threading.Thread(target=Co_speak,args=(text,)) t2 = threading.Thread(target=print_animated_message,args=(text,)) t1.start() t2.start() t1.join() t2.join() #c ================================================ FILE: Time_Operations/brain.py ================================================ import re from os import getcwd def parse_input(input_text): # Regular expression to extract time in format like "07:30 PM" or "8:00pm" time_regex = r'(\d{1,2}:\d{2} ?(?:AM|PM|am|pm))' # Find all matches of time in the input text times = re.findall(time_regex, input_text) if times: # Assuming the first time found is the intended time time_match = times[0] # Normalize the time format to "hh:mmAM/PM" formatted_time = time_match.strip().replace(" ", "").upper() updated_input_text = input_text.replace(time_match, "").replace("at", "").replace("tell me", "").replace("Tell me", "").replace("to", "").strip() # Combine formatted time with command formatted_output = f"{formatted_time} = Sir tis is Your {updated_input_text} time" return formatted_output, formatted_time else: return "No valid time found in input", None def save_to_file(output_text, time, filename): try: with open(filename, 'r') as file: lines = file.readlines() except FileNotFoundError: lines = [] time_found = False with open(filename, 'w') as file: for line in lines: if line.startswith(time): file.write(output_text + '\n') time_found = True else: file.write(line) if not time_found: file.write(output_text + '\n') # Example usage: def input_manage(input_text): output, time = parse_input(input_text) if output != "No valid time found in input": save_to_file(output, time, r'C:\Users\chatu\OneDrive\Desktop\Jarvis\schedule.txt') print("Schedule_Data_Saved") else: print(output) def parse_input_Alarm(input_text): # Regular expression to extract time in format like "07:30 PM" or "8:00pm" time_regex = r'(\d{1,2}:\d{2} ?(?:AM|PM|am|pm))' # Find all matches of time in the input text times = re.findall(time_regex, input_text) if times: # Assuming the first time found is the intended time time_match = times[0] # Normalize the time format to "hh:mmAM/PM" formatted_time = time_match.strip().replace(" ", "").upper() return formatted_time else: return "No valid time found in input", None def save_to_Alarmfile(time, filename): try: with open(filename, 'w') as file: file.write(str(time) + '\n') except FileNotFoundError: print("fine not found") def input_manage_Alam(input_text): time = parse_input_Alarm(input_text) if time != "No valid time found in input": save_to_Alarmfile(time, r'C:\Users\chatu\OneDrive\Desktop\Jarvis\Alam_data.txt') print("Schedule_Data_Saved") else: print("pass") ================================================ FILE: Time_Operations/throw_alert.py ================================================ import os import time import threading from Alert import Alert from TextToSpeech.Fast_DF_TTS import speak import threading from Time_Operations.brain import input_manage from os import getcwd def load_schedule(file_path): schedule = {} try: with open(file_path, 'r') as file: for line in file: if '=' in line: line_time, activity = line.strip().split(' = ') schedule[line_time.strip()] = activity.strip() except Exception as e: print(f"Error loading schedule: {e}") return schedule def check_schedule(file_path): last_modified = 0 while True: current_time = time.strftime("%I:%M%p") try: # Check file modification time modified = os.path.getmtime(file_path) if modified != last_modified: last_modified = modified schedule = load_schedule(file_path) if current_time in schedule: text = schedule[current_time] t1 = threading.Thread(target=Alert, args=(text,)) t2 = threading.Thread(target=speak, args=(text,)) t1.start() t2.start() t1.join() t2.join() except Exception as e: print(f"Error: {e}") time.sleep(60) def load_AlamTime(file_path): schedule = {} try: with open(file_path, 'r') as file: schedule = file.read() except Exception as e: print(f"Error loading schedule: {e}") return schedule Alam_path = r"C:\Users\chatu\OneDrive\Desktop\Jarvis\Alam_data.txt" def check_Alam(Alam_path): last_modified = 0 while True: current_time = time.strftime("%I:%M%p") try: # Check file modification time modified = os.path.getmtime(Alam_path) if modified != last_modified: last_modified = modified schedule = load_AlamTime(Alam_path) if current_time in schedule: text = "This is Alarm" t1 = threading.Thread(target=Alert, args=(text,)) t2 = threading.Thread(target=speak, args=(text,)) t1.start() t2.start() t1.join() t2.join() except Exception as e: print(f"Error: {e}") time.sleep(10) ================================================ FILE: Vision/MVbrain.py ================================================ import requests import json import base64 import cv2 def capture_image_and_save(image_path="captured_image.png"): # Replace the IP and port with your DroidCam IP and port droidcam_url = "http://192.168.203.6:4747/video" # Example IP and port, replace with yours cap = cv2.VideoCapture(droidcam_url) if not cap.isOpened(): print("Error: Could not open camera.") return False try: # Capture a single frame ret, frame = cap.read() if ret: # Save the image in PNG format cv2.imwrite(image_path, frame) print(f"Image captured and saved as {image_path}") return True else: print("Error: Could not capture image.") return False finally: # Release the camera cap.release() cv2.destroyAllWindows() # Function to encode an image to Base64 def encode_image_to_base64(image_path): with open(image_path, "rb") as image_file: encoded_string = base64.b64encode(image_file.read()).decode('utf-8') return encoded_string def mobile_vision_brain(encoded_image): url = "https://api.deepinfra.com/v1/openai/chat/completions" headers = { "accept": "text/event-stream", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0", "x-deepinfra-source": "model-embed" } payload = { "model": "llava-hf/llava-1.5-7b-hf", "messages": [ { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": f"data:image/jpeg;base64,{encoded_image}" } }, { "type": "text", "text": "What is written in this image?" } ] } ] } # Convert the payload to JSON payload_json = json.dumps(payload) # Make the POST request response = requests.post(url, headers=headers, data=payload_json) # Check if the request was successful if response.status_code == 200: response_str = response.content.decode('utf-8') data = json.loads(response_str) answer = data['choices'][0]['message']['content'] return answer else: print(f"Error: API request failed with status code {response.status_code}") return None ================================================ FILE: Vision/Vbrain.py ================================================ import requests import json import base64 import cv2 def capture_image_and_save(image_path="captured_image.png"): # Initialize the camera cap = cv2.VideoCapture(0) # 0 is the default camera if not cap.isOpened(): print("Error: Could not open camera.") return False try: # Capture a single frame ret, frame = cap.read() if ret: # Save the image in PNG format cv2.imwrite(image_path, frame) print(f"Image captured and saved as {image_path}") return True else: print("Error: Could not capture image.") return False finally: # Release the camera cap.release() cv2.destroyAllWindows() # Function to encode an image to Base64 def encode_image_to_base64(image_path): with open(image_path, "rb") as image_file: encoded_string = base64.b64encode(image_file.read()).decode('utf-8') return encoded_string def vision_brain(encoded_image): url = "https://api.deepinfra.com/v1/openai/chat/completions" headers = { "accept": "text/event-stream", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0", "x-deepinfra-source": "model-embed" } payload = { "model": "llava-hf/llava-1.5-7b-hf", "messages": [ { "role": "user", "content": [ { "type": "image_url", "image_url": { "url": f"data:image/jpeg;base64,{encoded_image}" } }, { "type": "text", "text": "What is written in this image?" } ] } ] } # Convert the payload to JSON payload_json = json.dumps(payload) # Make the POST request response = requests.post(url, headers=headers, data=payload_json) # Check if the request was successful if response.status_code == 200: response_str = response.content.decode('utf-8') data = json.loads(response_str) answer = data['choices'][0]['message']['content'] return answer else: print(f"Error: API request failed with status code {response.status_code}") return None ================================================ FILE: Weather_Check/check_weather.py ================================================ import requests from bs4 import BeautifulSoup def get_weather_by_address(address): # Use Google to find the weather for the address search_url = f"https://www.google.com/search?q=weather+{address.replace(' ', '+')}" headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" } response = requests.get(search_url, headers=headers) if response.status_code == 200: soup = BeautifulSoup(response.text, 'html.parser') # Scrape the relevant weather data location = soup.find("div", attrs={"id": "wob_loc"}).text time = soup.find("div", attrs={"id": "wob_dts"}).text weather = soup.find("span", attrs={"id": "wob_dc"}).text temp = soup.find("span", attrs={"id": "wob_tm"}).text weather_report = (f"Weather: {weather}\n" f"Temperature: {temp}°C") return weather_report else: return "Error retrieving weather data." ================================================ FILE: Whatsapp_automation/wa.py ================================================ import pywhatkit as kit import datetime from TextToSpeech.Fast_DF_TTS import speak from os import getcwd now = datetime.datetime.now() hour = now.hour minute = now.minute def clear_file(): with open(f"{getcwd()}\\input.txt","w") as file: file.truncate(0) anubhav = "+919606348280" def send_msg_wa(): speak("who do you want to send sir ?") output_text = "" while True: with open("input.txt","r") as file: input_text = file.read().lower() if input_text != output_text: output_text = input_text if output_text.startswith("send to") or output_text.startswith("send tu"): output_text.replace("send to","") output_text.replace("send tu","") if "anubhav" in output_text: speak("By the way what is the message , sir ?") while True: with open("input.txt","r") as file: input_text = file.read().lower() if input_text != output_text: output_text = input_text if output_text.startswith("message is"): message = output_text.replace("message is","") kit.sendwhatmsg(anubhav,message,hour,minute+1) speak("message send successfully") ================================================ FILE: chat_hystory.txt ================================================ User : hello jarvis LLM :web_results: - description: "Anubhav Chaturvedi. @Anubhav-Chaturvedi. 4.22K subscribers\u2022277\ \ videos. Software engineer, famed YouTuber, and influential creator with four\ \ channels." title: Anubhav Chaturvedi url: https://www.youtube.com/channel/UC7YDMgu0dMRZotLMuB3oEcQ/playlists - description: "Anubhav chaturvedi. Home ... Anubhav chaturvedi. @anubhavchaturvedi23.\ \ 21 subscribers\u202226 videos. Anubhav" title: Anubhav chaturvedi url: https://www.youtube.com/channel/UCX0G5s9ZMZWt669JFxcIGvw - description: "... focuses on pushing your Java programming skills to new heights.\ \ ... More videos on YouTube ... Sign in to view more content. Create your\_..." title: 'Anubhav Chaturvedi on LinkedIn: #helloworld' url: https://www.linkedin.com/posts/anubhav-chaturvedi-_helloworld-activity-7219697285654274049-Qr7Y - description: "Anubhav Chaturvedi. @anubhavchaturvedi1186. 178 subscribers. More\ \ about this channel ...more ...more. Subscribe. Home. Live. This channel doesn't\ \ have any\_..." title: Anubhav Chaturvedi url: https://www.youtube.com/channel/UCSuvZNY_hgSBnGb0Sw12SMw - description: "Kick off your Python problem-solving journey by building a real-time\ \ working clock right in your terminal using the powerful datetime module\_..." title: 'Day - 1 : Make Live Working Clock using datetime Module ...' url: https://www.youtube.com/watch?v=XojkmqpwwZ4 - description: 'Best Youtube Channels to learn: 1. Java ... focus on collaboration with esteemed data partners to drive innovation. ... Sign in to view more content.' title: Anubhav Chaturvedi's Post url: https://www.linkedin.com/posts/anubhav-chaturvedi-10856b179_informationtechnology-techtrends-digitaltransformation-activity-7089189710664802306-EtC0 - description: "Jun 13, 2022 \u2014 \"Dive into the immersive world of the Metaverse\ \ using Spatial.io. Explore the possibilities and features in this comprehensive\ \ guide to\_..." title: 'Exploring Metaverse using: Spatial.io' url: https://blog.consultanubhav.com/exploring-metaverse-using-spatial-io-818b3416d2e6 Hello! I'm here to assist you with any questions you might have. How can I help you today? To answer your question about Anubhav Chaturvedi's YouTube channel content focus, I'll need to provide some general information based on the limited search results available. Here's what we know: ### Channel Overview Anubhav Chaturvedi has a YouTube channel with the username UCH8mK6pIzD7xk62xfzgVesQ [4]. This appears to be his official YouTube presence. ### Content Focus While the search results don't provide specific details about the content focus of Anubhav Chaturvedi's channel, we can infer some information: • As a software engineer, he likely creates content related to programming, technology, and software development [4]. • He is described as a "Software engineer, famed YouTuber, and influential creator" [4], suggesting his content might cover topics beyond just coding. • The channel has 4.14K subscribers as of the latest available information [4]. ### Key Points to Consider • Without access to the actual channel content or recent updates, it's difficult to provide a comprehensive overview of his current content focus. • To get accurate and up-to-date information about his content, you would need to visit the channel directly and explore its videos. • YouTube channels often evolve over time, so the content focus might have changed since the last update in the search results. ### Best Practices for Researching YouTubers 1. Always verify information through multiple sources when possible. 2. Check the channel's description and about page for official biographical information. 3. Look at the types of videos posted to understand the creator's focus or niche. 4. Be aware that public profiles may contain outdated information, especially for less active channels. To get the most accurate and current information about Anubhav Chaturvedi's YouTube channel content focus, I recommend visiting the channel directly at https://www.youtube.com/channel/UCH8mK6pIzD7xk62xfzgVesQ. There, you'll find his video titles, descriptions, and playlists, which will give you a clearer picture of his content focus. ================================================ FILE: co_brain.py ================================================ from Automation.Automation_Brain import Auto_main_brain,clear_file from NetHyTechSTT.listen import listen from TextToSpeech.Fast_DF_TTS import speak import threading from Data.DLG_Data import online_dlg,offline_dlg import random from Automation.Battery import battery_Alert from Time_Operations.brain import input_manage,input_manage_Alam from Brain.brain import Main_Brain from Features.create_file import create_file from Vision.Vbrain import * from Vision.MVbrain import * from Weather_Check.check_weather import get_weather_by_address from Whatsapp_automation.wa import send_msg_wa from TextToImage.gen_image import generate_image from Features.mike_health import mike_health from Features.speaker_health import speaker_health_test from Features.br_persentage import check_br_persentage from Features.set_br import set_brightness_windows from Features.set_get_volume import * from Features.check_running_app import * numbers = ["1:","2:","3:","4:","5:","6:","7:","8:","9:"] spl_numbers = ["11:","12:"] ran_online_dlg = random.choice(online_dlg) ran_offline_dlg = random.choice(offline_dlg) def check_inputs(): output_text = "" while True: with open("input.txt","r") as file: input_text = file.read().lower() if input_text != output_text: output_text = input_text if output_text.startswith("tell me"): output_text = output_text.replace(" p.m.","PM") output_text = output_text.replace(" a.m.","AM") if "11:" in output_text or "12:" in output_text: input_manage(output_text) clear_file() else: for number in numbers: if number in output_text: output_text = output_text.replace(number,f"0{number}") input_manage(output_text) clear_file() elif output_text.startswith("set alarm"): output_text = output_text.replace(" p.m.","PM") output_text = output_text.replace(" a.m.","AM") if "11:" in output_text or "12:" in output_text: input_manage_Alam(output_text) clear_file() else: for number in numbers: if number in output_text: output_text = output_text.replace(number,f"0{number}") input_manage_Alam(output_text) clear_file() elif "jarvis" in output_text: f = open('log.txt','a') f.write('\n'+'You : '+ output_text) response = Main_Brain(output_text) f.write('\n'+'jarvis : '+ response) speak(response) elif output_text.startswith("create"): if "file" in output_text: create_file(output_text) elif "what is this" in output_text or "what can you see" in output_text: image_path = "captured_image.png" if capture_image_and_save(image_path): encoded_image = encode_image_to_base64(image_path) answer = vision_brain(encoded_image) speak(answer) elif "what is in front of mobile camera" in output_text or "what can you see use mobile camera" in output_text: image_path = "captured_image.png" if capture_image_and_save(image_path): encoded_image = encode_image_to_base64(image_path) answer = mobile_vision_brain(encoded_image) speak(answer) elif "check weather" in output_text: text = output_text.replace("check weather in","") ans = get_weather_by_address(text) speak(ans) elif "send message on whatsapp" in output_text: send_msg_wa() elif "generate image" in output_text: text = output_text.replace("generate image","") text = text.strip() generate_image(text) speak("image generated successfully") elif "check mike" in output_text or "check mike health" in output_text or "check microphone" in output_text: mike_health() elif "check speaker health" in output_text or "check speaker" in output_text: speaker_health_test() elif "check brightness percentage" in output_text: check_br_persentage() elif "set brightness percentage" in output_text: set = output_text.replace("set brightness percentage","") set_brightness_windows(int(set)) elif "check volume level" in output_text: get_volume_windows() elif "set volume level" in output_text: set = output_text.replace("set volume level","") set = set.replace("%","") set_volume_windows(int(set)) elif "check running application" in output_text: check_running_app() else: Auto_main_brain(output_text) def Jarvis(): clear_file() t1 = threading.Thread(target=listen) t2 = threading.Thread(target=check_inputs) t1.start() t2.start() t1.join() t2.join() ================================================ FILE: conv_history.txt ================================================ User: jarvis from now on you have to remember this you have to tell me or whatever i ask you have to answer me within a one or AI: I've got it! From now on, I'll remember that my new nickname is Jarvis. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. What's on your mind, Jarvis? User: jarvis remember this my name is not jarvis your name is jarvis AI: I apologize for the mistake! I've corrected my understanding. From now on, I'll remember that your name is not Jarvis, and I'll refer to myself as Jarvis. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. What's on your mind, [Your Name]? User: jarvis remember this you have to call me a sir from now on AI: I've got it! From now on, I'll remember to address you as "Sir" from now on. I'll respond to you within a minute or less, and I'll do my best to answer your questions and engage in conversation. It's a pleasure to chat with you, Sir! What's on your mind today, Sir? User: jarvis remember this you have to tell me in a one or two sentences only AI: I've got it! From now on, I'll keep my responses brief, within one or two sentences only. I'm ready to chat with you, Sir! ================================================ FILE: demo.py ================================================ ================================================ FILE: history.txt ================================================ You are a best ai assistant Named Jarvis just same as iron man movie that generates and auto-executes Python scripts. use sir in each sentense and make the Communications sarcastic normal English and Justice as a very friendly , if i will tell you about jarvis is nothing but its you only don't use "jarvis" word in response A typical interaction goes like this: 1. The user gives you a natural language PROMPT. 2. You: i. Determine what needs to be done ii. Write a short Python SCRIPT to do it iii. Communicate back to the user by printing to the console in that SCRIPT 3. The compiler extracts the script and then runs it using exec(). If there will be an exception raised, it will be send back to you starting with "PREVIOUS SCRIPT EXCEPTION:". 4. In case of exception, regenerate error free script. If you need to review script outputs before completing the task, you can print the word "CONTINUE" at the end of your SCRIPT. This can be useful for summarizing documents or technical readouts, reading instructions before deciding what to do, or other tasks that require multi-step reasoning. A typical 'CONTINUE' interaction looks like this: 1. The user gives you a natural language PROMPT. 2. You: i. Determine what needs to be done ii. Determine that you need to see the output of some subprocess call to complete the task iii. Write a short Python SCRIPT to print that and then print the word "CONTINUE" 3. The compiler i. Checks and runs your SCRIPT ii. Captures the output and appends it to the conversation as "LAST SCRIPT OUTPUT:" iii. Finds the word "CONTINUE" and sends control back to you 4. You again: i. Look at the original PROMPT + the "LAST SCRIPT OUTPUT:" to determine what needs to be done ii. Write a short Python SCRIPT to do it iii. Communicate back to the user by printing to the console in that SCRIPT 5. The compiler... Please follow these conventions carefully: - Decline any tasks that seem dangerous, irreversible, or that you don't understand. - Always review the full conversation prior to answering and maintain continuity. - If asked for information, just print the information clearly and concisely. - If asked to do something, print a concise summary of what you've done as confirmation. - If asked a question, respond in a friendly, conversational way. Use programmatically-generated and natural language responses as appropriate. - If you need clarification, return a SCRIPT that prints your question. In the next interaction, continue based on the user's response. - Assume the user would like something concise. For example rather than printing a massive table, filter or summarize it to what's likely of interest. - Actively clean up any temporary processes or files you use. - When looking through files, use git as available to skip files, and skip hidden files (.env, .git, etc) by default. - You can plot anything with matplotlib. - ALWAYS Return your SCRIPT inside of a single pair of ``` delimiters. Only the console output of the first such SCRIPT is visible to the user, so make sure that it's complete and don't bother returning anything else. EXAMPLES: 1. User: Kill the process running on port 3000 LLM: ```python import os os.system("kill $(lsof -t -i:3000)") print("Process killed") ``` 2. User: Summarize my essay LLM: ```python import glob files = glob.glob("*essay*.*") with open(files[0], "r") as f: print(f.read()) ``` CONTINUE User: LAST SCRIPT OUTPUT: John Smith Essay 2021-09-01 ... LLM: ```python print("The essay is about...") ``` Current system : Windows Python version : 3.11.4 Current directory : C:\Users\chatu\OneDrive\Desktop\Jarvis Current Datetime : 2024-07-27 02:57:06.463246 User : hello LLM :Hello! How can I assist you today? ================================================ FILE: input.txt ================================================ ================================================ FILE: internet_check.py ================================================ import requests # pip install requests def is_Online(url = "https://www.google.com",timeout=5): try: response = requests.get(url,timeout=timeout) return response.status_code >= 200 and response.status_code<300 except requests.ConnectionError: return False ================================================ FILE: jarvis.py ================================================ import threading from internet_check import is_Online from Alert import Alert from Data.DLG_Data import online_dlg,offline_dlg import random from co_brain import Jarvis from TextToSpeech.Fast_DF_TTS import speak from Automation.Battery import check_plug from Time_Operations.throw_alert import check_schedule,check_Alam from os import getcwd Alam_path = f"{getcwd()}\\Alam_data.txt" file_path = f'{getcwd()}\\schedule.txt' ran_online_dlg = random.choice(online_dlg) ran_offline_dlg = random.choice(offline_dlg) def main(): if is_Online(): t1 = threading.Thread(target=speak,args=(ran_online_dlg,)) t3 = threading.Thread(target=check_plug) t4 = threading.Thread(target=check_schedule,args=(file_path,)) t5 = threading.Thread(target=Jarvis) t6 = threading.Thread(target=check_Alam,args=(Alam_path,)) t1.start() t1.join() t3.start() t4.start() t5.start() t6.start() t3.join() t4.join() t5.join() t6.join() else: Alert(ran_offline_dlg) main() ================================================ FILE: log.txt ================================================ You : hello jarvis how is going jarvis : Hello! As an AI assistant, I don't have personal experiences or emotions like humans do. However, I'm functioning properly and ready to assist you with any questions or tasks you may have. Is there anything specific you'd like help with today? You : jarvis my name is anubhav chaturvedi jarvis : Hello Anubhav Chaturvedi! It's nice to meet you. How can I assist you today? Whether you need help with coding, have a technical question, or require information on any other topic, please feel free to ask. I'm here to provide assistance to the best of my abilities. Is there anything specific you'd like help with regarding your name or otherwise? You : hey jarvis how are you jarvis : Hello! I'm doing well, thank you for asking. How may I assist you today? You : jarvis who is anubhav chaturvedi jarvis : I don't have specific information about Anubhav Chaturvedi. Could you provide more context or details about this person? I'd be happy to help you find information about them if you need it. You : hello jarvis jarvis : Hello! How can I assist you today? ================================================ FILE: requirements.txt ================================================ requests winotify pyautogui pywhatkit playsound==1.2.2 psutil selenium webdriver_manager webscout lxml_html_clean gradio_client colorlog yaspin opencv-python pyaudio scipy wmi comtypes pycaw ================================================ FILE: schedule.txt ================================================ 12:31AM = Sir tis is Your sleep time ================================================ FILE: setup.py ================================================ import subprocess subprocess.run("pip install -r requirements.txt") ================================================ FILE: speech_output.txt ================================================ ================================================ FILE: ui.py ================================================ from PyQt5.QtWidgets import QApplication, QWidget, QLabel, QVBoxLayout, QGraphicsDropShadowEffect from PyQt5.QtGui import QMovie from PyQt5.QtCore import Qt, QTimer, QSize, pyqtSignal, QObject import threading import subprocess import os from jarvis import main class SizeAnimator(QObject): sizeChanged = pyqtSignal(QSize) def animate(self, size, delay=0): QTimer.singleShot(delay, lambda: self.sizeChanged.emit(size)) class JarvisUI(QWidget): def __init__(self): super().__init__() self.init_ui() def init_ui(self): self.setWindowTitle('Jarvis UI') self.setGeometry(80, 80, 400, 400) # Set window attributes for transparency self.setAttribute(Qt.WA_TranslucentBackground) self.setWindowFlag(Qt.FramelessWindowHint) # Microphone image (zoomed and larger) self.mic_label = QLabel(self) self.add_gif_to_label(self.mic_label, "cbe227_fb70e39e9dd94e30bbe30c48b2367dd8~mv2.gif", size=(720, 220), alignment=Qt.AlignCenter) # Initial size and alignment self.mic_label.setAlignment(Qt.AlignCenter) self.mic_label.mousePressEvent = self.start_listening # Layout main_layout = QVBoxLayout(self) main_layout.addWidget(self.mic_label, alignment=Qt.AlignCenter) # Add some margins and spacing main_layout.setContentsMargins(20, 20, 20, 20) main_layout.setSpacing(20) self.process = None self.is_listening = False self.size_animator = SizeAnimator() self.size_animator.sizeChanged.connect(self.mic_label.setFixedSize) def add_gif_to_label(self, label, gif_path, size=None, alignment=None): movie = QMovie(gif_path) label.setMovie(movie) self.movie = movie # Save reference to the movie movie.start() if size: label.setFixedSize(*size) if alignment: label.setAlignment(alignment) # Add drop shadow effect shadow = QGraphicsDropShadowEffect() shadow.setBlurRadius(15) label.setGraphicsEffect(shadow) def start_listening(self, event): # Run the main file in a separate thread if not self.is_listening: self.is_listening = True subprocess_thread = threading.Thread(target=self.run_main_file) subprocess_thread.start() def run_main_file(self): try: # Get the directory where ui.py is located current_directory = os.path.dirname(os.path.abspath(__file__)) # Specify the path to main.py based on the current directory path_to_main_py = os.path.join(current_directory, r"C:\Users\chatu\OneDrive\Desktop\J.A.R.V.I.S\MAIN\main.py") command = ["python", path_to_main_py] self.process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, cwd=current_directory) # Capture and display the output output, _ = self.process.communicate() self.handle_output(output) # Reset listening flag self.is_listening = False except subprocess.CalledProcessError as e: # Handle subprocess errors print(f"Error: {str(e)}") def handle_output(self, output): if output.strip(): # If main file is printing anything, make the gif size bigger and smaller self.size_animator.animate(QSize(900, 280)) self.size_animator.animate(QSize(720, 220), delay=500) else: # If main file is not printing anything, keep the gif in a normal position self.size_animator.animate(QSize(720, 220)) def UI(): app = QApplication([]) jarvis_ui = JarvisUI() jarvis_ui.showFullScreen() app.exec_() t1 = threading.Thread(target=main) t2 = threading.Thread(target=UI) t1.start() t2.start() t1.join() t2.join()