mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-11-05 02:50:51 +01:00
Remove modelKeepAliveTime property and related code
Eliminated the modelKeepAliveTime field from OllamaAPI and OllamaChatRequest, along with its usage in integration tests and configuration. This streamlines configuration and request handling by removing an unused or deprecated parameter.
This commit is contained in:
@@ -71,7 +71,6 @@ class OllamaAPIIntegrationTest {
|
||||
// ... (no javadoc needed for private setup logic)
|
||||
int requestTimeoutSeconds = 60;
|
||||
int numberOfRetriesForModelPull = 5;
|
||||
int modelKeepAliveTime = 0;
|
||||
|
||||
try {
|
||||
String useExternalOllamaHostEnv = System.getenv("USE_EXTERNAL_OLLAMA_HOST");
|
||||
@@ -99,7 +98,6 @@ class OllamaAPIIntegrationTest {
|
||||
Integer.parseInt(props.getProperty("REQUEST_TIMEOUT_SECONDS"));
|
||||
numberOfRetriesForModelPull =
|
||||
Integer.parseInt(props.getProperty("NUMBER_RETRIES_FOR_MODEL_PULL"));
|
||||
modelKeepAliveTime = Integer.parseInt(props.getProperty("MODEL_KEEP_ALIVE_TIME"));
|
||||
} else {
|
||||
useExternalOllamaHost = Boolean.parseBoolean(useExternalOllamaHostEnv);
|
||||
ollamaHost = ollamaHostEnv;
|
||||
@@ -136,7 +134,6 @@ class OllamaAPIIntegrationTest {
|
||||
}
|
||||
api.setRequestTimeoutSeconds(requestTimeoutSeconds);
|
||||
api.setNumberOfRetriesForModelPull(numberOfRetriesForModelPull);
|
||||
api.setModelKeepAliveTime(modelKeepAliveTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -146,7 +146,7 @@ public class TestChatRequestSerialization extends AbstractSerializationTest<Olla
|
||||
OllamaChatRequest req = builder.withKeepAlive(expectedKeepAlive).build();
|
||||
String jsonRequest = serialize(req);
|
||||
assertEquals(
|
||||
deserialize(jsonRequest, OllamaChatRequest.class).getKeepAlive(),
|
||||
expectedKeepAlive);
|
||||
expectedKeepAlive,
|
||||
deserialize(jsonRequest, OllamaChatRequest.class).getKeepAlive());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
USE_EXTERNAL_OLLAMA_HOST=true
|
||||
OLLAMA_HOST=http://192.168.29.229:11434/
|
||||
REQUEST_TIMEOUT_SECONDS=120
|
||||
NUMBER_RETRIES_FOR_MODEL_PULL=3
|
||||
MODEL_KEEP_ALIVE_TIME=0
|
||||
NUMBER_RETRIES_FOR_MODEL_PULL=3
|
||||
Reference in New Issue
Block a user