File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ require "cohere"
1212# Pry.start
1313
1414client = Cohere ::Client . new (
15- api_key : ENV [ 'COHERE_API_KEY' ]
15+ ENV [ 'COHERE_API_KEY' ]
1616)
1717
1818require "irb"
Original file line number Diff line number Diff line change @@ -8,8 +8,9 @@ class Client
88
99 ENDPOINT_URL = "https://api.cohere.ai/v1"
1010
11- def initialize ( api_key )
11+ def initialize ( api_key , timeout : nil )
1212 @api_key = api_key
13+ @timeout = timeout
1314 end
1415
1516 def chat (
@@ -181,7 +182,7 @@ def summarize(
181182
182183 # standard:disable Lint/DuplicateMethods
183184 def connection
184- @connection ||= Faraday . new ( url : ENDPOINT_URL ) do |faraday |
185+ @connection ||= Faraday . new ( url : ENDPOINT_URL , request : { timeout : @timeout } ) do |faraday |
185186 if api_key
186187 faraday . request :authorization , :Bearer , api_key
187188 end
You can’t perform that action at this time.
0 commit comments