Commit Graph

44 Commits

Author SHA1 Message Date
Zacharias 978cf8d7eb refactor(Core): decompose constructCore() into focused init methods
build / build (push) Has been cancelled
- Extracted Core#constructCore into: initDirectories(), ensureDir(String),
  initOllamaUrl(), initLogWriter(), rotateLogFile(), initScheduler(),
  initShutdownHook(), closeLogWriter(), saveMessages(),
  buildMessagesArray(), writeMessagesTo(File, JSONArray)
- Overloaded constructors for Core
- Cleaned up some Javadocs

Fixed error(AddArrayMemory)
- Line 51 used the wrong value

Updated minor version for(::Core)

Dev note: Long overdue — that generic init block was ugly and is finally
laid to rest.
2026-05-27 23:04:47 +02:00
Zacharias 931c274cd3 refactor: update CoreMemory to v2 and rename OllamaToolResponse
build / build (push) Has been cancelled
- Refactored `CoreMemory` to support versioning (v2) and dual-memory types: `MAPPED_MEMORY` (key-value) and `ARRAYED_MEMORY` (sequential).
- Added automatic migration logic for v1 memory files to v2.
- Introduced new memory tools: `AddArrayMemory`, `GetArrayMemory`, and `GetArrayedMemories`.
- Renamed `OllamaToolRespnce` to `OllamaToolResponse` and added `empty()` factory methods for better error handling.
- Updated multiple function tools (e.g., `GetMemoryFunction`, `GetMemoriesFunction`, `APITool`, `GetWikiPageText`) to use the new `OllamaToolResponse` and `Optional`-based memory retrieval.
- Improved null safety by adding `@NotNull` annotations to tool implementations.
2026-05-27 21:10:15 +02:00
Zacharias ac159c2498 Corrected the fact that
build / build (push) Has been cancelled
`OllamaPerameter.OllamaPerameterBuilder#addProperty(String, Type, String, boolean)` did not respect whether it's required or not
Corrected so `OllamaPerameter.OllamaPerameterBuilder#removeProperty(String)` also removes it from the required list
Corrected Javadocs
made OllamaPerameter.OllamaPerameterBuilder.Type#type a final
2026-05-27 20:20:27 +02:00
Zacharias 06cf1c766a Added a TODO for the memory package
build / build (push) Has been cancelled
2026-05-27 01:32:44 +02:00
Zacharias f6610777ae refactor: redesign plugin system and enhance message handling
build / build (push) Has been cancelled
- Move plugin and tool-related classes to a dedicated `Plugin-API` module.
- Introduce a new plugin lifecycle (`onInit`, `onEnable`, `onDisable`) and a more robust `Tool` API.
- Refactor `Core` to use `PrintAdvanceMessageHandler` for improved handling of assistant messages, tool responses, and errors.
- Rename `PluginLoader` to `Loader` and migrate it to `me.zacharias.chat.plugin.loader`.
- Update build configurations and Java toolchains across modules.
- Clean up obsolete plugin annotations and interfaces in the `Core` module.
2026-05-26 16:28:02 +02:00
Zacharias 339b176480 Updated README to add noting of maven dependency
build / build (push) Has been cancelled
2026-05-12 15:29:53 +02:00
Zacharias a33a37ec0a Updated OllamaFunctionTool.toString to reflect what the Ollama API actually wants
build / build (push) Has been cancelled
Added @NotNull annotation to OllamaFunctionTool.name and OllamaFunctionTool.parameters since the documentation reports as these being required

Made sure that OllamaFunctionTool.description is actually optional as the Ollama API docs define
2026-05-05 22:27:36 +02:00
Zacharias b1aa35e1b1 Updated depndencies for
build / build (push) Has been cancelled
- GradleAPI
- Launcher
- MALAPITool

Started finishing up the File handeling module in Core
- Added ReadFileTool.java which allowes to read files from this contained "file system"

modulized dependency for the API

Updated for Launcher.java to use class and method refrence to entry point to remove hard dependency

Added a @SafeVarargs to OllamaObject.java
made OllamaObject.OllamaObjectBuilder#addFileTools not throw IllegalArgumentException and instead add the tooling and return the builder

Added overloaded constructor OllamaToolErrorException#OllamaToolErrorException(String, Exception) to allow for forwarding of exceptions, although this is not recomended

PythonRunner
- Fixed bugs with it under Linux host(this MUST be refractord to support Windows and Mac hosts)
- Added a overwrite for default python print method to send prints over the external_tools socket to be put into output log for the runner
- Cleaned up some stuff
- Updated to properly refer to files
- Fixed cmd.sh generation
- Removed old "-c" addition to the command
- Removed old code related to how logs pulled from containers standerd output's
- Updated the generation of external_tools.py to respect pythons requirment of optinal arguments being after all required

