diff --git a/README.md b/README.md index bc5d79a..a3de7ab 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,15 @@ Say "Help" or "Tell me your features" and Jarvis will say all of its capabilitie jarvis.py +# Configuration + +1. Open the Project Directory + + cd Jarvis-AI-using-python3- + +2. Open jarvis.py + +3. Change The Required Values. # How To Use diff --git a/jarvis.py b/jarvis.py index 9651758..d42cfd4 100644 --- a/jarvis.py +++ b/jarvis.py @@ -73,6 +73,24 @@ def checktime(tt): else: speak("it's night sir!") +#brain +def chat_with_brainshop(api_key, bot_id, message): + base_url = "http://api.brainshop.ai" + endpoint = "/get" + + url = f"{base_url}{endpoint}?bid={bot_id}&key={api_key}&uid=1&msg={message}" + + response = requests.get(url) + + if response.status_code == 200: + return response.json().get('cnt') + else: + return "Error communicating with BrainShop API" + +# Replace 'YOUR_API_KEY' and 'YOUR_BOT_ID' with your actual API key and bot ID +api_key = 'YOUR_API_KEY' +bot_id = 'YOUR_BOT_ID' + #welcome function def wishme(): @@ -369,3 +387,7 @@ def personal(): or 'go offline jarvis' in query or 'bye' in query or 'nothing' in query): wishme_end() + + else: + response = chat_with_brainshop(api_key, bot_id, query) + speak(response)