Skip to content
Open
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
19 changes: 19 additions & 0 deletions API_Call.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import requests





def get_branches():

base_url = "http://api.leapos.ca/obp/v4.0.0/banks/15fa44fc932d4b4cae9d2f28ec7b5cf/branches"
API_KEY = "eyJhbGciOiJIUzI1NiJ9.eyIiOiIifQ.De81eP_3gmHmmxJmRA92knXWiVqTGls2RLHc6Swh4Ic"
headers = {
'Authorization': 'DirectLogin token=%s' % (API_KEY)
}
r = requests.get(base_url, headers=headers)
print("CONTENT \n", type(r.json()))
print("HEADER \n", r.headers)
print("STATUS \n", r.status_code)

return "'One is at 801 Stewart Green SW Calgary'"
12 changes: 10 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer

from API_CALL import *
import requests
app = Flask(__name__)

bot = ChatBot("Candice")
Expand All @@ -17,16 +18,23 @@
"Thank you",
"You are welcome.",
])




trainer2.train("chatterbot.corpus.english.greetings")
trainer2.train("chatterbot.corpus.english.conversations")
trainer.train(['What is the closest branch near me?','One is at 601 Stewart Green SW Calgary'])
trainer.train(['What is the closest branch near me?', returnstr()])
trainer.train(['What is the closest branch near me?','One is at 2140 34 Ave SW, Calgary, AB T2T 5P6'])
trainer.train(['Who are all of my counterparties?', 'Right now your counter parties; Telus, University of Calgary,'])
trainer.train(['What types of preferred credit cards do you offer?', 'We offer Fixed-rate master card and Variable-rate master card'])







@app.route("/")
def home():
return render_template("home.html")
Expand Down
Binary file modified db.sqlite3
Binary file not shown.
15 changes: 13 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from flask_socketio import SocketIO, send, emit
from form import Userinput
import json
import requests

app = Flask(__name__)
app.config['SECRET_KEY']= "NFJDKSBFJKSAD"
Expand All @@ -13,12 +14,22 @@ class config(object):




@app.route("/")
@app.route("/home")
def home():
form = Userinput()
return render_template('home.html', form=form)


return render_template('home.html', form=form)base_url = "http://api.leapos.ca/obp/v4.0.0/banks/15fa44fc932d4b4cae9d2f28ec7b5cf/balances"
API_KEY = "eyJhbGciOiJIUzI1NiJ9.eyIiOiIifQ.De81eP_3gmHmmxJmRA92knXWiVqTGls2RLHc6Swh4Ic"
headers = {
'Authorization': 'DirectLogin token=%s' %(API_KEY)
}

r = requests.get(base_url, headers=headers)
print("CONTENT \n", r.content)
print("HEADER \n", r.headers)
print("STATUS \n", r.status_code)

def messageReceived(methods=['GET', 'POST']):
print('message was received!!!')
Expand Down
Loading