mirror of
https://github.com/MODSetter/SurfSense.git
synced 2025-09-02 02:29:08 +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,18 +76,10 @@ async def generate_chat_podcast(
|
|||
chat_history_str += f"<user_message>{message['content']}</user_message>"
|
||||
processed_messages += 1
|
||||
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 += (
|
||||
f"<assistant_message>{answer_text}</assistant_message>"
|
||||
)
|
||||
processed_messages += 1
|
||||
chat_history_str += (
|
||||
f"<assistant_message>{message['content']}</assistant_message>"
|
||||
)
|
||||
processed_messages += 1
|
||||
|
||||
chat_history_str += "</chat_history>"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue