Skip to content

Commit

Permalink
Encourage log_errors in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
alexrudall committed Apr 29, 2024
1 parent 7018370 commit b447db4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ require "openai"
For a quick test you can pass your token directly to a new client:

```ruby
client = OpenAI::Client.new(access_token: "access_token_goes_here")
client = OpenAI::Client.new(
access_token: "access_token_goes_here",
log_errors: true # Highly recommended in development, so you can see what errors OpenAI is returning. Not recommend in production.
)
```

### With Config
Expand All @@ -110,8 +113,9 @@ For a more robust setup, you can configure the gem with your API keys, for examp

```ruby
OpenAI.configure do |config|
config.access_token = ENV.fetch("OPENAI_ACCESS_TOKEN")
config.organization_id = ENV.fetch("OPENAI_ORGANIZATION_ID") # Optional.
config.access_token = ENV.fetch("OPENAI_ACCESS_TOKEN")
config.organization_id = ENV.fetch("OPENAI_ORGANIZATION_ID") # Optional.
config.log_errors = true # Highly recommended in development, so you can see what errors OpenAI is returning. Not recommend in production.
end
```

Expand Down

0 comments on commit b447db4

Please sign in to comment.