perplexityai 0.7.1__py3-none-any.whl → 0.7.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of perplexityai might be problematic. Click here for more details.

perplexity/_version.py CHANGED
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "perplexity"
4
- __version__ = "0.7.1" # x-release-please-version
4
+ __version__ = "0.7.2" # x-release-please-version
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: perplexityai
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: The official Python library for the perplexity API
5
5
  Project-URL: Homepage, https://github.com/ppl-ai/perplexity-py
6
6
  Project-URL: Repository, https://github.com/ppl-ai/perplexity-py
@@ -55,7 +55,46 @@ The full API of this library can be found in [api.md](https://github.com/ppl-ai/
55
55
  pip install perplexityai
56
56
  ```
57
57
 
58
- ## Usage
58
+ ## Search API
59
+
60
+ Get web search results:
61
+
62
+ ```python
63
+ import os
64
+ from perplexity import Perplexity
65
+
66
+ client = Perplexity(
67
+ api_key=os.environ.get("PERPLEXITY_API_KEY"), # This is the default and can be omitted
68
+ )
69
+
70
+ search = client.search.create(
71
+ query="latest AI developments 2024",
72
+ max_results=5
73
+ )
74
+
75
+ for result in search.results:
76
+ print(f"{result.title}: {result.url}")
77
+ ```
78
+
79
+ ## Content API
80
+
81
+ Extract and process content from URLs:
82
+
83
+ ```python
84
+ from perplexity import Perplexity
85
+
86
+ client = Perplexity()
87
+
88
+ content = client.content.create(
89
+ urls=["https://en.wikipedia.org/wiki/Perplexity_AI"]
90
+ )
91
+
92
+ for result in content.results:
93
+ print(f"Title: {result.title}")
94
+ print(f"Content: {result.content[:200]}...")
95
+ ```
96
+
97
+ ## Chat Completions
59
98
 
60
99
  The full API of this library can be found in [api.md](https://github.com/ppl-ai/perplexity-py/tree/main/api.md).
61
100
 
@@ -11,7 +11,7 @@ perplexity/_resource.py,sha256=Pgc8KNBsIc1ltJn94uhDcDl0-3n5RLbe3iC2AiiNRnE,1124
11
11
  perplexity/_response.py,sha256=bpqzmVGq6jnivoMkUgt3OI0Rh6xHd6BMcp5PHgSFPb0,28842
12
12
  perplexity/_streaming.py,sha256=SQ61v42gFmNiO57uMFUZMAuDlGE0n_EulkZcPgJXt4U,10116
13
13
  perplexity/_types.py,sha256=XZYv2_G7oQGhQkjI28-TFIMP_yZZV590TRuKAoLJ3wM,7300
14
- perplexity/_version.py,sha256=F10Cee1fz8d4T8eVbHBBkQImA5xccIl7FdC1_qWNTl4,162
14
+ perplexity/_version.py,sha256=oCzVPjhc9KFDwZvV-eMdvU4rN4E4B1hJvbngvkiB4Cw,162
15
15
  perplexity/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
16
16
  perplexity/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
17
17
  perplexity/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
@@ -59,7 +59,7 @@ perplexity/types/shared/search_result.py,sha256=pm4L1gWI9_8NtpI1kjdfXzoOpD0CDE4I
59
59
  perplexity/types/shared/usage_info.py,sha256=TGAReiJmZBjfXVxGsrKNaT7E0f5pi_D3GqB2qqjXOCc,458
60
60
  perplexity/types/shared_params/__init__.py,sha256=vOrN5p21OFWPGWV_y68OkZnQltAXa53y308Tg2Lmct4,140
61
61
  perplexity/types/shared_params/chat_message.py,sha256=haPdpCCjcOfLzcP25VeiVsSBuipz43co8HF_oFfWCf8,943
62
- perplexityai-0.7.1.dist-info/METADATA,sha256=Xwu5EPhiFgADDc3m0gdiqJ3Ytm8rqJZVmnPe3984U30,15261
63
- perplexityai-0.7.1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
64
- perplexityai-0.7.1.dist-info/licenses/LICENSE,sha256=hkCriG3MT4vBhhc0roAOsrCE7IEDr1ywVEMonVHGmAQ,11340
65
- perplexityai-0.7.1.dist-info/RECORD,,
62
+ perplexityai-0.7.2.dist-info/METADATA,sha256=_Stfu0IzHUXKErJAq6rGUqyYCS9XzmozW9BXT4-HqaM,15992
63
+ perplexityai-0.7.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
64
+ perplexityai-0.7.2.dist-info/licenses/LICENSE,sha256=hkCriG3MT4vBhhc0roAOsrCE7IEDr1ywVEMonVHGmAQ,11340
65
+ perplexityai-0.7.2.dist-info/RECORD,,