From 39667263202774f7ed6465cb535779be0e97d4ac Mon Sep 17 00:00:00 2001 From: slam Date: Sun, 9 Jun 2024 11:43:57 +0800 Subject: [PATCH] fix: Updated the function name `iniOllama` to `initOllama` for consistency. - java.io.FileNotFoundException: /Users/runner/work/openai-kotlin/openai-kotlin/ollama-client/ollama-client-darwin/build/classes/kotlin/macosArm64/main/klib/ollama-client-darwin.klib (No such file or directory) --- .../com/tddworks/ollama/api/DarwinOllama.kt | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 ollama-client/ollama-client-darwin/src/appleMain/kotlin/com/tddworks/ollama/api/DarwinOllama.kt diff --git a/ollama-client/ollama-client-darwin/src/appleMain/kotlin/com/tddworks/ollama/api/DarwinOllama.kt b/ollama-client/ollama-client-darwin/src/appleMain/kotlin/com/tddworks/ollama/api/DarwinOllama.kt new file mode 100644 index 0000000..17433d7 --- /dev/null +++ b/ollama-client/ollama-client-darwin/src/appleMain/kotlin/com/tddworks/ollama/api/DarwinOllama.kt @@ -0,0 +1,30 @@ +package com.tddworks.ollama.api + +import com.tddworks.ollama.di.initOllama + + +/** + * Creates an instance of Ollama with the specified configuration options. + * + * @param port a function that returns the port number for the Ollama instance, defaults to Ollama.PORT + * @param protocol a function that returns the protocol for the Ollama instance, defaults to Ollama.PROTOCOL + * @param baseUrl a function that returns the base URL for the Ollama instance, defaults to Ollama.BASE_URL + * @return an Ollama instance initialized with the provided configuration + */ +object DarwinOllama { + + /** + * Function to create an Ollama instance with the provided configuration. + * + * @param port function returning an integer representing the port, defaults to Ollama.PORT + * @param protocol function returning a string representing the protocol, defaults to Ollama.PROTOCOL + * @param baseUrl function returning a string representing the base URL, defaults to Ollama.BASE_URL + * @return an Ollama instance created with the provided configuration + */ + fun ollama( + port: () -> Int = { Ollama.PORT }, + protocol: () -> String = { Ollama.PROTOCOL }, + baseUrl: () -> String = { Ollama.BASE_URL }, + ): Ollama = + initOllama(OllamaConfig(baseUrl = baseUrl, port = port, protocol = protocol)) +} \ No newline at end of file