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.
This commit is contained in:
@@ -10,7 +10,7 @@ While the primary goal is providing a somewhat more modular frontend for Ollama,
|
||||
simple examples are in the Display module where i gave it the ability to access python through docker and get the current date and time both with the [OllamaFunctionTool](https://server.4zellen.se:3000/Zacharias/chat_thing/src/branch/master/Core/src/main/java/me/zacharias/chat/ollama/OllamaFuntionTool.java) thru my Ollama framework
|
||||
|
||||
## API
|
||||
The documentation for the API is available at the gitea wiki under [API docs](https://server.4zellen.se:3000/Zacharias/chat_thing/wiki/API-Docs)
|
||||
The documentation for the API is available at the gitea wiki under [API docs](https://server.4zellen.se:3000/Chat_things/NeuroDock/wiki/API-Docs)
|
||||
|
||||
## How to run?
|
||||
To run you need to build the `launcher` module<br>
|
||||
@@ -19,7 +19,7 @@ This will put the `launcher-1.0-all.jar`(or similar, based on the version) in `.
|
||||
`$ java -jar launcher-1.0-all.jar`<br>
|
||||
you can use the `-h` argument to get a help message.
|
||||
```
|
||||
Launch options for AI_chat
|
||||
Launch options for NeuroChat:
|
||||
-h --help Provides this help message
|
||||
-s --server Starts the application as API server
|
||||
-p --port Provides the port number that the API server should use, defaults to 39075
|
||||
@@ -36,7 +36,7 @@ If you only want to build a specific module, you can use the same command as lis
|
||||
- Core: `$ ./gradlew :Core:shadowJar`
|
||||
- However, this one is kinda useless unless you want to directly implement the system into your application
|
||||
- MALAPITool: `$ ./gradlew :MALAPITool:shadowJar`
|
||||
- Please read MALAPITool [README.md](https://server.4zellen.se:3000/Chat_things/chat_thing/src/branch/master/MALAPITool/README.md)
|
||||
- Please read MALAPITool [README.md](https://server.4zellen.se:3000/Chat_things/NeuroDock/src/branch/master/MALAPITool/README.md)
|
||||
- Launcher: `$ ./gradlew :launcher:shadowJar`
|
||||
- Depends on `API`, `Display` and `Core`
|
||||
- This is the main module that runs the application and starts the API server
|
||||
Reference in New Issue
Block a user