forked from Mirror/ollama4j
Update documentation and refactor code to replace OllamaAPI with Ollama
- Replaced all instances of `OllamaAPI` with `Ollama` in documentation and code examples for consistency. - Enhanced the configuration for handling broken markdown links in Docusaurus. - Updated integration tests and example code snippets to reflect the new class structure.
This commit is contained in:
@@ -58,9 +58,9 @@ class OllamaIntegrationTest {
|
||||
private static final String TOOLS_MODEL = "mistral:7b";
|
||||
|
||||
/**
|
||||
* Initializes the OllamaAPI instance for integration tests.
|
||||
* Initializes the Ollama instance for integration tests.
|
||||
*
|
||||
* <p>This method sets up the OllamaAPI client, either using an external Ollama host (if
|
||||
* <p>This method sets up the Ollama client, either using an external Ollama host (if
|
||||
* environment variables are set) or by starting a Testcontainers-based Ollama instance. It also
|
||||
* configures request timeout and model pull retry settings.
|
||||
*/
|
||||
|
||||
@@ -88,7 +88,7 @@ public class WithAuth {
|
||||
+ "→ Proxy URL: {}",
|
||||
ollamaUrl,
|
||||
nginxUrl);
|
||||
LOG.info("OllamaAPI initialized with bearer auth token: {}", BEARER_AUTH_TOKEN);
|
||||
LOG.info("Ollama initialized with bearer auth token: {}", BEARER_AUTH_TOKEN);
|
||||
}
|
||||
|
||||
private static OllamaContainer createOllamaContainer() {
|
||||
@@ -155,9 +155,9 @@ public class WithAuth {
|
||||
try {
|
||||
assertTrue(
|
||||
api.ping(),
|
||||
"Expected OllamaAPI to successfully ping through NGINX with valid auth token.");
|
||||
"Expected Ollama to successfully ping through NGINX with valid auth token.");
|
||||
} catch (Exception e) {
|
||||
fail("Exception occurred while pinging OllamaAPI through NGINX: " + e.getMessage(), e);
|
||||
fail("Exception occurred while pinging Ollama through NGINX: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ public class WithAuth {
|
||||
try {
|
||||
assertFalse(
|
||||
api.ping(),
|
||||
"Expected OllamaAPI ping to fail through NGINX with an invalid auth token.");
|
||||
"Expected Ollama ping to fail through NGINX with an invalid auth token.");
|
||||
} catch (Exception e) {
|
||||
// If an exception is thrown, that's also an expected failure for a wrong token
|
||||
// (e.g., OllamaBaseException or IOException)
|
||||
|
||||
Reference in New Issue
Block a user