Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,6 +27,12 @@ groq_models = [
|
|
| 27 |
"mixtral-8x7b-32768"
|
| 28 |
]
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
# Function to format JSON into readable Markdown
|
| 31 |
def format_json_to_markdown(data):
|
| 32 |
markdown = "# Company Overview\n\n"
|
|
@@ -92,6 +98,9 @@ def format_json_to_markdown(data):
|
|
| 92 |
markdown += f" - {condition}\n"
|
| 93 |
markdown += f"- **Summary Rationale**: {recommendation.get('summary_rationale', 'N/A')}\n"
|
| 94 |
|
|
|
|
|
|
|
|
|
|
| 95 |
return markdown
|
| 96 |
|
| 97 |
# Function to convert JSON to formatted text
|
|
@@ -147,6 +156,9 @@ def chat_with_json(api_key, model_name, filename, question):
|
|
| 147 |
)
|
| 148 |
answer = completion.choices[0].message.content
|
| 149 |
|
|
|
|
|
|
|
|
|
|
| 150 |
# Check if the LLM suggests a web search
|
| 151 |
if "I can search the web" in answer:
|
| 152 |
return answer # Let the user decide if they want a web search
|
|
|
|
| 27 |
"mixtral-8x7b-32768"
|
| 28 |
]
|
| 29 |
|
| 30 |
+
# Disclaimer note
|
| 31 |
+
DISCLAIMER = (
|
| 32 |
+
"\n\n**Disclaimer**: This information is for informational purposes only and does not constitute investment advice. "
|
| 33 |
+
"Please consult with a qualified financial advisor before making any investment decisions."
|
| 34 |
+
)
|
| 35 |
+
|
| 36 |
# Function to format JSON into readable Markdown
|
| 37 |
def format_json_to_markdown(data):
|
| 38 |
markdown = "# Company Overview\n\n"
|
|
|
|
| 98 |
markdown += f" - {condition}\n"
|
| 99 |
markdown += f"- **Summary Rationale**: {recommendation.get('summary_rationale', 'N/A')}\n"
|
| 100 |
|
| 101 |
+
# Add the disclaimer
|
| 102 |
+
markdown += DISCLAIMER
|
| 103 |
+
|
| 104 |
return markdown
|
| 105 |
|
| 106 |
# Function to convert JSON to formatted text
|
|
|
|
| 156 |
)
|
| 157 |
answer = completion.choices[0].message.content
|
| 158 |
|
| 159 |
+
# Add disclaimer to the chat response
|
| 160 |
+
answer += DISCLAIMER
|
| 161 |
+
|
| 162 |
# Check if the LLM suggests a web search
|
| 163 |
if "I can search the web" in answer:
|
| 164 |
return answer # Let the user decide if they want a web search
|