Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,10 +1,9 @@
|
|
| 1 |
-
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
from datetime import datetime
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
client = Mistral(api_key=api_key)
|
| 8 |
def interaction_check(prompt):
|
| 9 |
"""
|
| 10 |
Check for drug interactions and provide pharmacist guidance
|
|
@@ -38,8 +37,8 @@ Important guidelines:
|
|
| 38 |
|
| 39 |
Format your response with clear sections and use emojis for visual clarity where appropriate."""
|
| 40 |
|
| 41 |
-
chat_response =
|
| 42 |
-
model=
|
| 43 |
messages=[
|
| 44 |
{
|
| 45 |
"role": "system",
|
|
@@ -54,7 +53,7 @@ Format your response with clear sections and use emojis for visual clarity where
|
|
| 54 |
max_tokens=1000 # Ensure comprehensive responses
|
| 55 |
)
|
| 56 |
|
| 57 |
-
response = chat_response.
|
| 58 |
|
| 59 |
# Add disclaimer footer
|
| 60 |
disclaimer = "\n\n---\nโ ๏ธ **IMPORTANT DISCLAIMER**: This information is for educational purposes only and should not replace professional medical advice. Always consult with a licensed pharmacist or healthcare provider before making any changes to your medications."
|
|
@@ -120,7 +119,7 @@ with gr.Blocks(css=custom_css, title="๐ PharmaSafe - Drug Interaction Checker
|
|
| 120 |
# Header
|
| 121 |
gr.Markdown(
|
| 122 |
"""
|
| 123 |
-
# ๐ ๐
|
| 124 |
|
| 125 |
Get preliminary guidance on potential drug interactions and medication safety concerns.
|
| 126 |
This tool helps identify possible interactions between medications.
|
|
|
|
| 1 |
+
import cohere
|
| 2 |
import gradio as gr
|
| 3 |
import os
|
| 4 |
from datetime import datetime
|
| 5 |
+
MODEL = "command-a-03-2025"
|
| 6 |
+
co = cohere.ClientV2(api_key=os.environ["COHERE_API_KEY"])
|
|
|
|
| 7 |
def interaction_check(prompt):
|
| 8 |
"""
|
| 9 |
Check for drug interactions and provide pharmacist guidance
|
|
|
|
| 37 |
|
| 38 |
Format your response with clear sections and use emojis for visual clarity where appropriate."""
|
| 39 |
|
| 40 |
+
chat_response = co.chat(
|
| 41 |
+
model=MODEL,
|
| 42 |
messages=[
|
| 43 |
{
|
| 44 |
"role": "system",
|
|
|
|
| 53 |
max_tokens=1000 # Ensure comprehensive responses
|
| 54 |
)
|
| 55 |
|
| 56 |
+
response = chat_response.message.content[0].text
|
| 57 |
|
| 58 |
# Add disclaimer footer
|
| 59 |
disclaimer = "\n\n---\nโ ๏ธ **IMPORTANT DISCLAIMER**: This information is for educational purposes only and should not replace professional medical advice. Always consult with a licensed pharmacist or healthcare provider before making any changes to your medications."
|
|
|
|
| 119 |
# Header
|
| 120 |
gr.Markdown(
|
| 121 |
"""
|
| 122 |
+
# ๐ ๐ PharmaSafety - Drug Interaction Checker
|
| 123 |
|
| 124 |
Get preliminary guidance on potential drug interactions and medication safety concerns.
|
| 125 |
This tool helps identify possible interactions between medications.
|