Skip to content

Commit f3485bf

Browse files
committed
fix: increase response length
1 parent a174ff1 commit f3485bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
# Reply with user data for Healthcheck
3535
send_user_info_with_healthcheck = os.getenv("SEND_USER_INFO_WITH_HEALTHCHECK", "False").lower() == "true"
3636
USE_LLM = os.getenv("USE_LLM", "False").lower() == "true"
37-
LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
38-
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11434")
37+
# LLM_MODEL = os.getenv("LLM_MODEL", "gemma3:4b")
38+
LLM_API_ADDR = os.getenv("LLM_API_ADDR", "http://localhost:11435")
3939
TELEGRAM_WRITE_TIMEOUT = 8000
4040
TELEGRAM_READ_TIMEOUT = 8000
4141

@@ -461,14 +461,14 @@ async def respond_with_llm_message(update):
461461
f"{LLM_API_ADDR}/completion",
462462
json={
463463
"prompt": prompt,
464-
"n_predict": 200,
464+
"n_predict": 1024,
465465
"temperature": 0.7,
466466
"stop": ["</s>", "User:", "Assistant:"],
467467
},
468468
) as response:
469469
if response.status == 200:
470470
result = await response.json()
471-
bot_response = result.get("content", "Sorry, I couldn't generate a response.")
471+
bot_response = result.get("content", "Sorry, I couldn't generate a response.").strip()
472472
else:
473473
bot_response = "Sorry, I encountered an error while processing your request."
474474

0 commit comments

Comments
 (0)