robinroy03 commited on
Commit
3a59da7
1 Parent(s): 7e78bd0

references are not on a seperate line anymore

Browse files
Files changed (1) hide show
  1. main.py +5 -5
main.py CHANGED
@@ -69,15 +69,15 @@ async def on_message(message):
69
 
70
  try:
71
  llm_answer, references = engine_response
 
72
  start = 0
73
  while llm_answer[start: start+1990] != "":
74
- if (start == 0):
75
- await message.reply(content=llm_answer[start: start+1990])
76
  else:
77
  await message.reply(content=llm_answer[start: start+1990])
78
- start += 1990
79
- await message.reply(content=f"**References**\n{references}", view=Like_Dislike())
80
- except Exception as e: # TODO: make exception handling better
81
  print(e)
82
  await message.reply("An error occurred. Retry again. Try different prompts.")
83
 
 
69
 
70
  try:
71
  llm_answer, references = engine_response
72
+ llm_answer += f"\n\n**References**\n{references}"
73
  start = 0
74
  while llm_answer[start: start+1990] != "":
75
+ if llm_answer[start+1990: start+1990+1990] == "":
76
+ await message.reply(content=llm_answer[start: start+1990], view=Like_Dislike())
77
  else:
78
  await message.reply(content=llm_answer[start: start+1990])
79
+ start += 1990
80
+ except Exception as e: # TODO: add logging
 
81
  print(e)
82
  await message.reply("An error occurred. Retry again. Try different prompts.")
83