mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-26 17:42:15 +00:00
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…
x
Reference in New Issue
Block a user