Strvm / meta-ai-api

Llama 3 API (MetaAI Reverse Engineered)
158 stars 27 forks source link

Proxy issue [probably] #11

Closed themanyfaceddemon closed 2 months ago

themanyfaceddemon commented 2 months ago

Perhaps I made a mistake somewhere when creating a proxy. The following happens: With this code:

from meta_ai_api import MetaAI
import requests

proxy_ip = '157.25.92.74'
proxy_port = 3128

proxies = {
    'http': f'http://{proxy_ip}:{proxy_port}'
}

try:
    ai = MetaAI(proxy=proxies)
    response = ai.prompt(message="How to find out which mushrooms are edible?")
except ConnectionError as ce:
    print(f"CE: {ce}")
except TimeoutError as te:
    print(f"TE: {te}")
except Exception as err:
    print(f"ERR: {err}")

The program displays my current IP. Still, there was no need to try to write the connection proxy code myself. Or I don't understand something

Strvm commented 2 months ago

I think it might be due to the fact that we are doing HTTP(S) requests, so the session doesn't use http proxies

themanyfaceddemon commented 2 months ago

I'll take a look later. Probably in 30 hours.

themanyfaceddemon commented 2 months ago

In short, maybe I can't connect to the proxy simply because of the provider, or some other reason. I'll close issues. If I find a solution, I'll post it here

themanyfaceddemon commented 2 months ago

I found a solution to the problem https://www.reddit.com/r/VPN/comments/1c7xhrm/how_to_access_meta_ai_with_a_vpn/?rdt=46595

themanyfaceddemon commented 2 months ago

image The bottom line is to use proxies that come from the USA.