Skip to content

Commit

Permalink
fix: Updated the function name iniOllama to initOllama for consis…
Browse files Browse the repository at this point in the history
…tency.

 - 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)
  • Loading branch information
hanrw committed Jun 9, 2024
1 parent 57438f3 commit 3966726
Showing 1 changed file with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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))
}

0 comments on commit 3966726

Please sign in to comment.