Closed medoror closed 6 months ago
Where is the code being called? Before you make any calls, you need to ensure that the :req
app has been started.
Here's another discussion of this happening - https://www.reddit.com/r/elixir/comments/1667o93/problem_on_a_simple_script_with_req/
It looks like you're making an outbound call with Req
during compilation of the lib/spam_prediction.ex file - this is unusual.
By chance, do you have code in that file outside of the defmodule
body, perhaps an example that makes an outbound call?
@knewter you are right here. I was attempting to invoke the instructor call at compile time. Closing!
Great library! I wanted to dig in more by first using the example. For some reason, taking the SpamPrediction example and adding it to my fork does not compile. There error looks like the following
I feel like I might be setting up my creds for openai incorrectly? Below is the file that I am using. Same everything but I had to do some work to configure the
:api_key
,http_options
, andapi_url
. Am I going about this the write way?) end
is_spam?.("Hello I am a Nigerian prince and I would like to send you money")
=> {:ok, %SpamPrediction{class: :spam, reason: "Nigerian prince email scam", score: 0.98}}