Aayussh commited on
Commit
15a28f5
ยท
verified ยท
1 Parent(s): 0f4ed2c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -16
app.py CHANGED
@@ -19,7 +19,7 @@ def classify_urgency(symptoms: str) -> str:
19
  model="claude-sonnet-4-20250514",
20
  #model="claude-3-sonnet-20240229",
21
  max_tokens=150,
22
- temperature=0.1,
23
  system="You are a medical triage assistant. Provide clear, concise classifications.",
24
  messages=[{"role": "user", "content": prompt}]
25
  )
@@ -31,27 +31,28 @@ def get_possible_conditions(symptoms: str) -> str:
31
  message = client.messages.create(
32
  model="claude-sonnet-4-20250514",
33
  #model="claude-3-sonnet-20240229",
34
- max_tokens=200,
35
- temperature=0.1,
36
  system="You are a medical assistant. Provide clear, non-technical explanations of possible conditions.",
37
  messages=[{"role": "user", "content": prompt}]
38
  )
39
  return message.content[0].text
40
 
41
  def lookup_clinics(city: str) -> str:
42
- try:
43
- response = requests.get(MODAL_CLINIC_ENDPOINT, params={"city": city}, timeout=20)
44
- response.raise_for_status()
45
- clinics = response.json()
46
- if clinics and isinstance(clinics, list) and "error" not in clinics[0]:
47
- return "\n\n".join([
48
- f"๐Ÿฅ {clinic['name']}\n๐Ÿ”— {clinic['link']}\n๐Ÿ“ {clinic['description']}"
49
- for clinic in clinics
50
- ])
51
- else:
52
- return clinics[0].get("error", "No clinics found.")
53
- except Exception as e:
54
- return f"Error finding clinics: {str(e)}"
 
55
 
56
  def process_input(symptoms: str, city: str) -> tuple:
57
  """Process the input and return all results."""
 
19
  model="claude-sonnet-4-20250514",
20
  #model="claude-3-sonnet-20240229",
21
  max_tokens=150,
22
+ temperature=0.05,
23
  system="You are a medical triage assistant. Provide clear, concise classifications.",
24
  messages=[{"role": "user", "content": prompt}]
25
  )
 
31
  message = client.messages.create(
32
  model="claude-sonnet-4-20250514",
33
  #model="claude-3-sonnet-20240229",
34
+ max_tokens=400,
35
+ temperature=0.05,
36
  system="You are a medical assistant. Provide clear, non-technical explanations of possible conditions.",
37
  messages=[{"role": "user", "content": prompt}]
38
  )
39
  return message.content[0].text
40
 
41
  def lookup_clinics(city: str) -> str:
42
+ return "Clinic Lookup will be back soon"
43
+ # try:
44
+ # response = requests.get(MODAL_CLINIC_ENDPOINT, params={"city": city}, timeout=20)
45
+ # response.raise_for_status()
46
+ # clinics = response.json()
47
+ # if clinics and isinstance(clinics, list) and "error" not in clinics[0]:
48
+ # return "\n\n".join([
49
+ # f"๐Ÿฅ {clinic['name']}\n๐Ÿ”— {clinic['link']}\n๐Ÿ“ {clinic['description']}"
50
+ # for clinic in clinics
51
+ # ])
52
+ # else:
53
+ # return clinics[0].get("error", "No clinics found.")
54
+ # except Exception as e:
55
+ # return f"Error finding clinics: {str(e)}"
56
 
57
  def process_input(symptoms: str, city: str) -> tuple:
58
  """Process the input and return all results."""