binqiangliu commited on
Commit
99f959b
·
1 Parent(s): 2a93774

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -14,6 +14,7 @@ def call_chatbot_api(query):
14
  #上面这行代码的意思就是,使用post方式调用API,API的路径是url,输入给API的json数据由json_data_for_api赋值(然后在API端,json中的键值会被user_query = data['user_question']提取出来)
15
  result = response.json()
16
  return result['response']
 
17
 
18
  user_query = st.text_input("Enter your query here:")
19
  with st.spinner("AI Thinking...Please wait a while to Cheers!"):
 
14
  #上面这行代码的意思就是,使用post方式调用API,API的路径是url,输入给API的json数据由json_data_for_api赋值(然后在API端,json中的键值会被user_query = data['user_question']提取出来)
15
  result = response.json()
16
  return result['response']
17
+ #提取json数据中某个键的键值,就是使用json['key_name']的方式,这样获得的,就是key_name对应的键值(字符串?)
18
 
19
  user_query = st.text_input("Enter your query here:")
20
  with st.spinner("AI Thinking...Please wait a while to Cheers!"):