wop commited on
Commit
ac020de
·
verified ·
1 Parent(s): 223f50e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -105,7 +105,9 @@ if prompt := st.chat_input("Enter your prompt here..."):
105
  query = prompt.lower().replace("search for", "").strip()
106
  search_results = search_web(query)
107
  formatted_results = "\n\n".join([f"Title: {result['title']}\nURL: {result['url']}\nSnippet: {result['snippet']}" for result in search_results])
108
- st.session_state.messages.append({"role": "assistant", "content": formatted_results})
 
 
109
  else:
110
  chat_completion = client.chat.completions.create(
111
  model=model_option,
 
105
  query = prompt.lower().replace("search for", "").strip()
106
  search_results = search_web(query)
107
  formatted_results = "\n\n".join([f"Title: {result['title']}\nURL: {result['url']}\nSnippet: {result['snippet']}" for result in search_results])
108
+ #st.session_state.messages.append({"role": "assistant", "content": formatted_results})
109
+ with st.chat_message("assistant", avatar="🤖"):
110
+ full_response = formatted_results
111
  else:
112
  chat_completion = client.chat.completions.create(
113
  model=model_option,