ruecat / ollama-telegram

🦙 Ollama Telegram bot, with advanced configuration
MIT License
298 stars 82 forks source link

Added system prompt features and model management features #74

Closed socode-marcelo closed 2 weeks ago

socode-marcelo commented 2 weeks ago

Besides adding new functions I made some improvements to the ollama_request function:

System prompt handling Explicitly search for the selected system prompt by ID Add system prompt as a separate message at the beginning of the conversation Add logging for cases where the selected prompt is not found Improved message history management:

Modified add_prompt_to_active_chats to handle system prompts Preserve existing conversation history Correctly structure messages for the Ollama API Added more detailed error logging Include the specific error message in the bot's response