Updated Tool#addTool to respect the standerd of spring boot's return model
2026-05-04 19:50:49 +02:00
Zacharias 7dfaffc862 Working on fixing the implementation of PythonRunner.java
build / build (push) Has been cancelled
added a global cache directory, not fully properly implemented, and dose not respect t.ex the FreeDesktop specifications for cache directories and files

OPS this is a partial commit! things might not add up on this commit.
2026-05-04 18:17:15 +02:00
Zacharias 96a6ed169e Extracted the external tool base for python runner
build / build (push) Has been cancelled
Fixed URL building in APITool.java.
Updated libraries for API, Launcher.
Started applying NotNull annotation to methods and arguments in Core.java.
Started handeling the big init block in Core.java.
Added overloaded constructor for Core.java and made Core.ollamaIP a variabled that's definible
Updated Tool.addTool return for 400 error.
2026-05-04 14:23:26 +02:00
Zacharias 943c8470a5 Honestly speaking... No clue what the updates are :/
build / build (push) Has been cancelled
2026-01-17 14:30:26 +01:00
Zacharias 4262dd68c6 Enhanced tool management in OllamaObject and added Maven publishing configuration.
build / build (push) Has been cancelled
- Updated `OllamaObject` to support tool registration with sources.
- Improved error handling and debug logging in multiple classes.
- Added Maven plugin and publication setup in `build.gradle`.
- Updated version to `1.3`.

Signed-off-by: Zacharias <zacharias@4zellen.se>
2025-08-18 20:01:42 +02:00
Zacharias 2cf0428d2a Added legal disclaimers about scraping.. mostly to make sure i dont get into too mutch trouble about things
build / build (push) Has been cancelled
2025-08-05 01:33:48 +02:00
Zacharias bbf3c645b0 Added README.md to GeniusAPI
build / build (push) Has been cancelled
2025-08-05 00:51:35 +02:00
Zacharias 4015d37657 Merge remote-tracking branch 'origin/master'
build / build (push) Has been cancelled
2025-08-05 00:43:19 +02:00
Zacharias 5886d164b4 Core.java
- Added a safe handle for if Core#logWriter is not initialized to prevent craching

GetLyrics.java
- Slowly modifying the http headers to avoid package due to catching this as a Scrapper
- Added so we skip extra calls if the song is cached
2025-08-05 00:38:58 +02:00
Zacharias ab72e1ff78 Update README.md
build / build (push) Successful in 3s
2025-07-28 22:15:37 +02:00
Zacharias db53028d1e Fixed an issue in the config
build / build (push) Successful in 9s
2025-07-16 01:03:02 +02:00
Zacharias bf5ae6dd3c And again.... 2025-07-16 00:31:04 +02:00
Zacharias fbf7c504b1 Testing again... *sigh* 2025-07-16 00:29:46 +02:00
Zacharias 8426bcac37 CI is confusing 2025-07-16 00:28:37 +02:00
Zacharias 5724a2342d Merge remote-tracking branch 'origin/master' 2025-07-16 00:12:55 +02:00
Zacharias 95ac78b2d2 Testing gitea act_runner 2025-07-16 00:11:56 +02:00
Zacharias 70e7e24aaa Update README.md
Fixed misspelling
2025-06-08 22:32:52 +02:00
Zacharias 57fc7f2533 Quick and dirty commit, due to heaste of this needing 2025-06-08 22:01:17 +02:00
Zacharias 840ad468e3 Added Genius API wrapper
for fetching song lyrics from Genius Database

# Disclaimer. This commit contains parts that are for educational purposes only!

FindSong:
- Uses Genius API to find the song queried

GetLyrics:
# Educational purposes only
- Scrapes Genius lyrics page for the Lyrics
2025-06-08 21:54:56 +02:00
Zacharias 796271443c Added Wikipedia API wrapper
GetWikiPegeText:
- Fetches a Wikipedia wiki page

WikipediaTool:
- The base for this module, Initialise a Wiki instance and add the Wikipedia API endpoints
2025-06-08 21:44:04 +02:00
Zacharias a602d30901 ... I have no excuse.. i forgot the MALAPITool's build.gradle.... 2025-05-28 20:24:08 +02:00
Zacharias 603b72f2d3 Started implementing jar-based(plugin) tool loading
Core#plugin:
- Plugin.java: Main framework for plugins
- OllamaTool.java: Used for annotation based loading of tools
- InjectPlugin.java: Annoataion for injecting the Plugin instance, used when annotation based loading is used
- PluginMetadata.java: metadata of the plugin, a class-reflection of plugin.json file within each plugin
- PluginLoadingException.java: Exception thrown when an error happens durring plugin loading
2025-05-28 01:11:07 +02:00
Zacharias 8e44c11385 feat(api): major refactor from TCP socket to HTTP REST via Spring Boot
This commit introduces a large-scale refactor that replaces the existing TCP-based API with a Spring Boot-powered HTTP REST architecture. Due to the size and scope of this change, only essential structural notes are included below.

