Skip to content

Commit f8906c4

Browse files
committed
Re-added API calls to Bedrock agent
Adjusted chat interface to call Bedrock agent instead of test function calls
1 parent 37c811c commit f8906c4

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

chatbot_app/app.py

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
#from agent import createSessionToken, sendMessage
1+
from agent import createSessionToken, sendMessage
22

33
import streamlit as st
44
import base64
55

66
# Test
7-
7+
testToggle = False
88
#session = createSessionToken()
99
#print(session)
1010
#input = "Bye"
1111
#print(sendMessage("9a130562", input, True))
1212

1313
# Mock the backend interaction
14-
def createSessionToken():
15-
return "mock_session_id"
16-
17-
def sendMessage(session_id, input, is_initial=False):
18-
# Mock response from the bot
19-
if "bye" in input.lower():
20-
return {'text': "Goodbye! Have a great day!", 'files': []}
21-
elif "team" in input.lower():
22-
return {'text': "Sure! Let's build your Valorant team. Who would you like to start with?", 'files': []}
23-
else:
24-
return {'text': f"You said: {input}", 'files': []}
25-
14+
if testToggle == True:
15+
16+
def createSessionToken():
17+
return "mock_session_id"
18+
19+
def sendMessage(session_id, input, is_initial=False):
20+
# Mock response from the bot
21+
if "bye" in input.lower():
22+
return {'text': "Goodbye! Have a great day!", 'files': []}
23+
elif "team" in input.lower():
24+
return {'text': "Sure! Let's build your Valorant team. Who would you like to start with?", 'files': []}
25+
else:
26+
return {'text': f"You said: {input}", 'files': []}
2627

2728
bot_name = "VCT Bot" # Set a custom name for the bot
2829
st.markdown(

0 commit comments

Comments
 (0)