diff --git a/src/main/java/dev/marcospaulo/canalhandia/AiProfile.java b/src/main/java/dev/marcospaulo/canalhandia/AiProfile.java new file mode 100644 index 0000000..4ff3906 --- /dev/null +++ b/src/main/java/dev/marcospaulo/canalhandia/AiProfile.java @@ -0,0 +1,25 @@ +package dev.marcospaulo.canalhandia; + +/** + * How much work to do per question. + * + *
This trades latency, not money: the plan's token allowance is far beyond
+ * what a small server can spend, but every added context token makes chat feel
+ * slower.
+ */
+enum AiProfile {
+
+ /** Skip the wiki round trip. Fast, ungrounded. */
+ ECONOMICO,
+ /** Consult the wiki. Slower, accurate. */
+ PRECISO;
+
+ static AiProfile byKey(String key) {
+ for (AiProfile profile : values()) {
+ if (profile.name().equalsIgnoreCase(key)) {
+ return profile;
+ }
+ }
+ return PRECISO;
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/dev/marcospaulo/canalhandia/Settings.java b/src/main/java/dev/marcospaulo/canalhandia/Settings.java
index 3fbd227..78b5811 100644
--- a/src/main/java/dev/marcospaulo/canalhandia/Settings.java
+++ b/src/main/java/dev/marcospaulo/canalhandia/Settings.java
@@ -252,7 +252,7 @@ final class Settings {
}
int aiMaxTokens() {
- return Math.max(32, plugin.getConfig().getInt("ia.max-tokens", 300));
+ return Math.max(32, plugin.getConfig().getInt("ia.max-tokens", 1200));
}
double aiTemperature() {
@@ -297,6 +297,31 @@ final class Settings {
set("ia.publico", value);
}
+ AiProfile aiProfile() {
+ return AiProfile.byKey(plugin.getConfig().getString("ia.perfil", "PRECISO"));
+ }
+
+ void aiProfile(AiProfile profile) {
+ set("ia.perfil", profile.name());
+ }
+
+ /** How much article text to send. Lead paragraphs alone were not enough. */
+ int aiWikiChars() {
+ return Math.max(500, plugin.getConfig().getInt("ia.wiki-caracteres", 7000));
+ }
+
+ int aiMemoryExchanges() {
+ return Math.max(0, plugin.getConfig().getInt("ia.memoria-perguntas", 3));
+ }
+
+ int aiMemoryMinutes() {
+ return Math.max(1, plugin.getConfig().getInt("ia.memoria-minutos", 10));
+ }
+
+ String aiServerContext() {
+ return String.join(" ", plugin.getConfig().getStringList("ia.contexto"));
+ }
+
// --- content ------------------------------------------------------------
boolean categoryEnabled(Category category) {
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 5eb80a7..a012eb7 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -129,7 +129,9 @@ ia:
modelo: "MiniMax-M2.7"
# Tamanho da resposta pedida ao modelo, e o corte final no chat.
- max-tokens: 300
+ # 1200, não 300: o raciocínio oculto do M3 consome o orçamento e a resposta
+ # chega vazia quando o teto é baixo.
+ max-tokens: 1200
max-caracteres: 500
# Tamanho máximo da pergunta, em caracteres.
@@ -161,3 +163,22 @@ ia:
terminal nem de Minecraft. Escreva em texto puro: nada de markdown,
asteriscos, crases ou emoji, porque o chat do Minecraft não formata nada
disso.
+
+ # ECONOMICO pula a consulta à wiki (resposta rápida, sem fonte).
+ # PRECISO consulta a wiki (mais lento, mais correto). Troque em jogo com
+ # /ia perfil