Spaces:
Sleeping
Sleeping
UI Updates
Browse files
app.py
CHANGED
|
@@ -88,10 +88,9 @@ def generate_title(state: BlogState):
|
|
| 88 |
- Attention-grabbing
|
| 89 |
- Between 6-12 words"""
|
| 90 |
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
st.write(f"Selected title: **{state['title']}**")
|
| 95 |
return state
|
| 96 |
|
| 97 |
def search_web(state: BlogState):
|
|
@@ -112,11 +111,6 @@ def search_web(state: BlogState):
|
|
| 112 |
content = result.get("content", "") + " " + result.get("title", "")
|
| 113 |
if is_english(content):
|
| 114 |
filtered_results.append(result)
|
| 115 |
-
|
| 116 |
-
st.write(f"Web Search Results: **{state['search_results']}**")
|
| 117 |
-
|
| 118 |
-
with st.status("🚀 Searching Web..."):
|
| 119 |
-
st.write(f"Selected title: **{filtered_results}**")
|
| 120 |
|
| 121 |
return {
|
| 122 |
"search_results": [
|
|
@@ -253,6 +247,14 @@ if generate_btn:
|
|
| 253 |
st.subheader("Final Blog Post")
|
| 254 |
st.markdown(final_state["blog_content"][-1].content)
|
| 255 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 256 |
st.markdown("---")
|
| 257 |
st.subheader("Quality Assurance Report")
|
| 258 |
st.write(final_state["reviewed_content"][-1].content)
|
|
|
|
| 88 |
- Attention-grabbing
|
| 89 |
- Between 6-12 words"""
|
| 90 |
|
| 91 |
+
|
| 92 |
+
response = llm.invoke(prompt)
|
| 93 |
+
state["title"] = response.content.split("\n")[0].strip('"')
|
|
|
|
| 94 |
return state
|
| 95 |
|
| 96 |
def search_web(state: BlogState):
|
|
|
|
| 111 |
content = result.get("content", "") + " " + result.get("title", "")
|
| 112 |
if is_english(content):
|
| 113 |
filtered_results.append(result)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 114 |
|
| 115 |
return {
|
| 116 |
"search_results": [
|
|
|
|
| 247 |
st.subheader("Final Blog Post")
|
| 248 |
st.markdown(final_state["blog_content"][-1].content)
|
| 249 |
|
| 250 |
+
st.markdown("---")
|
| 251 |
+
st.subheader("Generated Title")
|
| 252 |
+
st.write(final_state["title"])
|
| 253 |
+
|
| 254 |
+
st.markdown("---")
|
| 255 |
+
st.subheader("Web Search Results")
|
| 256 |
+
st.write(final_state["search_results"][-1].content)
|
| 257 |
+
|
| 258 |
st.markdown("---")
|
| 259 |
st.subheader("Quality Assurance Report")
|
| 260 |
st.write(final_state["reviewed_content"][-1].content)
|