diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-26 07:54:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 07:54:13 +0100 |
commit | feb83c168b0a57ecd8c511aa654209c5f40da30e (patch) | |
tree | 84ef9a576064b7480e339426d9966b17a3102cad /g4f/Provider/PerplexityLabs.py | |
parent | Merge pull request #1510 from hlohaus/sort (diff) | |
download | gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar.gz gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar.bz2 gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar.lz gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar.xz gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.tar.zst gpt4free-feb83c168b0a57ecd8c511aa654209c5f40da30e.zip |
Diffstat (limited to 'g4f/Provider/PerplexityLabs.py')
-rw-r--r-- | g4f/Provider/PerplexityLabs.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/g4f/Provider/PerplexityLabs.py b/g4f/Provider/PerplexityLabs.py index 5002b39f..a7b98f7c 100644 --- a/g4f/Provider/PerplexityLabs.py +++ b/g4f/Provider/PerplexityLabs.py @@ -14,12 +14,12 @@ WS_URL = "wss://labs-api.perplexity.ai/socket.io/" class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin): url = "https://labs.perplexity.ai" working = True + default_model = 'pplx-70b-online' models = [ 'pplx-7b-online', 'pplx-70b-online', 'pplx-7b-chat', 'pplx-70b-chat', 'mistral-7b-instruct', 'codellama-34b-instruct', 'llama-2-70b-chat', 'llava-7b-chat', 'mixtral-8x7b-instruct', 'mistral-medium', 'related' ] - default_model = 'pplx-70b-online' model_aliases = { "mistralai/Mistral-7B-Instruct-v0.1": "mistral-7b-instruct", "meta-llama/Llama-2-70b-chat-hf": "llama-2-70b-chat", @@ -52,8 +52,7 @@ class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin): async with ClientSession(headers=headers, connector=get_connector(connector, proxy)) as session: t = format(random.getrandbits(32), '08x') async with session.get( - f"{API_URL}?EIO=4&transport=polling&t={t}", - proxy=proxy + f"{API_URL}?EIO=4&transport=polling&t={t}" ) as response: text = await response.text() @@ -61,8 +60,7 @@ class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin): post_data = '40{"jwt":"anonymous-ask-user"}' async with session.post( f'{API_URL}?EIO=4&transport=polling&t={t}&sid={sid}', - data=post_data, - proxy=proxy + data=post_data ) as response: assert await response.text() == 'OK' |