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
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