Config YAML File

The config.yml file is the main configuration file for ServerAssistantAI, containing various settings that control the AI's behavior, appearance, and performance.

Minecraft Configuration:

  • minecraft.messages_channel: The Discord channel ID where player interactions with the AI will be logged.

  • minecraft.reply_format: The format of the AI's responses in Minecraft chat (supports MiniMessage formatting).

  • minecraft.send_replies_only_to_sender: Whether the AI's responses should be visible only to the player who asked the question.

  • minecraft.bot_name: The name of the AI bot, used to trigger responses even if the message is not a question.

  • minecraft.limits: Daily question limits for Minecraft players. You can define multiple user groups with different limits. Players can be assigned to a group using the permission serverassistantai.group.<group>.

  • minecraft.ignore_question: The instruction for the AI to ignore questions not related to the server.

  • minecraft.ignore_keyword: The keyword that, if present in the AI's response, will cause the response to be ignored.

  • minecraft.minimum_words: The minimum number of words required for a Minecraft chat message to be considered a question.

  • minecraft.response_sound: The sound to play when a player receives a response from the AI. Leave empty to disable. Sound names can be found here.

  • minecraft.default_toggle_value: The default value of the /saai toggle command for players who have not toggled their status yet.

  • minecraft.chat_listener.use_paper_event: Whether to use the Paper modern AsyncChatEvent if available. Has no effect on Spigot servers.

  • minecraft.chat_listener.priority: The priority level for the chat event listener. Options: LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR (default).

  • minecraft.chat_listener.ignore_cancelled: Whether to ignore the chat event if it is cancelled by another plugin.

  • minecraft.question_detection.provider: The provider of the question detection system. Can be 'simple' for keyword/regex-based checks, or 'advanced' for improved detection using a custom-trained model (requires the Advanced Question Detection addon).

  • minecraft.question_detection.regex: This field is not shown by default and can be added manually when using the 'simple' or 'advanced' provider. You can include a regex pattern to match messages that are questions based on the specified pattern.

  • minecraft.question_detection.interpersonal_regex: A regex pattern to detect messages directed at other players, which will be ignored by the AI. This field will be ignored if the 'advanced' provider is selected.

Discord Configuration:

  • discord.enabled: Enable or disable Discord functionality.

  • discord.channel_id: The Discord channel ID where the AI will listen for questions. This channel should be dedicated solely to asking questions to the AI and not used as a regular chat channel.

  • discord.bypass_roles: A list of Discord role IDs that can bypass question limits.

  • discord.skip_keyword_roles: A list of Discord role IDs that can use the skip keyword.

  • discord.skip_keyword: The keyword that will prevent the AI from responding to a message.

  • discord.blocked_roles: A list of Discord role IDs that are blocked from using the AI.

  • discord.minimum_words: The minimum number of words required for the AI to respond to a message.

  • discord.max_history: The maximum number of previous messages to include in the AI's context.

  • discord.max_history_characters: The maximum number of characters in the AI's message history context.

  • discord.limits: Daily question limits for Discord users. You can define multiple user groups with different limits using role IDs or role names.

  • discord.bot_token: (Optional) A separate Discord bot token for the AI, if not using DiscordSRV's bot.

Prompt Configuration:

  • prompt.discord.max_results: The maximum number of relevant embedding chunks to include in the {information} context of Discord questions.

  • prompt.discord.min_score: The minimum relevance score for an embedding chunk to be considered related to Discord questions. Recommended to not go above 0.65.

  • prompt.minecraft.max_results: The maximum number of relevant embedding chunks to include in the {information} context of Minecraft questions.

  • prompt.minecraft.min_score: The minimum relevance score for an embedding chunk to be considered related to Minecraft questions. Recommended to not go above 0.65.

Embedding Model Configuration:

  • embedding_model.provider: The provider of the embedding model to use for both Discord and Minecraft responses ('openai', 'cohere', etc).

  • embedding_model.model: The name of the embedding model to use for Discord and Minecraft responses (e.g., 'text-embedding-3-large', 'embed-multilingual-v3.0', etc).

