lukmanaj commited on
Commit
6173684
ยท
verified ยท
1 Parent(s): 18c4235

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -8
app.py CHANGED
@@ -1,10 +1,9 @@
1
- from mistralai import Mistral
2
  import gradio as gr
3
  import os
4
  from datetime import datetime
5
- api_key = os.environ["MISTRAL_API_KEY"]
6
- model = "mistral-large-latest"
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 = client.chat.complete(
42
- model=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.choices[0].message.content
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
- # ๐Ÿ’Š ๐Ÿ’Š PharmaSafe - Drug Interaction Checker
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.