Open jxonly opened 1 year ago
I'm sorry, but everything is working normally for me. I fixed some issues recently, did you pull the new changes?
I'm sorry, but everything is working normally for me. I fixed some issues recently, did you pull the new changes?
i tried the latest code, it still not work. The reason for the problem may be that I used a proxy server to access this website address but in the codes i did not use proxy.
@jxonly you could add proxy servers like the following, but it may not work with websockets.
def init_session(self) -> Session:
session: Session = Session()
proxy_servers = {
'http': 'http://proxy.sample.com:8080',
'https': 'http://secureproxy.sample.com:8080',
}
session.proxies.update(proxy_servers)
uuid: str = str(uuid4())
session.get(url=f"https://www.perplexity.ai/search/{uuid}", headers=self.user_agent)
@jxonly you could add proxy servers like the following, but it may not work with websockets.
def init_session(self) -> Session: session: Session = Session() proxy_servers = { 'http': 'http://proxy.sample.com:8080', 'https': 'http://secureproxy.sample.com:8080', } session.proxies.update(proxy_servers) uuid: str = str(uuid4()) session.get(url=f"https://www.perplexity.ai/search/{uuid}", headers=self.user_agent)
Ho to make proxies work in websockets? Without exporting the proxy as environment variable?
i followed the codes:
perplexity = Perplexity.Perplexity() answer = perplexity.search("What is the meaning of life?") print(answer.json_answer_text["answer"]) but i get this problem. i can visit the perplexity.ai website and i think its not the network error.