Spaces:
Sleeping
Sleeping
format answer
Browse files- pages/Summary.py +5 -5
pages/Summary.py
CHANGED
@@ -69,12 +69,12 @@ def generate_summary_with_claude(transcript, prompt_text):
|
|
69 |
]
|
70 |
)
|
71 |
|
72 |
-
response_text = " ".join([block['text'] if isinstance(block, dict) and 'text' in block else str(block) for block in message.content])
|
73 |
-
clean_summary = response_text.replace("\\n", " ").replace("TextBlock(text=", "").replace("type='text')", "")
|
74 |
-
paragraphs = clean_summary.split('. ')
|
75 |
-
formatted_summary = '\n\n'.join(paragraphs)
|
76 |
|
77 |
-
return
|
78 |
|
79 |
except Exception as e:
|
80 |
st.error(f"Ошибка при обращении к Claude: {e}")
|
|
|
69 |
]
|
70 |
)
|
71 |
|
72 |
+
# response_text = " ".join([block['text'] if isinstance(block, dict) and 'text' in block else str(block) for block in message.content])
|
73 |
+
# clean_summary = response_text.replace("\\n", " ").replace("TextBlock(text=", "").replace("type='text')", "")
|
74 |
+
# paragraphs = clean_summary.split('. ')
|
75 |
+
# formatted_summary = '\n\n'.join(paragraphs)
|
76 |
|
77 |
+
return message.content[0].text
|
78 |
|
79 |
except Exception as e:
|
80 |
st.error(f"Ошибка при обращении к Claude: {e}")
|