ServerAssistantAI only sends information to the embedding API when changes are made to the document.txt file. If no changes are detected, the plugin will use the previously cached embeddings to reduce API calls.

Chat Model Configuration:

  • chat_model.discord.provider: The provider of the chat model to use for Discord responses ( 'openai', 'cohere', etc).

  • chat_model.discord.model: The name of the chat model to use for Discord responses (e.g., 'gpt-3.5-turbo', 'command-r-plus', etc).

  • chat_model.discord.base_url: This field is not shown by default and can be added manually when using a custom baseURL-supported provider. Set this to the provider's endpoint URL (e.g., 'https://api.groq.com/openai/v1').

  • chat_model.minecraft.provider: The provider of the chat model to use for Minecraft responses ('openai' or 'cohere', etc).

  • chat_model.minecraft.model: The name of the chat model to use for Minecraft responses (e.g., 'gpt-3.5-turbo', 'command-r-plus', etc).

  • chat_model.minecraft.base_url: This field is not shown by default and can be added manually when using a custom baseURL-supported provider. Set this to the provider's endpoint URL (e.g., 'https://api.groq.com/openai/v1').

Response Filtering:

  • response_filtering.exclude: A list of elements that should be removed from the AI's responses (case-insensitive). This is in addition to the built-in list of elements that are always removed.

  • response_filtering.stop: A list of words that will cause the AI to stop a response immediately after encountering them.

Splitter Configuration:

  • splitter.max_segment: The maximum number of characters per chunk when splitting the server information document. Increase this value if your document is large.

  • splitter.max_overlap: The maximum number of overlapping characters between chunks (0 for no overlap).

Debug Configuration:

  • helpful_information: Whether to display helpful messages within an AI response on either Discord or in-game. Requires serverassistantai.helpful-information permission to view in-game helpful messages within a response.

config.yml:
```yaml
#  ____                            _            _     _              _      _    ___ 
# / ___|  ___ _ ____   _____ _ __ / \   ___ ___(_)___| |_ __ _ _ __ | |_   / \  |_ _|
# \___ \ / _ \ '__\ \ / / _ \ '__/ _ \ / __/ __| / __| __/ _` | '_ \| __| / _ \  | | 
#  ___) |  __/ |   \ V /  __/ | / ___ \\__ \__ \ \__ \ || (_| | | | | |_ / ___ \ | | 
# |____/ \___|_|    \_/ \___|_|/_/   \_\___/___/_|___/\__\__,_|_| |_|\__/_/   \_\___|
#
# Wiki: https://wiki.code-solutions.dev/serverassistantai
# Discord Server: https://code-solutions.dev/discord

# Minecraft Configuration.
minecraft:
  # Discord channel ID where player interactions with the chatbot will be logged.
  messages_channel: 0
  # Format for the bot's chat responses. <message> is the message placeholder for the response.
  reply_format: '<dark_gray>[</dark_gray><bold><gradient:#0073FF:#00C6FF>Assistant</gradient></bold><dark_gray>] <yellow><message></yellow>'
  # Set to true if you would like chatbot replies to be seen only by the person talking to your chatbot.
  send_replies_only_to_sender: false
  # The bot name which will force the bot to respond.
  bot_name: 'Assistant'
  # Daily limits for minecraft players. Optionally, create multiple groups with different limits.
  limits:
    default: 20

  # This will be added if the bot is not being forced to answer.
  ignore_question: 'If this question is not a question directly related to the minecraft server and is not in the context, then reply only with "[IGNORE]", otherwise go ahead and reply.'
  # If the response includes this keyword, it will be ignored. Set to empty string '' to disable. This will also disregard the above option.
  ignore_keyword: '[IGNORE]'
  # Minimum words for a message to be considered a question.
  minimum_words: 3
  # Sound to play when the player receives a response. Set to "" to disable. You can get sound names from https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Sound.html .
  response_sound: 'ENTITY_EXPERIENCE_ORB_PICKUP'
  # Default value for "/saai toggle". Applies to players who haven't yet toggled.
  default_toggle_value: true
  # Chat event listener configuration.
  chat_listener:
    # Use the Paper modern AsyncChatEvent if available. Has no effect on Spigot servers.
    use_paper_event: true
    # Choose the priority level for the chat event listener. Options: LOWEST, LOW, NORMAL, HIGH, HIGHEST, MONITOR (default).
    priority: 'MONITOR'
    # Ignore the chat event if it is cancelled by another plugin.
    ignore_cancelled: true

  # Uses a "provider" system. Use a built-in provider or one provided by an addon. If using 'simple' provider, you can add 'regex' below 'provider' to match messages that are questions based on the regex pattern. Look at the wiki for more info.
  question_detection:
    provider: 'simple'
    interpersonal_regex: '\b(how are you|did you|you got|you have|your|did we|anyone got|who needs|how was|how is|have you|did i|have i|who wants|what should|where should|are you|what''s up|would you|should you|will you|have we|shall we|may I|could I|should I|would I|are we going|are we|what are you doing|what do you think|where are you|who is|who has|who was|why did|why do|how did|what did|is it okay|is that your|do you want|do you have|can you give|would you like|what happened|how come|who''s going to|who''s got|got any|can I help|what''s your|how much|what time|where did|who will|who can)\b'


