
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
Список изменений
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.ymlunderdatabase.mysql.hikarifor tuning connection pool parameters (e.g.,maximum-pool-size,connection-timeout).
- Public API:
- Introduced
OllamaChatAPIinterface (com.ollamachat.api.OllamaChatAPI) for other plugins. - Supports sending AI queries, managing conversations, and accessing chat history programmatically with methods like
sendAIQuery,createConversation, andlistConversations. - Added API documentation in
API.mdfor developer integration.
- Introduced
Enhancements
- Database Management:
- Updated
DatabaseManagerto leverage HikariCP for MySQL connections, while preserving SQLite functionality.
- Updated
- Dependency Management:
- Updated
DependencyLoaderto include HikariCP (version 5.1.0) alongside MySQL and SQLite JDBC drivers, downloaded at runtime toplugins/OllamaChat/libs. - Maintained
compileOnlyinbuild.gradlefor non-Paper dependencies to minimize JAR size.
- Updated
- Configuration:
- Added
database.mysql.hikarisection toconfig.ymlwith default settings for connection pooling. - Improved
config.ymlcomments for clarity and ease of use.
- Added
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.ymlto include thedatabase.mysql.hikarisection if using MySQL. Default values are added automatically. - Backup existing
config.ymlbefore updating to avoid data loss.
- Update
- Dependencies:
- The plugin downloads HikariCP (version 5.1.0) automatically on first startup. Ensure server internet access or verify
HikariCP-5.1.0.jarinplugins/OllamaChat/libs. - Delete the
libsfolder to force re-download if dependencies are corrupted.
- The plugin downloads HikariCP (version 5.1.0) automatically on first startup. Ensure server internet access or verify
- API Integration:
- Developers can hook into
OllamaChatusingOllamaChatAPI. Addsoftdepend: [OllamaChat]toplugin.ymland refer toAPI.md.
- Developers can hook into
- 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.
- Test database operations (e.g.,
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.yml的database.mysql.hikari下可配置连接池参数(如maximum-pool-size、connection-timeout)
- 公共API:
- 新增
OllamaChatAPI接口(com.ollamachat.api.OllamaChatAPI) - 支持通过编程方式发送AI查询、管理会话和访问聊天记录(如
sendAIQuery、createConversation、listConversations等方法) - 开发者文档见
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配置段(默认值会自动生成) - 升级前备份现有配置
- 使用MySQL需更新
- 依赖:
- 首次启动自动下载HikariCP(5.1.0版),确保服务器联网或检查
plugins/OllamaChat/libs目录 - 依赖损坏时可删除
libs文件夹强制重新下载
- 首次启动自动下载HikariCP(5.1.0版),确保服务器联网或检查
- API集成:
- 开发者可通过
OllamaChatAPI集成,在plugin.yml添加softdepend: [OllamaChat]并参考API.md
- 开发者可通过
- 兼容性:
- 保持与现有配置和数据库的向后兼容
- 测试建议:
- 测试数据库操作(如
/ollamachat conversation new命令) - 检查服务器日志中的依赖加载和数据库错误
- 测试数据库操作(如
已知问题
- HikariCP参数可能需要根据服务器负载手动调优
Файлы
OllamaChat-1.1.5.jar(55.23 KiB)
ОсновнойМетаданные
Канал релиза
Release
Номер версии
1.1.5
Загрузчики
BukkitPaperPurpurSpigot
Версии игры
1.21–1.21.10
Загрузок
86
Дата публикации
31.07.2025
