mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-02 18:49:09 +00:00
Fix for podcast assitantt content
This commit is contained in:
parent
553e7bfacc
commit
bd8dc7934d
1 changed files with 4 additions and 12 deletions
|
@ -76,16 +76,8 @@ async def generate_chat_podcast(
|
||||||
chat_history_str += f"<user_message>{message['content']}</user_message>"
|
chat_history_str += f"<user_message>{message['content']}</user_message>"
|
||||||
processed_messages += 1
|
processed_messages += 1
|
||||||
elif message["role"] == "assistant":
|
elif message["role"] == "assistant":
|
||||||
# Last annotation type will always be "ANSWER" here
|
|
||||||
answer_annotation = message["annotations"][-1]
|
|
||||||
answer_text = ""
|
|
||||||
if answer_annotation["type"] == "ANSWER":
|
|
||||||
answer_text = answer_annotation["content"]
|
|
||||||
# If content is a list, join it into a single string
|
|
||||||
if isinstance(answer_text, list):
|
|
||||||
answer_text = "\n".join(answer_text)
|
|
||||||
chat_history_str += (
|
chat_history_str += (
|
||||||
f"<assistant_message>{answer_text}</assistant_message>"
|
f"<assistant_message>{message['content']}</assistant_message>"
|
||||||
)
|
)
|
||||||
processed_messages += 1
|
processed_messages += 1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue