DEV: Use 10s timeout when using the completions API (#19)
This commit is contained in:
parent
54a1694637
commit
fea9041ee1
|
@ -9,8 +9,10 @@ module ::DiscourseAi
|
|||
"Content-Type" => "application/json",
|
||||
}
|
||||
|
||||
connection_opts = { request: { write_timeout: 10, read_timeout: 10, open_timeout: 10 } }
|
||||
|
||||
response =
|
||||
Faraday.post(
|
||||
Faraday.new(nil, connection_opts).post(
|
||||
"https://api.openai.com/v1/chat/completions",
|
||||
{ model: model, messages: content }.to_json,
|
||||
headers,
|
||||
|
|
Loading…
Reference in New Issue