mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-06-28 18:42:16 +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",
|
"Content-Type" => "application/json",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connection_opts = { request: { write_timeout: 10, read_timeout: 10, open_timeout: 10 } }
|
||||||
|
|
||||||
response =
|
response =
|
||||||
Faraday.post(
|
Faraday.new(nil, connection_opts).post(
|
||||||
"https://api.openai.com/v1/chat/completions",
|
"https://api.openai.com/v1/chat/completions",
|
||||||
{ model: model, messages: content }.to_json,
|
{ model: model, messages: content }.to_json,
|
||||||
headers,
|
headers,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user