- Create .gitignore to exclude target and IDE files - Add application.yml for Quarkus configuration - Implement package-info.java for business logic, facade, data, and common packages - Define core classes for handling user actions, character states, and narrative suggestions - Set up Ollama API client for narrative generation and state updates - Include unit tests for greeting service and serialization of context
36 lines
955 B
Java
36 lines
955 B
Java
package de.neitzel.roleplay.fascade;
|
|
|
|
import jakarta.ws.rs.GET;
|
|
import jakarta.ws.rs.POST;
|
|
import jakarta.ws.rs.Path;
|
|
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;
|
|
|
|
/**
|
|
* Quarkus declarative REST client for the Ollama HTTP API.
|
|
* Configuration (base URL, timeouts) is read from
|
|
* {@code quarkus.rest-client.ollama-api.*} in {@code application.yml}.
|
|
*/
|
|
@RegisterRestClient(configKey = "ollama-api")
|
|
@Path("/api")
|
|
public interface OllamaApi {
|
|
|
|
/**
|
|
* Lists all locally installed models.
|
|
*
|
|
* @return the tags response containing model metadata
|
|
*/
|
|
@GET
|
|
@Path("/tags")
|
|
OllamaTagsResponse getTags();
|
|
|
|
/**
|
|
* Sends a chat completion request.
|
|
*
|
|
* @param request the chat request including model, messages, and optional format
|
|
* @return the chat response with the assistant's reply
|
|
*/
|
|
@POST
|
|
@Path("/chat")
|
|
OllamaChatResponse chat(OllamaChatRequest request);
|
|
}
|