JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Traceback:
File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 556, in _run_script
exec(code, module.__dict__)File "C:\Users\Owner\Downloads\MedIQ-ChatBot-main\MedIQ-ChatBot-main\streamlit\pages\app.py", line 109, in <module>
chat_interface(st.session_state["chat_messages"])File "C:\Users\Owner\Downloads\MedIQ-ChatBot-main\MedIQ-ChatBot-main\streamlit\pages\app.py", line 66, in chat_interface
bot_response = response.json()['response']File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
ERROR in app: Exception on /chat [POST]
Traceback (most recent call last):
File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 2190, in wsgi_app
response = self.full_dispatch_request()
File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1486, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1484, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Users\Owner\AppData\Local\Programs\Python\Python39\lib\site-packages\flask\app.py", line 1469, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "c:\Users\Owner\Downloads\MedIQ-ChatBot-main\MedIQ-ChatBot-main\flask\main.py", line 36, in chat
inp = request.json['input']
KeyError: 'input'
The latest error is suggesting that there’s no key named “input” in your json file. You do a print statement to inspect the entire json so you can see which key to use.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.