# Discord Configuration.
discord:
  # Enable or disable Discord functionality.
  enabled: false
  # Discord channel ID to listen for questions.
  channel_id: 0
  # The roles that can bypass all limits.
  bypass_roles: []
  # The roles required for the skip keyword to work.
  skip_keyword_roles: []
  # The bot will not respond to messages containing this keyword.
  skip_keyword: '[skip]'
  # The roles that are blocked from using the bot.
  blocked_roles: []
  # The minimum number of words for the bot to respond to a message.
  minimum_words: 3
  # Daily limits for discord users. Optionally, create multiple groups with different limits.
  limits:
    default: 20

  # The maximum number of messages history sent to the AI model. Does not include the message AI model is responding to.
  max_history: 10
  # The maximum number of characters in the history sent to the AI model. Does not include the message AI model is responding to.
  max_history_characters: 1000
  # Bot token for using a separate Discord bot instead of the DiscordSRV bot.
  bot_token: ''

prompt:
  # Discord Prompt Configuration.
  discord:
    # Maximum number of relevant embedding results (chunks) to include in the {information} context.
    max_results: 5
    # Minimum relevance score required for an embedding result (chunk) to be considered related. Set to 0 for no minimum score. Recommended to not go above 0.65.
    min_score: 0.0

  # Minecraft Prompt Configuration.
  minecraft:
    # Maximum number of relevant embedding results (chunks) to include in the {information} context.
    max_results: 5
    # Minimum relevance score required for an embedding result (chunk) to be considered related. Set to 0 for no minimum score. Recommended to not go above 0.65.
    min_score: 0.0


# Uses a "provider" system. Use a built-in provider or one provided by an addon. Look at the wiki for more info.
embedding_model:
  provider: 'cohere'
  model: 'embed-multilingual-v3.0'

chat_model:
  # Chat model Configuration for Discord.
  # Uses a "provider" system. Use a built-in provider or one provided by an addon. Look at the wiki for more info.
  discord:
    provider: 'cohere'
    model: 'command-r-plus'

  # Chat model Configuration for Minecraft.
  # Uses a "provider" system. Use a built-in provider or one provided by an addon. Look at the wiki for more info.
  minecraft:
    provider: 'cohere'
    model: 'command-r-plus'


# Response Filtering Configuration.
response_filtering:
  # Every element in this list will be removed from the bot's responses. It is case-insensitive.
  exclude: []
  # The AI's response will stop at any of the words (text elements) in this list.
  stop: []

# Splitter Configuration.
splitter:
  # The maximum number of characters per chunk. If your document is longer than 336K characters, increase this value to continue using the default free Cohere embedding model, use the paid Cohere Production API key, or use another embedding model.
  max_segment: 700
  # The maximum number of overlapping characters between chunks (0 for no overlap). Only full sentences are considered for the overlap.
  max_overlap: 0

# Whether to display helpful messages within the bot's response on either Discord or in-game.
helpful_information: false

```

Remember to reload ServerAssistantAI after making changes to the config.yml file for the changes to take effect.

Last updated