prompt updated
Browse files
app.py
CHANGED
|
@@ -580,34 +580,49 @@ if st.button("🛠️ Optimize WSSQ"):
|
|
| 580 |
for k, v in best.params.items()
|
| 581 |
])
|
| 582 |
|
| 583 |
-
|
| 584 |
-
|
| 585 |
-
|
| 586 |
-
|
| 587 |
-
|
| 588 |
-
|
| 589 |
-
|
| 590 |
-
|
| 591 |
-
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
)
|
| 595 |
-
|
| 596 |
-
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
|
| 605 |
-
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 610 |
)
|
|
|
|
| 611 |
|
| 612 |
procedure = resp.text
|
| 613 |
st.markdown(procedure)
|
|
|
|
| 580 |
for k, v in best.params.items()
|
| 581 |
])
|
| 582 |
|
| 583 |
+
prompt = (
|
| 584 |
+
f"Please act as a senior tissue engineer with 15+ years of hands-on experience in 3D bioprinting for regenerative medicine. "
|
| 585 |
+
f"Write a **highly practical, bench-ready laboratory fabrication protocol** for 3D bioprinting a cell-laden scaffold. "
|
| 586 |
+
f"The protocol must be written so that a trained experimentalist can follow it directly in a standard tissue engineering lab (biosafety cabinet, extrusion bioprinter, 37 °C/5 % CO₂ incubator, centrifuge, etc.) with zero ambiguity.\n\n"
|
| 587 |
+
|
| 588 |
+
f"**Use exactly these inputs to tailor every step:**\n"
|
| 589 |
+
f"Target Cell Line: {cell_line}\n"
|
| 590 |
+
f"Parameters:\n{formatted_params}\n\n"
|
| 591 |
+
|
| 592 |
+
f"**Critical requirements for the protocol (you MUST follow all of them):**\n"
|
| 593 |
+
f"• Every quantity must be given in measurable lab units (e.g., 2.5 mL, 1.2 % w/v, 10 mg/mL, 37 °C, 5 min, 150 rpm).\n"
|
| 594 |
+
f"• Include exact timings, temperatures, and workflow order to protect cell viability (target >85 % post-print) and maintain scaffold fidelity.\n"
|
| 595 |
+
f"• Anticipate and explicitly address common bioprinting pitfalls relevant to the given parameters (nozzle clogging, shear-induced cell death, premature gelation, filament fusion, air bubbles, etc.) and give precise mitigation steps.\n"
|
| 596 |
+
f"• Emphasize aseptic technique, sterility, and biosafety at every stage.\n"
|
| 597 |
+
f"• Use only reagents and equipment that are standard in tissue engineering labs; if a specific brand/model is implied by the parameters, note a common equivalent.\n"
|
| 598 |
+
f"• Include simple quality-control checkpoints (visual inspection, live/dead staining timing, etc.).\n\n"
|
| 599 |
+
|
| 600 |
+
f"Your response must be structured **exactly** with the following sections (no extra sections, no introductory text, no summary, no conclusions):\n"
|
| 601 |
+
f"1. Required Materials & Equipment\n"
|
| 602 |
+
f"2. Sterilization & Safety Precautions\n"
|
| 603 |
+
f"3. Bioink Preparation\n"
|
| 604 |
+
f"4. 3D Bioprinting Settings & Execution\n"
|
| 605 |
+
f"5. Post-processing & Crosslinking\n"
|
| 606 |
+
f"6. Cell Culturing & Incubation Instructions"
|
| 607 |
+
)
|
| 608 |
+
|
| 609 |
+
resp = client.models.generate_content(
|
| 610 |
+
model="gemini-2.5-flash-lite",
|
| 611 |
+
contents=prompt,
|
| 612 |
+
config=types.GenerateContentConfig(
|
| 613 |
+
system_instruction=(
|
| 614 |
+
"You are a senior tissue engineer and expert experimentalist specializing in translating optimized bioprinting parameters into reproducible, high-viability laboratory protocols. "
|
| 615 |
+
"Your protocols are used daily by PhD students and post-docs in regenerative medicine labs. "
|
| 616 |
+
"You always prioritize: (1) maximum cell viability and function, (2) structural fidelity of the printed construct, (3) workflow efficiency under sterile conditions, and (4) safety. "
|
| 617 |
+
"Write in clear, imperative, step-by-step language with numbered or bulleted sub-steps. "
|
| 618 |
+
"Never be vague — give exact volumes, times, temperatures, speeds, and concentrations. "
|
| 619 |
+
"Never add disclaimers or theoretical background unless explicitly asked."
|
| 620 |
+
),
|
| 621 |
+
temperature=0.1, # lowered for maximum determinism
|
| 622 |
+
top_p=0.85,
|
| 623 |
+
max_output_tokens=6144
|
| 624 |
)
|
| 625 |
+
)
|
| 626 |
|
| 627 |
procedure = resp.text
|
| 628 |
st.markdown(procedure)
|