Skip to content

Commit 50a421d

Browse files
committed
Add Helicone to README
1 parent 4a5f176 commit 50a421d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,21 +69,26 @@ Then you can create a client like this:
6969
client = OpenAI::Client.new
7070
```
7171

72-
#### Setting request timeout
72+
#### Custom timeout or base URI
7373

74-
The default timeout for any OpenAI request is 120 seconds. You can change that passing the `request_timeout` when initializing the client:
74+
The default timeout for any OpenAI request is 120 seconds. You can change that passing the `request_timeout` when initializing the client. You can also change the base URI used for all requests, eg. to use observability tools like [Helicone](https://docs.helicone.ai/quickstart/integrate-in-one-line-of-code):
7575

7676
```ruby
77-
client = OpenAI::Client.new(access_token: "access_token_goes_here", request_timeout: 25)
77+
client = OpenAI::Client.new(
78+
access_token: "access_token_goes_here",
79+
uri_base: "https://oai.hconeai.com",
80+
request_timeout: 240
81+
)
7882
```
7983

8084
or when configuring the gem:
8185

8286
```ruby
8387
OpenAI.configure do |config|
84-
config.access_token = ENV.fetch('OPENAI_ACCESS_TOKEN')
85-
config.organization_id = ENV.fetch('OPENAI_ORGANIZATION_ID') # Optional.
86-
config.request_timeout = 25 # Optional
88+
config.access_token = ENV.fetch("OPENAI_ACCESS_TOKEN")
89+
config.organization_id = ENV.fetch("OPENAI_ORGANIZATION_ID") # Optional
90+
config.uri_base = "https://oai.hconeai.com" # Optional
91+
config.request_timeout = 240 # Optional
8792
end
8893
```
8994

0 commit comments

Comments
 (0)