Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, this works.

So my api key is valid. But something in chatblade or the python packages it depends on trashes the input I provide, and replaces it with an email address of mine. Sounds weird, but is apparently true.



Its not doing anything special that could "trash" the input. In fact no other env variables are read at all. So the fact that you are seeing your email, is a pretty strong indication that it is being set by you somewhere. Where else could it even get it from?

An other option is that you passed your email as a parameter mistakingly (which takes precedence over the env variable)

But the code is really pretty simple. https://github.com/npiv/chatblade/blob/4ce28739ca7ada1611029...


Found it! I need to set NETRC=/dev/null. It appears the request library is trying to grab auth info from .netrc, and in my case, picks the default entry. Why it is doing that despite an api key being provided is unclear.


The openapi library seems to use requests incorrectly.

> If no authentication method is given with the auth argument, Requests will attempt to get the authentication credentials for the URL’s hostname from the user’s netrc file. The netrc file overrides raw HTTP authentication headers set with headers.

Source: https://docs.python-requests.org/en/latest/user/authenticati...


I know, I took a look at the code.

I even replaced get_openai_key(params) with a hardcoded

  return "sk-redacted"
and still no luck. I guess the bug must be in the openai python package, but I cant find it either. However, rest assured I am not providing this email anywhere manually...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: