Skip to content

Commit

Permalink
refactor(gemini-client): rename and update initialization doc
Browse files Browse the repository at this point in the history
Renamed DarwinAnthropic to DarwinGemini and updated documentation for clarity on the Gemini API client initialization process.
  • Loading branch information
hanrw committed Jan 6, 2025
1 parent ec080fa commit bfbe5c1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 23 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.tddworks.gemini.api

import com.tddworks.gemini.api.textGeneration.api.Gemini
import com.tddworks.gemini.api.textGeneration.api.GeminiConfig
import com.tddworks.gemini.di.initGemini

/**
* A singleton object that initializes the Gemini configuration with the specified API key and base URL.
*/
object DarwinGemini {

/**
* Initializes the Gemini configuration with the specified API key and base URL.
*
* This function sets up the Gemini environment by creating a configuration using the provided
* API key and base URL, then initializing Gemini with this configuration.
*
* @param apiKey A lambda function that returns the API key as a string. Defaults to returning "CONFIG_API_KEY".
* @param baseUrl A lambda function that returns the base URL as a string. Defaults to returning `Gemini.BASE_URL`.
*
* @return The initialized Gemini configuration.
*/
fun gemini(
apiKey: () -> String = { "CONFIG_API_KEY" },
baseUrl: () -> String = { Gemini.BASE_URL },
) = initGemini(GeminiConfig(apiKey, baseUrl))
}

0 comments on commit bfbe5c1

Please sign in to comment.