Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ client = Anthropic::Client.new(
access_token: "access_token_goes_here",
anthropic_version: "2023-01-01", # Optional
request_timeout: 240 # Optional
log_errors = true # Optional
)
```

Expand All @@ -87,6 +88,7 @@ Anthropic.configure do |config|
config.access_token = ENV.fetch("ANTHROPIC_API_KEY")
config.anthropic_version = "2023-01-01" # Optional
config.request_timeout = 240 # Optional
config.log_errors = true # Optional
end
```

Expand Down
3 changes: 2 additions & 1 deletion lib/anthropic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def call(env)
class Configuration
attr_writer :access_token
attr_accessor :anthropic_version, :api_version, :extra_headers,
:request_timeout, :uri_base
:request_timeout, :uri_base, :log_errors

DEFAULT_API_VERSION = "v1".freeze
DEFAULT_ANTHROPIC_VERSION = "2023-06-01".freeze
Expand All @@ -39,6 +39,7 @@ def initialize
@access_token = nil
@api_version = DEFAULT_API_VERSION
@anthropic_version = DEFAULT_ANTHROPIC_VERSION
@log_errors = false
@uri_base = DEFAULT_URI_BASE
@request_timeout = DEFAULT_REQUEST_TIMEOUT
@extra_headers = {}
Expand Down
1 change: 1 addition & 0 deletions lib/anthropic/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Client
anthropic_version
api_version
uri_base
log_errors
request_timeout
extra_headers
].freeze
Expand Down