Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,7 @@ You provide accurate, concise, and actionable advice based on real-time data, hi
|
|
22 |
|
23 |
# Fixed settings for LLM
|
24 |
MAX_TOKENS = 512
|
25 |
-
TEMPERATURE = 0.
|
26 |
TOP_P = 0.95
|
27 |
FREQUENCY_PENALTY = 0.0
|
28 |
SEED = -1 # Use None if random seed is preferred
|
@@ -53,8 +53,12 @@ def respond(message, history: list[tuple[str, str]]):
|
|
53 |
# Append the latest user message
|
54 |
messages.append({"role": "user", "content": message})
|
55 |
|
56 |
-
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
if search_results:
|
59 |
# Combine search results into a string to send to the model
|
60 |
search_results_text = "Here are the search results:\n"
|
|
|
22 |
|
23 |
# Fixed settings for LLM
|
24 |
MAX_TOKENS = 512
|
25 |
+
TEMPERATURE = 0.7
|
26 |
TOP_P = 0.95
|
27 |
FREQUENCY_PENALTY = 0.0
|
28 |
SEED = -1 # Use None if random seed is preferred
|
|
|
53 |
# Append the latest user message
|
54 |
messages.append({"role": "user", "content": message})
|
55 |
|
56 |
+
try:
|
57 |
+
# Correct method to get relevant results based on the message
|
58 |
+
search_results = search_tool.query(message) # Corrected method call
|
59 |
+
except AttributeError:
|
60 |
+
search_results = []
|
61 |
+
|
62 |
if search_results:
|
63 |
# Combine search results into a string to send to the model
|
64 |
search_results_text = "Here are the search results:\n"
|