Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -106,13 +106,14 @@ def format_response(data):
|
|
| 106 |
|
| 107 |
return formatted_response.strip()
|
| 108 |
|
| 109 |
-
def market_analysis_agent(user_input, history=
|
|
|
|
|
|
|
|
|
|
| 110 |
try:
|
| 111 |
-
# Detect the language of the user's input
|
| 112 |
detected_language = detect(user_input)
|
| 113 |
user_language = "Hindi" if detected_language == "hi" else "English"
|
| 114 |
|
| 115 |
-
# Handle special commands like "Define [term]"
|
| 116 |
command_response = command_handler(user_input)
|
| 117 |
if command_response:
|
| 118 |
history.append((user_input, command_response))
|
|
|
|
| 106 |
|
| 107 |
return formatted_response.strip()
|
| 108 |
|
| 109 |
+
def market_analysis_agent(user_input, history=None):
|
| 110 |
+
if history is None:
|
| 111 |
+
history = [] # Initialize history if it's None
|
| 112 |
+
|
| 113 |
try:
|
|
|
|
| 114 |
detected_language = detect(user_input)
|
| 115 |
user_language = "Hindi" if detected_language == "hi" else "English"
|
| 116 |
|
|
|
|
| 117 |
command_response = command_handler(user_input)
|
| 118 |
if command_response:
|
| 119 |
history.append((user_input, command_response))
|