Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c1 #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

c1 #6

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 22 additions & 0 deletions jarvis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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)