Spaces:
Sleeping
Sleeping
Commit ·
cdbd107
1
Parent(s): e17b407
long output bug fix
Browse files
main.py
CHANGED
|
@@ -128,11 +128,17 @@ async def on_message(message):
|
|
| 128 |
references += f"\tDocumentation: {data['path'].split("/")[-1]}"
|
| 129 |
references += "\n"
|
| 130 |
|
| 131 |
-
llm_answer: str = await llm_output(question, db_context)
|
| 132 |
|
| 133 |
try:
|
| 134 |
-
|
| 135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
except Exception as e: # TODO: make exception handling better
|
| 137 |
print(e)
|
| 138 |
await message.reply("An error occurred. Retry again.")
|
|
|
|
| 128 |
references += f"\tDocumentation: {data['path'].split("/")[-1]}"
|
| 129 |
references += "\n"
|
| 130 |
|
| 131 |
+
llm_answer: str = await llm_output(question, db_context)
|
| 132 |
|
| 133 |
try:
|
| 134 |
+
start = 0
|
| 135 |
+
while llm_answer[start: start+1990] != "":
|
| 136 |
+
if (start == 0):
|
| 137 |
+
await message.reply(content=llm_answer[start: start+1990])
|
| 138 |
+
else:
|
| 139 |
+
await message.reply(content=llm_answer[start: start+1990])
|
| 140 |
+
start += 1990
|
| 141 |
+
await message.reply(content=f"**References**\n{references}", view=Like_Dislike())
|
| 142 |
except Exception as e: # TODO: make exception handling better
|
| 143 |
print(e)
|
| 144 |
await message.reply("An error occurred. Retry again.")
|