Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpcore.ProxyError: 407 Proxy Authentication Required #940

Open
Chihuahua12345 opened this issue May 8, 2024 · 0 comments
Open

httpcore.ProxyError: 407 Proxy Authentication Required #940

Chihuahua12345 opened this issue May 8, 2024 · 0 comments
Labels
question Further information is requested

Comments

@Chihuahua12345
Copy link

When I executed the sample code listed in the Quickstart, I encountered an error that said “httpcore.ProxyError: 407 Proxy Authentication Required.” I have entered the actual API key in “your-openai-key.”

Code Examples

from datasets import Dataset 
import os
from ragas import evaluate
from ragas.metrics import faithfulness, answer_correctness

os.environ["OPENAI_API_KEY"] = "your-openai-key"

data_samples = {
    'question': ['When was the first super bowl?', 'Who won the most super bowls?'],
    'answer': ['The first superbowl was held on Jan 15, 1967', 'The most super bowls have been won by The New England Patriots'],
    'contexts' : [['The First AFL–NFL World Championship Game was an American football game played on January 15, 1967, at the Los Angeles Memorial Coliseum in Los Angeles,'], 
    ['The Green Bay Packers...Green Bay, Wisconsin.','The Packers compete...Football Conference']],
    'ground_truth': ['The first superbowl was held on January 15, 1967', 'The New England Patriots have won the Super Bowl a record six times']
}

dataset = Dataset.from_dict(data_samples)

score = evaluate(dataset,metrics=[faithfulness,answer_correctness])
score.to_pandas()

Error trace

Evaluating:   0%|                                                                                | 0/4 [00:02<?, ?it/s]
Exception in thread Thread-7:
Traceback (most recent call last):
  File "[C:\Users\********\AppData\Local\Programs\Python\Python312\Lib\site-packages\httpx\_transports\default.py", line 69](file:///C:/Users/********/AppData/Local/Programs/Python/Python312/Lib/site-packages/httpx/_transports/default.py#line=68), in map_httpcore_exceptions
    yield
...
  File "[C:\Users\********\AppData\Local\Programs\Python\Python312\Lib\site-packages\httpcore\_sync\http_proxy.py", line 298](file:///C:/Users/********/AppData/Local/Programs/Python/Python312/Lib/site-packages/httpcore/_sync/http_proxy.py#line=297), in handle_request
    raise ProxyError(msg)
httpcore.ProxyError: 407 Proxy Authentication Required

The above exception was the direct cause of the following exception:

Infos
The proxy server settings have been completed as follows, and since the installation of Python libraries is possible, it is presumed that additional authentication information is required for API calls.
$env:HTTP_PROXY=“http://...:8080”
$env:HTTPS_PROXY=“http://...:8080”

Could you please advise on how to proceed?

@Chihuahua12345 Chihuahua12345 added the question Further information is requested label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant