Skip to content

Commit

Permalink
Merge pull request xtekky#2135 from repsac-by/update-perplexity-labs
Browse files Browse the repository at this point in the history
Update the models of `PerplexityLabs` provider
  • Loading branch information
xtekky authored Aug 5, 2024
2 parents a97710a + 3b97e69 commit d0e9f09
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions g4f/Provider/PerplexityLabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@
WS_URL = "wss://www.perplexity.ai/socket.io/"

class PerplexityLabs(AsyncGeneratorProvider, ProviderModelMixin):
url = "https://labs.perplexity.ai"
url = "https://labs.perplexity.ai"
working = True
default_model = "mixtral-8x7b-instruct"
models = [
"llama-3-sonar-large-32k-online", "llama-3-sonar-small-32k-online", "llama-3-sonar-large-32k-chat", "llama-3-sonar-small-32k-chat", "llama-3-8b-instruct", "llama-3-70b-instruct", "gemma-2-9b-it", "gemma-2-27b-it", "nemotron-4-340b-instruct", "mixtral-8x7b-instruct",
"llama-3.1-sonar-large-128k-online",
"llama-3.1-sonar-small-128k-online",
"llama-3.1-sonar-large-128k-chat",
"llama-3.1-sonar-small-128k-chat",
"llama-3.1-8b-instruct",
"llama-3.1-70b-instruct",
"gemma-2-9b-it",
"gemma-2-27b-it",
"nemotron-4-340b-instruct",
"mixtral-8x7b-instruct"
]

@classmethod
Expand Down Expand Up @@ -54,7 +63,7 @@ async def create_async_generator(
data=post_data
) as response:
await raise_for_status(response)
assert await response.text() == "OK"
assert await response.text() == "OK"
async with session.ws_connect(f"{WS_URL}?EIO=4&transport=websocket&sid={sid}", autoping=False) as ws:
await ws.send_str("2probe")
assert(await ws.receive_str() == "3probe")
Expand Down

0 comments on commit d0e9f09

Please sign in to comment.