High-level changes:
- Replaced TCP-based communication with RESTful endpoints
- Introduced Spring Boot for API handling and configuration
- Refactored internal core logic to support REST architecture

New/Updated API components:
- `APIApplication.java`: Main Spring Boot entry point
- `MessageController.java`: Handles LLM-related queries
- `ToolController.java`: Handles adding/removing tools
- `NewToolRequest.java` / `NewToolResponse.java`: Data models for tool addition
- `NewQueryResponseHook.java`: Webhook handler for LLM query results
- `WebhookError.java`: Model for reporting webhook errors
- `EnableIfNotDisplay.java`: Conditional configuration for TTY context
- Other supporting classes (e.g., `ToolArgument`, `ToolRequest`)

Core changes:
- `Core.java`: Removed deprecated `addFunctionTool`, added `removeTool`
- `LaunchOptions.java`: Added `notDisplay` flag for headless operation
- `OllamaObject.java`: Implements tool removal logic

Launcher/display changes:
- `Launcher.java`: Starts `APIApplication` if not in TTY mode
- `Display.java`: Integrates REST API contextually with TTY display

NOTE: Several classes are included but not yet fully utilized; these are placeholders for upcoming features (e.g., `MessageResponse`, `ToolRequest`).

BREAKING CHANGE: This refactors removes all TCP-based API code and replaces it with HTTP REST using Spring Boot. Any clients or modules depending on the old TCP interface will need to be updated.
2025-05-24 18:11:58 +02:00
Zacharias e7cedb7f08 Updated README.md
README.md
- Added `MALAPITool` and `Launcher` under `How to build? And general information` sub header
- Noted module dependencies for `API`, `Display`, `Launcher`
- Added some general information to modules, pending some better general information
- Added a specific sub header for clarity
- Added a link to `MALAPITool` README
2025-05-23 15:37:35 +02:00
Zacharias 5c3efa1376 Added My Anime List API wrapper
for documentation on MAL API check out the [API docs](https://myanimelist.net/apiconfig/references/api/v2)

Display:Display.java
- Switched the AI model to `qwen3:8b`
- some temporary test changes
- switched to using static references when supposed too

MALAPITool
- Module for handling the MAL API

MALAPITool:README.md
- Some general information about the tools

Started adding some base systems for finding API endpoints, will later be added to the API module for the ability to add plugins

.gitignore
- Added so all data folder are ignored. So submodules data folder from testing aren't added to git

Core:OllamaObject.java
- switched location of messages.json from the static location of `./cache/` to the dynamic location of `${Core.DATA_DIR}/messages.json`

Core:OllamaPerameter.java
- Added ENUM and ARRAY values. Incidentally also discover that Ollama supports more than just STRING, INT, and BOOLEAN ad parameters

Core:Core.java
- Added precluding day to the name of logging files, now using the format dd_HH-mm-ss
2025-05-23 15:24:58 +02:00
Zacharias 58c23c5897 Updated build.gradle to now include some Unit tests
Started implumenting Unit Tests
2025-03-25 23:34:07 +01:00
Zacharias 9b3c6c20b8 Well lot's in this
Some API modifications/additions

Starting the implementation of a local file system for the AI to use

Staring to try to migrate the ./cache, ./logs, ./messages, and ./pythonFiles to more appropiet locations depenidng on OS
2025-03-25 23:25:29 +01:00
Zacharias 01de196d82 Slight chages
Display
> Set both tools to INTERNAL

GetMemoryFunction
> Made so it gives a JSON

PythonRunner
> Fixed some value checkes
2025-03-14 20:01:38 +01:00
Zacharias 907f2e42e5 Added javadoc, and fixed spelling errors. 2025-03-14 14:32:38 +01:00
Zacharias e7e8b445bf Update README.md 2025-03-14 08:56:54 +01:00
Zacharias b8c33dd116 Added an example external_tools_example.py file 2025-02-21 22:40:39 +01:00
Zacharias d465a5684c Added a lot of things, but i guse bigest part is the external_tools.py generator 2025-02-21 22:38:32 +01:00
Zacharias da2cb69b1b Started work on API and remembrance fuction 2025-02-21 13:31:13 +01:00
Zacharias 9daae9211f Added LICENSE 2025-02-21 00:12:10 +01:00
Zacharias a0eec99f9f Added -h --help to launcher arguments
Added a detailed README
renamed the module `luancher` to `launcher`
2025-02-21 00:04:28 +01:00
Zacharias b892306c09 Basicly refactord the entire project into a modular nature 2025-02-20 23:28:24 +01:00
Zacharias 6935e938a3 Initial commit 2025-02-20 18:00:16 +01:00