fix: gpt-oss:20b ollama, streaming, tableaux JSON, recherche flexible salons/categories
This commit is contained in:
parent
14985f6dbb
commit
189d56026b
21 changed files with 2824 additions and 491 deletions
|
|
@ -4,7 +4,7 @@ import os
|
|||
import aiohttp
|
||||
from datetime import datetime
|
||||
|
||||
WARNINGS_FILE = 'warnings.json'
|
||||
WARNINGS_FILE = 'data/warnings.json'
|
||||
|
||||
def load_warnings():
|
||||
if os.path.exists(WARNINGS_FILE):
|
||||
|
|
@ -123,7 +123,9 @@ async def execute(bot, params, message):
|
|||
target_mention = warn_params.get('target_user_mention')
|
||||
original_reason = warn_params.get('reason', 'Aucune raison spécifiée')
|
||||
# Rephrase the reason using Ollama
|
||||
rephrased_reason = await rephrase_reason(original_reason, bot.ollama_api_url, bot.ollama_api_key, bot.ollama_model, bot.ollama_timeout, bot.ollama_temperature)
|
||||
ollama_url = os.environ.get("OLLAMA_BASE_URL", "http://localhost:11434") + "/api/generate"
|
||||
ollama_model = os.environ.get("OLLAMA_MODEL", "gpt-oss:20b")
|
||||
rephrased_reason = await rephrase_reason(original_reason, ollama_url, "", ollama_model, 30, 0.7)
|
||||
reason = rephrased_reason if rephrased_reason else original_reason
|
||||
# Parse mention or ID
|
||||
if target_mention.startswith('<@') and target_mention.endswith('>'):
|
||||
|
|
@ -168,7 +170,7 @@ async def execute(bot, params, message):
|
|||
)
|
||||
await message.channel.send(embed=embed)
|
||||
# Generate full DM message using AI with original reason for polite reformulation
|
||||
dm_message = await generate_dm_message(original_reason, warning_count, bot.ollama_api_url, bot.ollama_api_key, bot.ollama_model, bot.ollama_timeout, bot.ollama_temperature)
|
||||
dm_message = await generate_dm_message(original_reason, warning_count, ollama_url, "", ollama_model, 30, 0.7)
|
||||
dm_content = dm_message if dm_message else f"Avertissement : {reason}. Nombre total : {warning_count}."
|
||||
# Send DM to user
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue