so I am using openai api which has a very long timeout of 2 minutes it works fine in my dev enviorment but in prod I see it breaking and I am not sure why
this is the relevent logic in my code
defp request(body, _opts) do
IO.puts("requesting")
response =
Finch.build(:post, "https://api.openai.com/v1/chat/completions", headers(), body)
|> Finch.request(AiAssistant.Finch, timeout: 120_000) #long wait time are expected source https://community.openai.com/t/slow-response-time-with-gpt-4/107104
IO.inspect(response, label: "Response")
Please use code formatting blocks ``` for code and errors, it helps with readability. If you aren’t sure about how that works I have edited your post to use them so just click “edit” and see how it looks.
Punctuation also helps with communication.
If you look at the docs on the function you are calling Finch — Finch v0.16.0:timeout isn’t an option, rather there :pool_timeout and :receive_timeout. You probably want :receive_timeout.
yes that ended up being the issue.
weirdly enough playing with just timeout on my local environment seems to have worked so it took me forever to find it.
idk why it appeared that way but in my local environment I could get requests that wait for a minute + which is way higher than the deafualt.
If i had to guess its a different Finch version in both which made this act out