▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Плагины/Ollama Chat
Ollama Chat

Ollama Chat

A versatile Minecraft plugin that integrates Ollama and OpenAI-class APIs, providing multi-language support, real-time AI interactions, and advanced prompt and conversation management for immersive in-game experiences.

Оцените первым
926
8
Все версииOllama Chat 1.1.5

Ollama Chat 1.1.5

Release31.07.2025

Список изменений

Version 1.1.5

Overview

This release reintroduces HikariCP for enhanced MySQL database performance and adds a public API for other plugins to interact with OllamaChat's AI chat functionality. It focuses on improving database efficiency, extensibility, and developer integration while maintaining compatibility with existing configurations.

New Features

  • HikariCP Integration:
    • Added HikariCP connection pooling for MySQL databases to improve performance and resource management.
    • Configurable HikariCP settings in config.yml under database.mysql.hikari for tuning connection pool parameters (e.g., maximum-pool-size, connection-timeout).
  • Public API:
    • Introduced OllamaChatAPI interface (com.ollamachat.api.OllamaChatAPI) for other plugins.
    • Supports sending AI queries, managing conversations, and accessing chat history programmatically with methods like sendAIQuery, createConversation, and listConversations.
    • Added API documentation in API.md for developer integration.

Enhancements

  • Database Management:
    • Updated DatabaseManager to leverage HikariCP for MySQL connections, while preserving SQLite functionality.
  • Dependency Management:
    • Updated DependencyLoader to include HikariCP (version 5.1.0) alongside MySQL and SQLite JDBC drivers, downloaded at runtime to plugins/OllamaChat/libs.
    • Maintained compileOnly in build.gradle for non-Paper dependencies to minimize JAR size.
  • Configuration:
    • Added database.mysql.hikari section to config.yml with default settings for connection pooling.
    • Improved config.yml comments for clarity and ease of use.

Bug Fixes

  • No specific bug fixes in this release, as the focus was on new features and performance improvements.

API Usage Example

Plugin ollamaPlugin = getServer().getPluginManager().getPlugin("OllamaChat");
if (ollamaPlugin != null && ollamaPlugin.isEnabled()) {
    OllamaChatAPI api = ((com.ollamachat.core.Ollamachat) ollamaPlugin).getAPI();
    api.sendAIQuery(player, "ollama", "Hello, how are you?")
        .thenAccept(response -> player.sendMessage("AI Response: " + response));
}

Configuration Example

database:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: ollamachat
    username: root
    password: ""
    hikari:
      maximum-pool-size: 10
      connection-timeout: 30000

Notes for Upgrading

  • Configuration:
    • Update config.yml to include the database.mysql.hikari section if using MySQL. Default values are added automatically.
    • Backup existing config.yml before updating to avoid data loss.
  • Dependencies:
    • The plugin downloads HikariCP (version 5.1.0) automatically on first startup. Ensure server internet access or verify HikariCP-5.1.0.jar in plugins/OllamaChat/libs.
    • Delete the libs folder to force re-download if dependencies are corrupted.
  • API Integration:
    • Developers can hook into OllamaChat using OllamaChatAPI. Add softdepend: [OllamaChat] to plugin.yml and refer to API.md.
  • Compatibility:
    • This update is backward-compatible with existing configurations and databases.
  • Testing:
    • Test database operations (e.g., /ollamachat conversation new) to verify MySQL/SQLite functionality.
    • Check server logs for dependency loading or database errors.

Known Issues

  • HikariCP settings may require manual tuning for optimal performance based on server load and MySQL configuration.

版本 1.1.5

概述

本次更新重新引入HikariCP以提升MySQL数据库性能,并新增公共API供其他插件与OllamaChat的AI聊天功能交互。重点改进数据库效率、可扩展性和开发者集成,同时保持与现有配置的兼容性。

新特性

  • HikariCP集成:
    • 为MySQL数据库添加HikariCP连接池,提升性能和资源管理
    • config.ymldatabase.mysql.hikari下可配置连接池参数(如maximum-pool-sizeconnection-timeout
  • 公共API:
    • 新增OllamaChatAPI接口(com.ollamachat.api.OllamaChatAPI
    • 支持通过编程方式发送AI查询、管理会话和访问聊天记录(如sendAIQuerycreateConversationlistConversations等方法)
    • 开发者文档见API.md

功能增强

  • 数据库管理:
    • 更新DatabaseManager以使用HikariCP管理MySQL连接,同时保留SQLite功能
  • 依赖管理:
    • 更新DependencyLoader包含HikariCP(5.1.0版)及MySQL/SQLite驱动,运行时下载至plugins/OllamaChat/libs
    • 保持build.gradle中非Paper依赖使用compileOnly以减小JAR体积
  • 配置优化:
    • config.yml新增database.mysql.hikari配置段
    • 改进配置注释的清晰度

问题修复

  • 本版本主要侧重新功能和性能提升,无特定问题修复

API使用示例

Plugin ollamaPlugin = getServer().getPluginManager().getPlugin("OllamaChat");
if (ollamaPlugin != null && ollamaPlugin.isEnabled()) {
    OllamaChatAPI api = ((com.ollamachat.core.Ollamachat) ollamaPlugin).getAPI();
    api.sendAIQuery(player, "ollama", "你好吗?")
        .thenAccept(response -> player.sendMessage("AI回复: " + response));
}

配置示例

database:
  type: mysql
  mysql:
    host: localhost
    port: 3306
    database: ollamachat
    username: root
    password: ""
    hikari:
      maximum-pool-size: 10
      connection-timeout: 30000

升级须知

  • 配置:
    • 使用MySQL需更新config.yml添加hikari配置段(默认值会自动生成)
    • 升级前备份现有配置
  • 依赖:
    • 首次启动自动下载HikariCP(5.1.0版),确保服务器联网或检查plugins/OllamaChat/libs目录
    • 依赖损坏时可删除libs文件夹强制重新下载
  • API集成:
    • 开发者可通过OllamaChatAPI集成,在plugin.yml添加softdepend: [OllamaChat]并参考API.md
  • 兼容性:
    • 保持与现有配置和数据库的向后兼容
  • 测试建议:
    • 测试数据库操作(如/ollamachat conversation new命令)
    • 检查服务器日志中的依赖加载和数据库错误

已知问题

  • HikariCP参数可能需要根据服务器负载手动调优

Файлы

OllamaChat-1.1.5.jar(55.23 KiB)
Основной
Скачать

Метаданные

Канал релиза

Release

Номер версии

1.1.5

Загрузчики

Bukkit
Paper
Purpur
Spigot

Версии игры

1.21–1.21.10

Загрузок

86

Дата публикации

31.07.2025

Загрузил

ID версии

Главная