mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-10-14 09:28:58 +02:00
Update Ollama host and clean up integration tests
Changed the remote Ollama host IP in Makefile and test setup to 192.168.29.229. Fixed a typo in a test method name and removed unused StringBuffer variables and related assertions from OllamaAPIIntegrationTest.
This commit is contained in:
parent
b1d3ee54a5
commit
a1b5756107
2
Makefile
2
Makefile
@ -33,7 +33,7 @@ integration-tests:
|
|||||||
|
|
||||||
integration-tests-remote:
|
integration-tests-remote:
|
||||||
@echo "\033[0;34mRunning integration tests (remote)...\033[0m"
|
@echo "\033[0;34mRunning integration tests (remote)...\033[0m"
|
||||||
@export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.223:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true
|
@export USE_EXTERNAL_OLLAMA_HOST=true && export OLLAMA_HOST=http://192.168.29.229:11434 && mvn clean verify -Pintegration-tests -Dgpg.skip=true
|
||||||
|
|
||||||
doxygen:
|
doxygen:
|
||||||
@echo "\033[0;34mGenerating documentation with Doxygen...\033[0m"
|
@echo "\033[0;34mGenerating documentation with Doxygen...\033[0m"
|
||||||
|
@ -61,6 +61,9 @@ class OllamaAPIIntegrationTest {
|
|||||||
Boolean.parseBoolean(System.getenv("USE_EXTERNAL_OLLAMA_HOST"));
|
Boolean.parseBoolean(System.getenv("USE_EXTERNAL_OLLAMA_HOST"));
|
||||||
String ollamaHost = System.getenv("OLLAMA_HOST");
|
String ollamaHost = System.getenv("OLLAMA_HOST");
|
||||||
|
|
||||||
|
useExternalOllamaHost = true;
|
||||||
|
ollamaHost ="http://192.168.29.229:11434/";
|
||||||
|
|
||||||
if (useExternalOllamaHost) {
|
if (useExternalOllamaHost) {
|
||||||
LOG.info("Using external Ollama host...");
|
LOG.info("Using external Ollama host...");
|
||||||
api = new OllamaAPI(ollamaHost);
|
api = new OllamaAPI(ollamaHost);
|
||||||
@ -201,7 +204,7 @@ class OllamaAPIIntegrationTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Order(6)
|
@Order(6)
|
||||||
void testGennerateModelWithDefaultOptions()
|
void testGenerateModelWithDefaultOptions()
|
||||||
throws OllamaBaseException, IOException, InterruptedException, URISyntaxException {
|
throws OllamaBaseException, IOException, InterruptedException, URISyntaxException {
|
||||||
api.pullModel(GENERAL_PURPOSE_MODEL);
|
api.pullModel(GENERAL_PURPOSE_MODEL);
|
||||||
boolean raw = false;
|
boolean raw = false;
|
||||||
@ -665,7 +668,6 @@ class OllamaAPIIntegrationTest {
|
|||||||
+ " Mona Lisa?")
|
+ " Mona Lisa?")
|
||||||
.build();
|
.build();
|
||||||
requestModel.setThink(false);
|
requestModel.setThink(false);
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
OllamaChatResult chatResult =
|
OllamaChatResult chatResult =
|
||||||
api.chat(
|
api.chat(
|
||||||
@ -681,7 +683,6 @@ class OllamaAPIIntegrationTest {
|
|||||||
assertNotNull(chatResult.getResponseModel());
|
assertNotNull(chatResult.getResponseModel());
|
||||||
assertNotNull(chatResult.getResponseModel().getMessage());
|
assertNotNull(chatResult.getResponseModel().getMessage());
|
||||||
assertNotNull(chatResult.getResponseModel().getMessage().getContent());
|
assertNotNull(chatResult.getResponseModel().getMessage().getContent());
|
||||||
assertEquals(sb.toString(), chatResult.getResponseModel().getMessage().getContent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -703,7 +704,6 @@ class OllamaAPIIntegrationTest {
|
|||||||
.withThinking(true)
|
.withThinking(true)
|
||||||
.withKeepAlive("0m")
|
.withKeepAlive("0m")
|
||||||
.build();
|
.build();
|
||||||
StringBuffer sb = new StringBuffer();
|
|
||||||
|
|
||||||
OllamaChatResult chatResult =
|
OllamaChatResult chatResult =
|
||||||
api.chat(
|
api.chat(
|
||||||
@ -720,10 +720,6 @@ class OllamaAPIIntegrationTest {
|
|||||||
assertNotNull(chatResult.getResponseModel());
|
assertNotNull(chatResult.getResponseModel());
|
||||||
assertNotNull(chatResult.getResponseModel().getMessage());
|
assertNotNull(chatResult.getResponseModel().getMessage());
|
||||||
assertNotNull(chatResult.getResponseModel().getMessage().getContent());
|
assertNotNull(chatResult.getResponseModel().getMessage().getContent());
|
||||||
assertEquals(
|
|
||||||
sb.toString(),
|
|
||||||
chatResult.getResponseModel().getMessage().getThinking()
|
|
||||||
+ chatResult.getResponseModel().getMessage().getContent());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user