prompt updated
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 578 |
prompt = (
|
| 579 |
-
"
|
| 580 |
-
f"
|
| 581 |
-
"
|
| 582 |
-
|
| 583 |
-
"
|
| 584 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|
| 593 |
-
"
|
| 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 |
|