Skip to content

Commit

Permalink
release: 0.1.4
Browse files Browse the repository at this point in the history
 - add docs
 - code clean
  • Loading branch information
hanrw committed Apr 20, 2024
1 parent d012c1a commit e014593
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ data class AnthropicConfig(
val apiKey: () -> String = { "CONFIG_API_KEY" },
val baseUrl: () -> String = { Anthropic.BASE_URL },
val anthropicVersion: () -> String = { Anthropic.ANTHROPIC_VERSION },
) : KoinComponent
) : KoinComponent


Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,41 @@ import com.tddworks.anthropic.api.messages.api.Messages
import com.tddworks.di.getInstance


/**
* The Anthropic API class encapsulates the necessary properties and methods to interact with the Anthropic API.
*
* @property apiKey the unique identifier for your Anthropic API account
* @property apiURL the base URL for making API requests to the Anthropic API
* @property anthropicVersion the version of the Anthropics library being used
*/
class AnthropicApi(
private val apiKey: String,
private val apiURL: String,
private val anthropicVersion: String,
) : Anthropic, Messages by getInstance() {
/**
* Gets the API key.
*
* @return The API key string.
*/
override fun apiKey(): String {
return apiKey
}

/**
* Returns the base URL for API requests.
*
* @return The base URL of the API
*/
override fun baseUrl(): String {
return apiURL
}

/**
* Returns the anthropic version string.
*
* @return The anthropic version string.
*/
override fun anthropicVersion(): String {
return anthropicVersion
}
Expand Down

0 comments on commit e014593

Please sign in to comment.