Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -519,7 +519,7 @@ Output Format:
|
|
| 519 |
**Why Interesting:** [1 sentence hook]
|
| 520 |
---""")
|
| 521 |
|
| 522 |
-
user_msg = HumanMessage(content=f"Search for recent breakthroughs in {topic}.
|
| 523 |
|
| 524 |
discovery_llm = llm_small.bind_tools([search_science_breakthroughs, get_all_previous_posts, check_topic_similarity])
|
| 525 |
response = discovery_llm.invoke([system_msg, user_msg])
|
|
@@ -589,7 +589,12 @@ Then rank on:
|
|
| 589 |
|
| 590 |
Output: RANKED CANDIDATES, then SELECTED STORY with title uniqueness check.""")
|
| 591 |
|
| 592 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 593 |
|
| 594 |
curator_llm = llm_medium.bind_tools([check_topic_similarity, get_all_previous_posts])
|
| 595 |
response = curator_llm.invoke([system_msg, user_msg])
|
|
@@ -665,7 +670,7 @@ CONTENT:
|
|
| 665 |
- keep the content formal as in the examples
|
| 666 |
HASHTAGS: Always include #TuesdayTrivia #RnDCell #CCA + 2-4 topic hashtags""")
|
| 667 |
|
| 668 |
-
user_msg = HumanMessage(content=f"Write Tuesday Trivia post
|
| 669 |
|
| 670 |
writer_llm = llm_medium.bind_tools([get_example_posts_for_writer, check_topic_similarity, fetch_article_content, count_words])
|
| 671 |
response = writer_llm.invoke([system_msg, user_msg])
|
|
@@ -752,7 +757,7 @@ ACTIONABLE FIXES:
|
|
| 752 |
|
| 753 |
""")
|
| 754 |
|
| 755 |
-
user_msg = HumanMessage(content=f"Evaluate this post
|
| 756 |
|
| 757 |
critic_llm = llm_large.bind_tools([get_example_posts_for_critic, check_topic_similarity])
|
| 758 |
response = critic_llm.invoke([system_msg, user_msg])
|
|
|
|
| 519 |
**Why Interesting:** [1 sentence hook]
|
| 520 |
---""")
|
| 521 |
|
| 522 |
+
user_msg = HumanMessage(content=f"Search for recent breakthroughs in {topic}.")
|
| 523 |
|
| 524 |
discovery_llm = llm_small.bind_tools([search_science_breakthroughs, get_all_previous_posts, check_topic_similarity])
|
| 525 |
response = discovery_llm.invoke([system_msg, user_msg])
|
|
|
|
| 589 |
|
| 590 |
Output: RANKED CANDIDATES, then SELECTED STORY with title uniqueness check.""")
|
| 591 |
|
| 592 |
+
if retry_count > 0:
|
| 593 |
+
instruction = f"Refine the previous draft based on this feedback:\n{state.get('critic_feedback')}\n\nOriginal Story:\n{story_text}"
|
| 594 |
+
else:
|
| 595 |
+
instruction = f"Write Tuesday Trivia post based on:\n{story_text}"
|
| 596 |
+
|
| 597 |
+
user_msg = HumanMessage(content=instruction)
|
| 598 |
|
| 599 |
curator_llm = llm_medium.bind_tools([check_topic_similarity, get_all_previous_posts])
|
| 600 |
response = curator_llm.invoke([system_msg, user_msg])
|
|
|
|
| 670 |
- keep the content formal as in the examples
|
| 671 |
HASHTAGS: Always include #TuesdayTrivia #RnDCell #CCA + 2-4 topic hashtags""")
|
| 672 |
|
| 673 |
+
user_msg = HumanMessage(content=f"Write Tuesday Trivia post:\n{story_text}\n{retry_context}")
|
| 674 |
|
| 675 |
writer_llm = llm_medium.bind_tools([get_example_posts_for_writer, check_topic_similarity, fetch_article_content, count_words])
|
| 676 |
response = writer_llm.invoke([system_msg, user_msg])
|
|
|
|
| 757 |
|
| 758 |
""")
|
| 759 |
|
| 760 |
+
user_msg = HumanMessage(content=f"Evaluate this post:\n\n{draft}")
|
| 761 |
|
| 762 |
critic_llm = llm_large.bind_tools([get_example_posts_for_critic, check_topic_similarity])
|
| 763 |
response = critic_llm.invoke([system_msg, user_msg])
|