Saeed commited on
Commit
bcae505
·
verified ·
1 Parent(s): f8761f0

prompt updated

Browse files
Files changed (1) hide show
  1. app.py +25 -11
app.py CHANGED
@@ -573,15 +573,24 @@ if st.button("🛠️ Optimize WSSQ"):
573
  st.table(best_df)
574
 
575
  st.markdown("## 🧪 Fabrication Procedure")
576
- with st.spinner("Generating fabrication procedure…"):
577
- density = best.params.get("cell_density", 0.0)
 
 
 
 
 
578
  prompt = (
579
- "Based on the following optimized scaffold parameters AND your selected cell line:\n\n"
580
- f"• Cell line: {cell_line}\n"
581
- "Optimized scaffold parameters:\n"
582
- f"{best.params}\n\n"
583
- "Write a detailed, step-by-step fabrication procedure for 3D (bio)printing "
584
- "this scaffold — including materials, equipment, printing settings, and post‑processing."
 
 
 
 
585
  )
586
 
587
  resp = client.models.generate_content(
@@ -589,9 +598,14 @@ if st.button("🛠️ Optimize WSSQ"):
589
  contents=prompt,
590
  config=types.GenerateContentConfig(
591
  system_instruction=(
592
- "You are a biomedical engineering professor with tissue engineering experties. "
593
- "you know how to print 3d (bio)printed scaffolds in labs."
594
- )
 
 
 
 
 
595
  )
596
  )
597
 
 
573
  st.table(best_df)
574
 
575
  st.markdown("## 🧪 Fabrication Procedure")
576
+ with st.spinner("Generating rigorous fabrication procedure…"):
577
+
578
+ formatted_params = "\n".join([
579
+ f"- {k.replace('bio__', 'Biomaterial: ').replace('pp__', 'Print Setting: ')}: {v:.2f}"
580
+ for k, v in best.params.items()
581
+ ])
582
+
583
  prompt = (
584
+ f"Please write a detailed, step-by-step laboratory fabrication procedure for 3D (bio)printing a scaffold using the following optimized parameters:\n\n"
585
+ f"Target Cell Line: {cell_line}\n"
586
+ f"Parameters:\n{formatted_params}\n\n"
587
+ "Your response must be structured exactly with the following sections:\n"
588
+ "1. Required Materials & Equipment\n"
589
+ "2. Sterilization & Safety Precautions\n"
590
+ "3. Bioink Preparation\n"
591
+ "4. 3D Bioprinting Settings & Execution\n"
592
+ "5. Post-processing & Crosslinking\n"
593
+ "6. Cell Culturing & Incubation Instructions"
594
  )
595
 
596
  resp = client.models.generate_content(
 
598
  contents=prompt,
599
  config=types.GenerateContentConfig(
600
  system_instruction=(
601
+ "You are an expert experimentalist researcher in tissue engineering and biofabrication. "
602
+ "Your specialty is translating theoretical parameters into rigorous, reproducible laboratory protocols. "
603
+ "Pay strict attention to laboratory details, including sterility (aseptic techniques), precise equipment handling, material preparation, and safety precautions. "
604
+ "Provide highly structured, practical, and deterministic procedures."
605
+ ),
606
+ temperature=0.2,
607
+ top_p=0.8,
608
+ max_output_tokens=2048
609
  )
610
  )
611