Refactor stream handler and update test model usage

Simplified ConsoleOutputStreamHandler to print messages directly without substring logic. Updated WithAuth integration test to use the THINKING_MODEL ('gpt-oss:20b') instead of GENERAL_PURPOSE_MODEL ('gemma3:270m') for model pulling and generation.
This commit is contained in:
amithkoujalgi
2025-08-31 15:56:40 +05:30
parent c754bd11da
commit 6fa5c323b8
2 changed files with 4 additions and 7 deletions

View File

@@ -44,6 +44,7 @@ public class WithAuth {
private static final String BEARER_AUTH_TOKEN = "secret-token";
private static final String GENERAL_PURPOSE_MODEL = "gemma3:270m";
private static final String THINKING_MODEL = "gpt-oss:20b";
private static OllamaContainer ollama;
@@ -152,7 +153,7 @@ public class WithAuth {
throws OllamaBaseException, IOException, InterruptedException, URISyntaxException {
api.setBearerAuth(BEARER_AUTH_TOKEN);
api.pullModel(GENERAL_PURPOSE_MODEL);
api.pullModel(THINKING_MODEL);
String prompt = "The sun is shining brightly and is directly overhead at the zenith, casting my shadow over my foot, so it must be noon.";
@@ -169,7 +170,7 @@ public class WithAuth {
});
format.put("required", List.of("isNoon"));
OllamaResult result = api.generate(GENERAL_PURPOSE_MODEL, prompt, format);
OllamaResult result = api.generate(THINKING_MODEL, prompt, format);
assertNotNull(result);
assertNotNull(result.getResponse());