swarmauri_llm_perplexity 0.1.1.dev2__tar.gz → 0.11.0__tar.gz
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.
- swarmauri_llm_perplexity-0.11.0/NOTICE +7 -0
- swarmauri_llm_perplexity-0.11.0/PKG-INFO +461 -0
- swarmauri_llm_perplexity-0.11.0/README.md +428 -0
- swarmauri_llm_perplexity-0.11.0/pyproject.toml +146 -0
- swarmauri_llm_perplexity-0.1.1.dev2/PKG-INFO +0 -84
- swarmauri_llm_perplexity-0.1.1.dev2/README.md +0 -55
- swarmauri_llm_perplexity-0.1.1.dev2/pyproject.toml +0 -81
- {swarmauri_llm_perplexity-0.1.1.dev2 → swarmauri_llm_perplexity-0.11.0}/LICENSE +0 -0
- {swarmauri_llm_perplexity-0.1.1.dev2 → swarmauri_llm_perplexity-0.11.0}/swarmauri_llm_perplexity/PerplexityModel.py +0 -0
- {swarmauri_llm_perplexity-0.1.1.dev2 → swarmauri_llm_perplexity-0.11.0}/swarmauri_llm_perplexity/__init__.py +0 -0
|
@@ -0,0 +1,461 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_llm_perplexity
|
|
3
|
+
Version: 0.11.0
|
|
4
|
+
Summary: Provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: NOTICE
|
|
8
|
+
Keywords: swarmauri,llm,swarmauri llm,perplexity,perplexity api,sonar,reasoning model,chat completions,streaming llm,async llm,batch inference,citations,retrieval,large language model,generative ai,model
|
|
9
|
+
Author: Jacob Stewart
|
|
10
|
+
Author-email: jacob@swarmauri.com
|
|
11
|
+
Requires-Python: >=3.10,<3.15
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Requires-Dist: swarmauri_base
|
|
29
|
+
Requires-Dist: swarmauri_core
|
|
30
|
+
Requires-Dist: swarmauri_standard
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# swarmauri_llm_perplexity
|
|
34
|
+
|
|
35
|
+
<!-- readme-standards:begin branding -->
|
|
36
|
+
<p align="center"><a href="https://github.com/swarmauri/swarmauri-sdk"><img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri.brand.theme.svg" alt="Swarmauri SDK" width="300"></a></p>
|
|
37
|
+
<p align="center"><strong>swarmauri_llm_perplexity</strong></p>
|
|
38
|
+
<p align="center">Provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows.</p>
|
|
39
|
+
<p align="center">
|
|
40
|
+
<a href="https://pypi.org/project/swarmauri_llm_perplexity/"><img alt="pypi: swarmauri_llm_perplexity" src="https://img.shields.io/pypi/v/swarmauri_llm_perplexity?labelColor=1E293B&color=1D4ED8"></a>
|
|
41
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Source version: 0.11.0" src="https://img.shields.io/static/v1?label=Source%20version&message=0.11.0&labelColor=1E293B&color=4338CA"></a>
|
|
42
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Python: >=3.10,<3.15" src="https://img.shields.io/static/v1?label=Python&message=%3E%3D3.10%2C%3C3.15&labelColor=1E293B&color=0F766E"></a>
|
|
43
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Layer: community" src="https://img.shields.io/static/v1?label=Layer&message=community&labelColor=1E293B&color=6D28D9"></a>
|
|
44
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md#lifecycle-and-migration"><img alt="Lifecycle: active" src="https://img.shields.io/static/v1?label=Lifecycle&message=active&labelColor=1E293B&color=166534"></a>
|
|
45
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&message=Apache-2.0&labelColor=1E293B&color=86198F"></a>
|
|
46
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&message=attribution&labelColor=1E293B&color=86198F"></a>
|
|
47
|
+
</p>
|
|
48
|
+
<p align="center">
|
|
49
|
+
<a href="https://pypi.org/project/swarmauri_llm_perplexity/"><img alt="Monthly PyPI downloads: swarmauri_llm_perplexity" src="https://img.shields.io/pypi/dm/swarmauri_llm_perplexity?labelColor=1E293B&color=0E7490"></a>
|
|
50
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md"><img alt="README hits: swarmauri_llm_perplexity" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/50-community/swarmauri_llm_perplexity/README.md.svg?label=README%20hits&labelColor=1E293B&color=0E7490"></a>
|
|
51
|
+
</p>
|
|
52
|
+
<p align="center">
|
|
53
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&message=CI%20gate&labelColor=1E293B&color=1D4ED8"></a>
|
|
54
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/tests/unit/test_readme_sources.py"><img alt="Tests: example source" src="https://img.shields.io/static/v1?label=Tests&message=example%20source&labelColor=1E293B&color=0F766E"></a>
|
|
55
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&message=not%20certified&labelColor=1E293B&color=92400E"></a>
|
|
56
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&message=repository%20policy&labelColor=1E293B&color=4338CA"></a>
|
|
57
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="Evidence: source and CI" src="https://img.shields.io/static/v1?label=Evidence&message=source%20and%20CI&labelColor=1E293B&color=6D28D9"></a>
|
|
58
|
+
</p>
|
|
59
|
+
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
|
|
60
|
+
<!-- readme-standards:end branding -->
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Overview
|
|
65
|
+
|
|
66
|
+
### Summary
|
|
67
|
+
|
|
68
|
+
`swarmauri_llm_perplexity` provides the provider-specific Swarmauri import package for `PerplexityModel`. It wraps Perplexity's chat completion API so Swarmauri applications can use the tracked `sonar` and `r1-1776` model families through the standard `Conversation` workflow.
|
|
69
|
+
|
|
70
|
+
The runtime targets `https://api.perplexity.ai/chat/completions`, supports sync, async, streaming, and batch generation, and exposes controls such as `return_citations`, `top_p`, `top_k`, `presence_penalty`, and `frequency_penalty`.
|
|
71
|
+
|
|
72
|
+
### Why This Package
|
|
73
|
+
|
|
74
|
+
- Keep Perplexity-specific imports explicit in Swarmauri applications.
|
|
75
|
+
- Use Swarmauri `Conversation` objects against Perplexity's hosted chat completion API.
|
|
76
|
+
- Stream Perplexity responses while preserving the same component model used across other provider packages.
|
|
77
|
+
- Access Perplexity's current repo-tracked `sonar` and reasoning model families from a dedicated package boundary.
|
|
78
|
+
|
|
79
|
+
### When to Use
|
|
80
|
+
|
|
81
|
+
Choose `swarmauri_llm_perplexity` when your integration needs provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Match the imports below to your application boundary and install its declared dependencies before using the example.
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
- `PerplexityModel` import package for hosted Perplexity chat completion workflows.
|
|
86
|
+
- Sync, async, streaming, and batch generation support.
|
|
87
|
+
- Optional citation-return behavior for supported Perplexity responses.
|
|
88
|
+
- Usage metadata capture through Swarmauri `UsageData` when enabled.
|
|
89
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
90
|
+
|
|
91
|
+
### Non-Goals
|
|
92
|
+
|
|
93
|
+
`swarmauri_llm_perplexity` owns provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Getting Started
|
|
98
|
+
|
|
99
|
+
### Prerequisites
|
|
100
|
+
|
|
101
|
+
Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. Read the example’s inputs and service requirements before execution.
|
|
102
|
+
|
|
103
|
+
### Installation
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
uv add swarmauri_llm_perplexity
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
pip install swarmauri_llm_perplexity
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### uv
|
|
114
|
+
|
|
115
|
+
<!-- readme-standards:begin installation.uv -->
|
|
116
|
+
```bash
|
|
117
|
+
uv add swarmauri_llm_perplexity
|
|
118
|
+
```
|
|
119
|
+
<!-- readme-standards:end installation.uv -->
|
|
120
|
+
|
|
121
|
+
#### pip
|
|
122
|
+
|
|
123
|
+
<!-- readme-standards:begin installation.pip -->
|
|
124
|
+
```bash
|
|
125
|
+
python -m pip install swarmauri_llm_perplexity
|
|
126
|
+
```
|
|
127
|
+
<!-- readme-standards:end installation.pip -->
|
|
128
|
+
|
|
129
|
+
#### Poetry
|
|
130
|
+
|
|
131
|
+
<!-- readme-standards:begin installation.poetry -->
|
|
132
|
+
```bash
|
|
133
|
+
poetry add swarmauri_llm_perplexity
|
|
134
|
+
```
|
|
135
|
+
<!-- readme-standards:end installation.poetry -->
|
|
136
|
+
|
|
137
|
+
### Quick Start
|
|
138
|
+
|
|
139
|
+
#### Example
|
|
140
|
+
|
|
141
|
+
<!-- readme-standards:begin example.quick-start -->
|
|
142
|
+
Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/docs/readme/quick_start.py).
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
import os
|
|
146
|
+
|
|
147
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
148
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
149
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
150
|
+
|
|
151
|
+
conversation = Conversation()
|
|
152
|
+
conversation.add_message(
|
|
153
|
+
HumanMessage(content="Summarize Swarmauri in two sentences.")
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
model = PerplexityModel(
|
|
157
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
158
|
+
name="sonar",
|
|
159
|
+
)
|
|
160
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
161
|
+
|
|
162
|
+
print(result.get_last().content)
|
|
163
|
+
```
|
|
164
|
+
<!-- readme-standards:end example.quick-start -->
|
|
165
|
+
|
|
166
|
+
#### Expected Result
|
|
167
|
+
|
|
168
|
+
The example demonstrates the documented `swarmauri_llm_perplexity` source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Usage
|
|
173
|
+
|
|
174
|
+
### Common Workflows
|
|
175
|
+
|
|
176
|
+
<!-- readme-standards:begin example.usage -->
|
|
177
|
+
Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/docs/readme/usage.py).
|
|
178
|
+
|
|
179
|
+
```python
|
|
180
|
+
import os
|
|
181
|
+
|
|
182
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
183
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
184
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
185
|
+
|
|
186
|
+
conversation = Conversation()
|
|
187
|
+
conversation.add_message(
|
|
188
|
+
HumanMessage(content="Summarize Swarmauri in two sentences.")
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
model = PerplexityModel(
|
|
192
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
193
|
+
name="sonar",
|
|
194
|
+
)
|
|
195
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
196
|
+
|
|
197
|
+
print(result.get_last().content)
|
|
198
|
+
```
|
|
199
|
+
<!-- readme-standards:end example.usage -->
|
|
200
|
+
|
|
201
|
+
Set `PPLX_API_KEY` in your environment before creating the model.
|
|
202
|
+
|
|
203
|
+
**Chat Completion**
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
**Streaming**
|
|
207
|
+
|
|
208
|
+
```python
|
|
209
|
+
import os
|
|
210
|
+
|
|
211
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
212
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
213
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
214
|
+
|
|
215
|
+
conversation = Conversation()
|
|
216
|
+
conversation.add_message(HumanMessage(content="List three differences between hosted and local inference."))
|
|
217
|
+
|
|
218
|
+
model = PerplexityModel(
|
|
219
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
220
|
+
name="sonar-reasoning",
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
for token in model.stream(conversation=conversation, return_citations=True):
|
|
224
|
+
print(token, end="", flush=True)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**Async**
|
|
228
|
+
|
|
229
|
+
```python
|
|
230
|
+
import asyncio
|
|
231
|
+
import os
|
|
232
|
+
|
|
233
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
234
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
235
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
async def main() -> None:
|
|
239
|
+
conversation = Conversation()
|
|
240
|
+
conversation.add_message(HumanMessage(content="Explain retrieval-augmented generation briefly."))
|
|
241
|
+
|
|
242
|
+
model = PerplexityModel(
|
|
243
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
244
|
+
name="sonar-pro",
|
|
245
|
+
)
|
|
246
|
+
result = await model.apredict(conversation=conversation, return_citations=True)
|
|
247
|
+
print(result.get_last().content)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
# asyncio.run(main())
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- Use `sonar` for general-purpose hosted Perplexity chat workflows.
|
|
254
|
+
- Use `sonar-reasoning` or `sonar-reasoning-pro` when you want the reasoning-oriented family explicitly.
|
|
255
|
+
- Use `return_citations=True` when the downstream experience should expose provider citations alongside the generated response.
|
|
256
|
+
|
|
257
|
+
### Configuration
|
|
258
|
+
|
|
259
|
+
Configure `swarmauri_llm_perplexity` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
|
|
260
|
+
|
|
261
|
+
### Error Handling
|
|
262
|
+
|
|
263
|
+
The inspected `swarmauri_llm_perplexity` source does not establish a package-wide exception hierarchy. Preserve errors from its declared dependencies and validate inputs using the specific public contract in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py).
|
|
264
|
+
|
|
265
|
+
### Best Practices
|
|
266
|
+
|
|
267
|
+
- Keep `PPLX_API_KEY` in environment variables or a secret manager.
|
|
268
|
+
- Choose the Perplexity model family intentionally, especially when switching between search-style and reasoning-oriented variants.
|
|
269
|
+
- Do not set both `top_p` and `top_k` in the same request.
|
|
270
|
+
- Use citation-return mode only when the consuming application is prepared to surface or process citation metadata.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Package Boundary
|
|
275
|
+
|
|
276
|
+
### What It Owns
|
|
277
|
+
|
|
278
|
+
`swarmauri_llm_perplexity` is located in `community` and owns provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Source-declared APIs include `PerplexityModel`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) records its direct dependency boundary.
|
|
279
|
+
|
|
280
|
+
### Public API and Import Surfaces
|
|
281
|
+
|
|
282
|
+
Import namespace: `swarmauri_llm_perplexity`.
|
|
283
|
+
|
|
284
|
+
Source-declared exports or types: `PerplexityModel`.
|
|
285
|
+
|
|
286
|
+
Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
|
|
287
|
+
|
|
288
|
+
### Entry Points
|
|
289
|
+
|
|
290
|
+
<!-- readme-standards:begin entry-points -->
|
|
291
|
+
- `swarmauri.llms` → `PerplexityModel` → `swarmauri_llm_perplexity.PerplexityModel:PerplexityModel`
|
|
292
|
+
<!-- readme-standards:end entry-points -->
|
|
293
|
+
|
|
294
|
+
### Injected Dependencies
|
|
295
|
+
|
|
296
|
+
The direct installation dependencies of `swarmauri_llm_perplexity` are `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py).
|
|
297
|
+
|
|
298
|
+
### Protocol Consumers
|
|
299
|
+
|
|
300
|
+
No direct package-manifest dependency on `swarmauri_llm_perplexity` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
|
|
301
|
+
|
|
302
|
+
### Extensions
|
|
303
|
+
|
|
304
|
+
For `swarmauri_llm_perplexity`, use the source-declared public interfaces (`PerplexityModel`) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Operations and Readiness
|
|
309
|
+
|
|
310
|
+
### Operational Requirements
|
|
311
|
+
|
|
312
|
+
Operate `swarmauri_llm_perplexity` according to its actual entry points and collaborators. The dependency and Python requirements in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
|
|
313
|
+
|
|
314
|
+
### Health and Observability
|
|
315
|
+
|
|
316
|
+
This README does not establish a standalone health endpoint for `swarmauri_llm_perplexity`. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
|
|
317
|
+
|
|
318
|
+
### Security and Resource Limits
|
|
319
|
+
|
|
320
|
+
Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py). The `swarmauri_llm_perplexity` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
|
|
321
|
+
|
|
322
|
+
### Compatibility
|
|
323
|
+
|
|
324
|
+
This source version of `swarmauri_llm_perplexity` declares Python `>=3.10,<3.15`. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Verification
|
|
329
|
+
|
|
330
|
+
### Tests
|
|
331
|
+
|
|
332
|
+
Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_llm_perplexity` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
|
|
333
|
+
|
|
334
|
+
- [tests/unit/test_PerplexityModel_unit.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/tests/unit/test_PerplexityModel_unit.py)
|
|
335
|
+
|
|
336
|
+
The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
|
|
337
|
+
|
|
338
|
+
### Certification Status
|
|
339
|
+
|
|
340
|
+
No external certification is asserted for `swarmauri_llm_perplexity` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
|
|
341
|
+
|
|
342
|
+
### Evidence
|
|
343
|
+
|
|
344
|
+
The [README standards CI](https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml) records mechanical documentation results for its tested commit. The [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## FAQ
|
|
349
|
+
|
|
350
|
+
### Why
|
|
351
|
+
|
|
352
|
+
**What does swarmauri_llm_perplexity install?**
|
|
353
|
+
|
|
354
|
+
It installs `PerplexityModel` under `swarmauri.llms`.
|
|
355
|
+
|
|
356
|
+
**Which Perplexity model families are tracked?**
|
|
357
|
+
|
|
358
|
+
The current runtime allowlist includes `sonar-deep-research`, `sonar-reasoning-pro`, `sonar-reasoning`, `sonar-pro`, `sonar`, and `r1-1776`.
|
|
359
|
+
|
|
360
|
+
**Does the package support streaming?**
|
|
361
|
+
|
|
362
|
+
Yes. `PerplexityModel` supports `predict`, `apredict`, `stream`, `astream`, `batch`, and `abatch`.
|
|
363
|
+
|
|
364
|
+
**Can it request citations?**
|
|
365
|
+
|
|
366
|
+
Yes. The runtime exposes a `return_citations` option so the provider can include citation data when supported by the selected model.
|
|
367
|
+
|
|
368
|
+
**Can I set both top_p and top_k?**
|
|
369
|
+
|
|
370
|
+
No. The runtime rejects that combination and raises a `ValueError`.
|
|
371
|
+
|
|
372
|
+
### How
|
|
373
|
+
|
|
374
|
+
**How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_llm_perplexity`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) for the exact types and signatures involved.
|
|
375
|
+
|
|
376
|
+
### When
|
|
377
|
+
|
|
378
|
+
**Where should I verify current model and pricing details?**
|
|
379
|
+
|
|
380
|
+
Use the Perplexity section in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), which links to the current model cards and pricing documentation.
|
|
381
|
+
|
|
382
|
+
---
|
|
383
|
+
|
|
384
|
+
## Documentation and Related Packages
|
|
385
|
+
|
|
386
|
+
### More Documentation
|
|
387
|
+
|
|
388
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
389
|
+
- [Perplexity model cards](https://docs.perplexity.ai/guides/model-cards)
|
|
390
|
+
- [Perplexity pricing](https://docs.perplexity.ai/docs/getting-started/pricing)
|
|
391
|
+
|
|
392
|
+
### Related Packages
|
|
393
|
+
|
|
394
|
+
- [swarmauri_llm_openai](https://pypi.org/project/swarmauri_llm_openai/)
|
|
395
|
+
- [swarmauri_llm_mistral](https://pypi.org/project/swarmauri_llm_mistral/)
|
|
396
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
397
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
398
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
399
|
+
- [OpenAI TTS (Play.ht replacement)](../../40-standards/swarmauri_tts_openai/README.md)
|
|
400
|
+
|
|
401
|
+
### Project Links
|
|
402
|
+
|
|
403
|
+
<!-- readme-standards:begin project-links -->
|
|
404
|
+
- [pypi: swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
405
|
+
<!-- readme-standards:end project-links -->
|
|
406
|
+
|
|
407
|
+
---
|
|
408
|
+
|
|
409
|
+
## Contributing
|
|
410
|
+
|
|
411
|
+
### How to Contribute
|
|
412
|
+
|
|
413
|
+
Follow the [contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md) and include a focused example or regression for changes to `swarmauri_llm_perplexity`. Keep package behavior, its documented boundary, and its tests aligned.
|
|
414
|
+
|
|
415
|
+
### Development Setup
|
|
416
|
+
|
|
417
|
+
Work from the `pkgs/50-community/swarmauri_llm_perplexity` checkout. Synchronize its declared development environment with uv, then run the relevant package tests and `python -m pytest tests/unit/test_readme_sources.py`. The repository’s dedicated README job installs `readme-standards==0.1.3` without resolving unrelated runtime packages.
|
|
418
|
+
|
|
419
|
+
### Notes for Maintainers
|
|
420
|
+
|
|
421
|
+
**Foundational Swarmauri Packages**
|
|
422
|
+
|
|
423
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
424
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
425
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
426
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## Governance
|
|
431
|
+
|
|
432
|
+
### Ownership and Decision Making
|
|
433
|
+
|
|
434
|
+
Changes to `swarmauri_llm_perplexity` follow the maintainer review process of [swarmauri/swarmauri-sdk](https://github.com/swarmauri/swarmauri-sdk) and its contribution guide. Author attribution remains in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml); this README does not assign new publishing or administrative authority.
|
|
435
|
+
|
|
436
|
+
### Standards and Policies
|
|
437
|
+
|
|
438
|
+
`swarmauri_llm_perplexity` follows the versioned [package-guide-v1 outline](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md). All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.
|
|
439
|
+
|
|
440
|
+
### Lifecycle and Migration
|
|
441
|
+
|
|
442
|
+
The `swarmauri_llm_perplexity` source version is `0.11.0`.
|
|
443
|
+
|
|
444
|
+
---
|
|
445
|
+
|
|
446
|
+
## License and Attribution
|
|
447
|
+
|
|
448
|
+
### License
|
|
449
|
+
|
|
450
|
+
<!-- readme-standards:begin license -->
|
|
451
|
+
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/LICENSE).
|
|
452
|
+
<!-- readme-standards:end license -->
|
|
453
|
+
|
|
454
|
+
Apache-2.0
|
|
455
|
+
|
|
456
|
+
### Notices
|
|
457
|
+
|
|
458
|
+
<!-- readme-standards:begin notices -->
|
|
459
|
+
See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/NOTICE) for attribution.
|
|
460
|
+
<!-- readme-standards:end notices -->
|
|
461
|
+
|
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
# swarmauri_llm_perplexity
|
|
2
|
+
|
|
3
|
+
<!-- readme-standards:begin branding -->
|
|
4
|
+
<p align="center"><a href="https://github.com/swarmauri/swarmauri-sdk"><img src="https://raw.githubusercontent.com/swarmauri/swarmauri-sdk/master/assets/swarmauri.brand.theme.svg" alt="Swarmauri SDK" width="300"></a></p>
|
|
5
|
+
<p align="center"><strong>swarmauri_llm_perplexity</strong></p>
|
|
6
|
+
<p align="center">Provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows.</p>
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_llm_perplexity/"><img alt="pypi: swarmauri_llm_perplexity" src="https://img.shields.io/pypi/v/swarmauri_llm_perplexity?labelColor=1E293B&color=1D4ED8"></a>
|
|
9
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Source version: 0.11.0" src="https://img.shields.io/static/v1?label=Source%20version&message=0.11.0&labelColor=1E293B&color=4338CA"></a>
|
|
10
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Python: >=3.10,<3.15" src="https://img.shields.io/static/v1?label=Python&message=%3E%3D3.10%2C%3C3.15&labelColor=1E293B&color=0F766E"></a>
|
|
11
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml"><img alt="Layer: community" src="https://img.shields.io/static/v1?label=Layer&message=community&labelColor=1E293B&color=6D28D9"></a>
|
|
12
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md#lifecycle-and-migration"><img alt="Lifecycle: active" src="https://img.shields.io/static/v1?label=Lifecycle&message=active&labelColor=1E293B&color=166534"></a>
|
|
13
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/static/v1?label=License&message=Apache-2.0&labelColor=1E293B&color=86198F"></a>
|
|
14
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/static/v1?label=Notice&message=attribution&labelColor=1E293B&color=86198F"></a>
|
|
15
|
+
</p>
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://pypi.org/project/swarmauri_llm_perplexity/"><img alt="Monthly PyPI downloads: swarmauri_llm_perplexity" src="https://img.shields.io/pypi/dm/swarmauri_llm_perplexity?labelColor=1E293B&color=0E7490"></a>
|
|
18
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md"><img alt="README hits: swarmauri_llm_perplexity" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/pkgs/50-community/swarmauri_llm_perplexity/README.md.svg?label=README%20hits&labelColor=1E293B&color=0E7490"></a>
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center">
|
|
21
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="README standards: CI gate" src="https://img.shields.io/static/v1?label=README%20standards&message=CI%20gate&labelColor=1E293B&color=1D4ED8"></a>
|
|
22
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/tests/unit/test_readme_sources.py"><img alt="Tests: example source" src="https://img.shields.io/static/v1?label=Tests&message=example%20source&labelColor=1E293B&color=0F766E"></a>
|
|
23
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md#certification-status"><img alt="Certification: not certified" src="https://img.shields.io/static/v1?label=Certification&message=not%20certified&labelColor=1E293B&color=92400E"></a>
|
|
24
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"><img alt="Governance: repository policy" src="https://img.shields.io/static/v1?label=Governance&message=repository%20policy&labelColor=1E293B&color=4338CA"></a>
|
|
25
|
+
<a href="https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"><img alt="Evidence: source and CI" src="https://img.shields.io/static/v1?label=Evidence&message=source%20and%20CI&labelColor=1E293B&color=6D28D9"></a>
|
|
26
|
+
</p>
|
|
27
|
+
<p align="center"><a href="#overview">Overview</a> · <a href="#installation">Installation</a> · <a href="#quick-start">Quick Start</a> · <a href="#usage">Usage</a> · <a href="#public-api-and-import-surfaces">API</a> · <a href="#contributing">Contributing</a> · <a href="#governance">Governance</a> · <a href="#license">License</a></p>
|
|
28
|
+
<!-- readme-standards:end branding -->
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
### Summary
|
|
35
|
+
|
|
36
|
+
`swarmauri_llm_perplexity` provides the provider-specific Swarmauri import package for `PerplexityModel`. It wraps Perplexity's chat completion API so Swarmauri applications can use the tracked `sonar` and `r1-1776` model families through the standard `Conversation` workflow.
|
|
37
|
+
|
|
38
|
+
The runtime targets `https://api.perplexity.ai/chat/completions`, supports sync, async, streaming, and batch generation, and exposes controls such as `return_citations`, `top_p`, `top_k`, `presence_penalty`, and `frequency_penalty`.
|
|
39
|
+
|
|
40
|
+
### Why This Package
|
|
41
|
+
|
|
42
|
+
- Keep Perplexity-specific imports explicit in Swarmauri applications.
|
|
43
|
+
- Use Swarmauri `Conversation` objects against Perplexity's hosted chat completion API.
|
|
44
|
+
- Stream Perplexity responses while preserving the same component model used across other provider packages.
|
|
45
|
+
- Access Perplexity's current repo-tracked `sonar` and reasoning model families from a dedicated package boundary.
|
|
46
|
+
|
|
47
|
+
### When to Use
|
|
48
|
+
|
|
49
|
+
Choose `swarmauri_llm_perplexity` when your integration needs provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Match the imports below to your application boundary and install its declared dependencies before using the example.
|
|
50
|
+
|
|
51
|
+
### Features
|
|
52
|
+
|
|
53
|
+
- `PerplexityModel` import package for hosted Perplexity chat completion workflows.
|
|
54
|
+
- Sync, async, streaming, and batch generation support.
|
|
55
|
+
- Optional citation-return behavior for supported Perplexity responses.
|
|
56
|
+
- Usage metadata capture through Swarmauri `UsageData` when enabled.
|
|
57
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
58
|
+
|
|
59
|
+
### Non-Goals
|
|
60
|
+
|
|
61
|
+
`swarmauri_llm_perplexity` owns provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Its imports do not by themselves configure credentials, deploy a service, or certify the behavior of its consumers. Dependencies and neighboring packages retain their own documented responsibilities.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Getting Started
|
|
66
|
+
|
|
67
|
+
### Prerequisites
|
|
68
|
+
|
|
69
|
+
Python `>=3.10,<3.15` is required. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) declares runtime dependencies including `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. Read the example’s inputs and service requirements before execution.
|
|
70
|
+
|
|
71
|
+
### Installation
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
uv add swarmauri_llm_perplexity
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install swarmauri_llm_perplexity
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
#### uv
|
|
82
|
+
|
|
83
|
+
<!-- readme-standards:begin installation.uv -->
|
|
84
|
+
```bash
|
|
85
|
+
uv add swarmauri_llm_perplexity
|
|
86
|
+
```
|
|
87
|
+
<!-- readme-standards:end installation.uv -->
|
|
88
|
+
|
|
89
|
+
#### pip
|
|
90
|
+
|
|
91
|
+
<!-- readme-standards:begin installation.pip -->
|
|
92
|
+
```bash
|
|
93
|
+
python -m pip install swarmauri_llm_perplexity
|
|
94
|
+
```
|
|
95
|
+
<!-- readme-standards:end installation.pip -->
|
|
96
|
+
|
|
97
|
+
#### Poetry
|
|
98
|
+
|
|
99
|
+
<!-- readme-standards:begin installation.poetry -->
|
|
100
|
+
```bash
|
|
101
|
+
poetry add swarmauri_llm_perplexity
|
|
102
|
+
```
|
|
103
|
+
<!-- readme-standards:end installation.poetry -->
|
|
104
|
+
|
|
105
|
+
### Quick Start
|
|
106
|
+
|
|
107
|
+
#### Example
|
|
108
|
+
|
|
109
|
+
<!-- readme-standards:begin example.quick-start -->
|
|
110
|
+
Source: [docs/readme/quick_start.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/docs/readme/quick_start.py).
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import os
|
|
114
|
+
|
|
115
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
116
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
117
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
118
|
+
|
|
119
|
+
conversation = Conversation()
|
|
120
|
+
conversation.add_message(
|
|
121
|
+
HumanMessage(content="Summarize Swarmauri in two sentences.")
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
model = PerplexityModel(
|
|
125
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
126
|
+
name="sonar",
|
|
127
|
+
)
|
|
128
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
129
|
+
|
|
130
|
+
print(result.get_last().content)
|
|
131
|
+
```
|
|
132
|
+
<!-- readme-standards:end example.quick-start -->
|
|
133
|
+
|
|
134
|
+
#### Expected Result
|
|
135
|
+
|
|
136
|
+
The example demonstrates the documented `swarmauri_llm_perplexity` source boundary or workflow. Complete its required configuration first. README CI checks the maintained source’s syntax and declarations; it does not claim that external services or the application workflow were exercised.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## Usage
|
|
141
|
+
|
|
142
|
+
### Common Workflows
|
|
143
|
+
|
|
144
|
+
<!-- readme-standards:begin example.usage -->
|
|
145
|
+
Source: [docs/readme/usage.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/docs/readme/usage.py).
|
|
146
|
+
|
|
147
|
+
```python
|
|
148
|
+
import os
|
|
149
|
+
|
|
150
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
151
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
152
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
153
|
+
|
|
154
|
+
conversation = Conversation()
|
|
155
|
+
conversation.add_message(
|
|
156
|
+
HumanMessage(content="Summarize Swarmauri in two sentences.")
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
model = PerplexityModel(
|
|
160
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
161
|
+
name="sonar",
|
|
162
|
+
)
|
|
163
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
164
|
+
|
|
165
|
+
print(result.get_last().content)
|
|
166
|
+
```
|
|
167
|
+
<!-- readme-standards:end example.usage -->
|
|
168
|
+
|
|
169
|
+
Set `PPLX_API_KEY` in your environment before creating the model.
|
|
170
|
+
|
|
171
|
+
**Chat Completion**
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
**Streaming**
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
import os
|
|
178
|
+
|
|
179
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
180
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
181
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
182
|
+
|
|
183
|
+
conversation = Conversation()
|
|
184
|
+
conversation.add_message(HumanMessage(content="List three differences between hosted and local inference."))
|
|
185
|
+
|
|
186
|
+
model = PerplexityModel(
|
|
187
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
188
|
+
name="sonar-reasoning",
|
|
189
|
+
)
|
|
190
|
+
|
|
191
|
+
for token in model.stream(conversation=conversation, return_citations=True):
|
|
192
|
+
print(token, end="", flush=True)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Async**
|
|
196
|
+
|
|
197
|
+
```python
|
|
198
|
+
import asyncio
|
|
199
|
+
import os
|
|
200
|
+
|
|
201
|
+
from swarmauri_llm_perplexity import PerplexityModel
|
|
202
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
203
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
async def main() -> None:
|
|
207
|
+
conversation = Conversation()
|
|
208
|
+
conversation.add_message(HumanMessage(content="Explain retrieval-augmented generation briefly."))
|
|
209
|
+
|
|
210
|
+
model = PerplexityModel(
|
|
211
|
+
api_key=os.environ["PPLX_API_KEY"],
|
|
212
|
+
name="sonar-pro",
|
|
213
|
+
)
|
|
214
|
+
result = await model.apredict(conversation=conversation, return_citations=True)
|
|
215
|
+
print(result.get_last().content)
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
# asyncio.run(main())
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
- Use `sonar` for general-purpose hosted Perplexity chat workflows.
|
|
222
|
+
- Use `sonar-reasoning` or `sonar-reasoning-pro` when you want the reasoning-oriented family explicitly.
|
|
223
|
+
- Use `return_citations=True` when the downstream experience should expose provider citations alongside the generated response.
|
|
224
|
+
|
|
225
|
+
### Configuration
|
|
226
|
+
|
|
227
|
+
Configure `swarmauri_llm_perplexity` through the APIs in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py); its [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) describes installation requirements, not an implicit service configuration. No additional package-global configuration contract is inferred from dependencies.
|
|
228
|
+
|
|
229
|
+
### Error Handling
|
|
230
|
+
|
|
231
|
+
The inspected `swarmauri_llm_perplexity` source does not establish a package-wide exception hierarchy. Preserve errors from its declared dependencies and validate inputs using the specific public contract in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py).
|
|
232
|
+
|
|
233
|
+
### Best Practices
|
|
234
|
+
|
|
235
|
+
- Keep `PPLX_API_KEY` in environment variables or a secret manager.
|
|
236
|
+
- Choose the Perplexity model family intentionally, especially when switching between search-style and reasoning-oriented variants.
|
|
237
|
+
- Do not set both `top_p` and `top_k` in the same request.
|
|
238
|
+
- Use citation-return mode only when the consuming application is prepared to surface or process citation metadata.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Package Boundary
|
|
243
|
+
|
|
244
|
+
### What It Owns
|
|
245
|
+
|
|
246
|
+
`swarmauri_llm_perplexity` is located in `community` and owns provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows. Source-declared APIs include `PerplexityModel`. The [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) records its direct dependency boundary.
|
|
247
|
+
|
|
248
|
+
### Public API and Import Surfaces
|
|
249
|
+
|
|
250
|
+
Import namespace: `swarmauri_llm_perplexity`.
|
|
251
|
+
|
|
252
|
+
Source-declared exports or types: `PerplexityModel`.
|
|
253
|
+
|
|
254
|
+
Inspect [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) for exact signatures; this inventory does not designate every internal module as stable.
|
|
255
|
+
|
|
256
|
+
### Entry Points
|
|
257
|
+
|
|
258
|
+
<!-- readme-standards:begin entry-points -->
|
|
259
|
+
- `swarmauri.llms` → `PerplexityModel` → `swarmauri_llm_perplexity.PerplexityModel:PerplexityModel`
|
|
260
|
+
<!-- readme-standards:end entry-points -->
|
|
261
|
+
|
|
262
|
+
### Injected Dependencies
|
|
263
|
+
|
|
264
|
+
The direct installation dependencies of `swarmauri_llm_perplexity` are `swarmauri-core`, `swarmauri-base`, `swarmauri-standard`. These declarations do not imply automatic provider selection. Pass collaborators through the explicit constructors or call signatures in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py).
|
|
265
|
+
|
|
266
|
+
### Protocol Consumers
|
|
267
|
+
|
|
268
|
+
No direct package-manifest dependency on `swarmauri_llm_perplexity` was found in the audited three-repository inventory. External consumers may still use its documented imports or commands.
|
|
269
|
+
|
|
270
|
+
### Extensions
|
|
271
|
+
|
|
272
|
+
For `swarmauri_llm_perplexity`, use the source-declared public interfaces (`PerplexityModel`) when composing or extending behavior. Its entry-point section below is authoritative for registered plugins; no additional extension loader is inferred from the package name.
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## Operations and Readiness
|
|
277
|
+
|
|
278
|
+
### Operational Requirements
|
|
279
|
+
|
|
280
|
+
Operate `swarmauri_llm_perplexity` according to its actual entry points and collaborators. The dependency and Python requirements in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml) are prerequisites; deployment topology, credentials, and readiness remain the responsibility of the consuming application unless explicitly documented above.
|
|
281
|
+
|
|
282
|
+
### Health and Observability
|
|
283
|
+
|
|
284
|
+
This README does not establish a standalone health endpoint for `swarmauri_llm_perplexity`. Observe the concrete caller’s results, exceptions, and existing test reports. An application that embeds this package must define its own health and telemetry contract.
|
|
285
|
+
|
|
286
|
+
### Security and Resource Limits
|
|
287
|
+
|
|
288
|
+
Apply the input, credential, and resource constraints implemented in [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py). The `swarmauri_llm_perplexity` README gate is a documentation check, not a security review or a substitute for the implementation’s limits and caller authorization.
|
|
289
|
+
|
|
290
|
+
### Compatibility
|
|
291
|
+
|
|
292
|
+
This source version of `swarmauri_llm_perplexity` declares Python `>=3.10,<3.15`. Consult its dependency constraints before upgrading. Source-version and registry-version badges have separate meanings; this migration makes no additional platform or interoperability certification claim.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Verification
|
|
297
|
+
|
|
298
|
+
### Tests
|
|
299
|
+
|
|
300
|
+
Run `python -m pytest tests/unit/test_readme_sources.py` from the `swarmauri_llm_perplexity` package directory for the maintained example source checks (Python compilation and non-Python file presence). Existing package tests include:
|
|
301
|
+
|
|
302
|
+
- [tests/unit/test_PerplexityModel_unit.py](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/tests/unit/test_PerplexityModel_unit.py)
|
|
303
|
+
|
|
304
|
+
The repository README gate also checks the required heading tree, metadata, managed fragments, and referenced files.
|
|
305
|
+
|
|
306
|
+
### Certification Status
|
|
307
|
+
|
|
308
|
+
No external certification is asserted for `swarmauri_llm_perplexity` by this documentation migration. README conformance, example syntax, runtime tests, and protocol or security certification are distinct evidence scopes.
|
|
309
|
+
|
|
310
|
+
### Evidence
|
|
311
|
+
|
|
312
|
+
The [README standards CI](https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml) records mechanical documentation results for its tested commit. The [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) and example sources support the package-boundary description; external runtime behavior requires its own test evidence.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## FAQ
|
|
317
|
+
|
|
318
|
+
### Why
|
|
319
|
+
|
|
320
|
+
**What does swarmauri_llm_perplexity install?**
|
|
321
|
+
|
|
322
|
+
It installs `PerplexityModel` under `swarmauri.llms`.
|
|
323
|
+
|
|
324
|
+
**Which Perplexity model families are tracked?**
|
|
325
|
+
|
|
326
|
+
The current runtime allowlist includes `sonar-deep-research`, `sonar-reasoning-pro`, `sonar-reasoning`, `sonar-pro`, `sonar`, and `r1-1776`.
|
|
327
|
+
|
|
328
|
+
**Does the package support streaming?**
|
|
329
|
+
|
|
330
|
+
Yes. `PerplexityModel` supports `predict`, `apredict`, `stream`, `astream`, `batch`, and `abatch`.
|
|
331
|
+
|
|
332
|
+
**Can it request citations?**
|
|
333
|
+
|
|
334
|
+
Yes. The runtime exposes a `return_citations` option so the provider can include citation data when supported by the selected model.
|
|
335
|
+
|
|
336
|
+
**Can I set both top_p and top_k?**
|
|
337
|
+
|
|
338
|
+
No. The runtime rejects that combination and raises a `ValueError`.
|
|
339
|
+
|
|
340
|
+
### How
|
|
341
|
+
|
|
342
|
+
**How do I start?** Install or synchronize the environment under Getting Started, follow the maintained example for `swarmauri_llm_perplexity`, and consult [package source](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/swarmauri_llm_perplexity/__init__.py) for the exact types and signatures involved.
|
|
343
|
+
|
|
344
|
+
### When
|
|
345
|
+
|
|
346
|
+
**Where should I verify current model and pricing details?**
|
|
347
|
+
|
|
348
|
+
Use the Perplexity section in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), which links to the current model cards and pricing documentation.
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
|
|
352
|
+
## Documentation and Related Packages
|
|
353
|
+
|
|
354
|
+
### More Documentation
|
|
355
|
+
|
|
356
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
357
|
+
- [Perplexity model cards](https://docs.perplexity.ai/guides/model-cards)
|
|
358
|
+
- [Perplexity pricing](https://docs.perplexity.ai/docs/getting-started/pricing)
|
|
359
|
+
|
|
360
|
+
### Related Packages
|
|
361
|
+
|
|
362
|
+
- [swarmauri_llm_openai](https://pypi.org/project/swarmauri_llm_openai/)
|
|
363
|
+
- [swarmauri_llm_mistral](https://pypi.org/project/swarmauri_llm_mistral/)
|
|
364
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
365
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
366
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
367
|
+
- [OpenAI TTS (Play.ht replacement)](../../40-standards/swarmauri_tts_openai/README.md)
|
|
368
|
+
|
|
369
|
+
### Project Links
|
|
370
|
+
|
|
371
|
+
<!-- readme-standards:begin project-links -->
|
|
372
|
+
- [pypi: swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
373
|
+
<!-- readme-standards:end project-links -->
|
|
374
|
+
|
|
375
|
+
---
|
|
376
|
+
|
|
377
|
+
## Contributing
|
|
378
|
+
|
|
379
|
+
### How to Contribute
|
|
380
|
+
|
|
381
|
+
Follow the [contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md) and include a focused example or regression for changes to `swarmauri_llm_perplexity`. Keep package behavior, its documented boundary, and its tests aligned.
|
|
382
|
+
|
|
383
|
+
### Development Setup
|
|
384
|
+
|
|
385
|
+
Work from the `pkgs/50-community/swarmauri_llm_perplexity` checkout. Synchronize its declared development environment with uv, then run the relevant package tests and `python -m pytest tests/unit/test_readme_sources.py`. The repository’s dedicated README job installs `readme-standards==0.1.3` without resolving unrelated runtime packages.
|
|
386
|
+
|
|
387
|
+
### Notes for Maintainers
|
|
388
|
+
|
|
389
|
+
**Foundational Swarmauri Packages**
|
|
390
|
+
|
|
391
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
392
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
393
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
394
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
395
|
+
|
|
396
|
+
---
|
|
397
|
+
|
|
398
|
+
## Governance
|
|
399
|
+
|
|
400
|
+
### Ownership and Decision Making
|
|
401
|
+
|
|
402
|
+
Changes to `swarmauri_llm_perplexity` follow the maintainer review process of [swarmauri/swarmauri-sdk](https://github.com/swarmauri/swarmauri-sdk) and its contribution guide. Author attribution remains in the [manifest](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/pyproject.toml); this README does not assign new publishing or administrative authority.
|
|
403
|
+
|
|
404
|
+
### Standards and Policies
|
|
405
|
+
|
|
406
|
+
`swarmauri_llm_perplexity` follows the versioned [package-guide-v1 outline](https://github.com/groupsum/readme-standards/blob/master/docs/outline.md). All fixed headings, hierarchy, order, separators, and package-specific branding are checked by CI; reviewers assess the accuracy and usefulness of authored claims.
|
|
407
|
+
|
|
408
|
+
### Lifecycle and Migration
|
|
409
|
+
|
|
410
|
+
The `swarmauri_llm_perplexity` source version is `0.11.0`.
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## License and Attribution
|
|
415
|
+
|
|
416
|
+
### License
|
|
417
|
+
|
|
418
|
+
<!-- readme-standards:begin license -->
|
|
419
|
+
Licensed under `Apache-2.0`. See [LICENSE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/LICENSE).
|
|
420
|
+
<!-- readme-standards:end license -->
|
|
421
|
+
|
|
422
|
+
Apache-2.0
|
|
423
|
+
|
|
424
|
+
### Notices
|
|
425
|
+
|
|
426
|
+
<!-- readme-standards:begin notices -->
|
|
427
|
+
See [NOTICE](https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/NOTICE) for attribution.
|
|
428
|
+
<!-- readme-standards:end notices -->
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "swarmauri_llm_perplexity"
|
|
3
|
+
version = "0.11.0"
|
|
4
|
+
description = "Provider-specific Swarmauri import package for Perplexity chat, streaming, async, batch, and citation-aware LLM workflows."
|
|
5
|
+
license = "Apache-2.0"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
repository = "http://github.com/swarmauri/swarmauri-sdk"
|
|
8
|
+
requires-python = ">=3.10,<3.15"
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Natural Language :: English",
|
|
11
|
+
"Development Status :: 3 - Alpha",
|
|
12
|
+
"Intended Audience :: Developers",
|
|
13
|
+
"Intended Audience :: Science/Research",
|
|
14
|
+
"Operating System :: OS Independent",
|
|
15
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
16
|
+
"Topic :: Software Development :: Libraries",
|
|
17
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
18
|
+
"Programming Language :: Python",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
|
+
]
|
|
27
|
+
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"swarmauri_core",
|
|
30
|
+
"swarmauri_base",
|
|
31
|
+
"swarmauri_standard",
|
|
32
|
+
]
|
|
33
|
+
keywords = [
|
|
34
|
+
"swarmauri",
|
|
35
|
+
"llm",
|
|
36
|
+
"swarmauri llm",
|
|
37
|
+
"perplexity",
|
|
38
|
+
"perplexity api",
|
|
39
|
+
"sonar",
|
|
40
|
+
"reasoning model",
|
|
41
|
+
"chat completions",
|
|
42
|
+
"streaming llm",
|
|
43
|
+
"async llm",
|
|
44
|
+
"batch inference",
|
|
45
|
+
"citations",
|
|
46
|
+
"retrieval",
|
|
47
|
+
"large language model",
|
|
48
|
+
"generative ai",
|
|
49
|
+
"model",
|
|
50
|
+
]
|
|
51
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
52
|
+
|
|
53
|
+
[tool.uv.sources]
|
|
54
|
+
swarmauri_core = { workspace = true }
|
|
55
|
+
swarmauri_base = { workspace = true }
|
|
56
|
+
swarmauri_standard = { workspace = true }
|
|
57
|
+
|
|
58
|
+
[tool.pytest.ini_options]
|
|
59
|
+
norecursedirs = ["combined", "scripts"]
|
|
60
|
+
markers = [
|
|
61
|
+
"test: standard test",
|
|
62
|
+
"unit: Unit tests",
|
|
63
|
+
"i9n: Integration tests",
|
|
64
|
+
"r8n: Regression tests",
|
|
65
|
+
"timeout: mark test to timeout after X seconds",
|
|
66
|
+
"xpass: Expected passes",
|
|
67
|
+
"xfail: Expected failures",
|
|
68
|
+
"acceptance: Acceptance tests",
|
|
69
|
+
"perf: Performance tests that measure execution time and resource usage",
|
|
70
|
+
]
|
|
71
|
+
timeout = 300
|
|
72
|
+
log_cli = true
|
|
73
|
+
log_cli_level = "INFO"
|
|
74
|
+
log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
|
|
75
|
+
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
|
|
76
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
77
|
+
|
|
78
|
+
[tool.readme_standards]
|
|
79
|
+
policy = "package-guide-v1"
|
|
80
|
+
readme = "README.md"
|
|
81
|
+
brand = "swarmauri"
|
|
82
|
+
brand_catalog = "../../../tools/readme/brands.toml"
|
|
83
|
+
repository = "https://github.com/swarmauri/swarmauri-sdk"
|
|
84
|
+
ref = "master"
|
|
85
|
+
package_path = "pkgs/50-community/swarmauri_llm_perplexity"
|
|
86
|
+
layer = "community"
|
|
87
|
+
lifecycle = "active"
|
|
88
|
+
license_file = "LICENSE"
|
|
89
|
+
notice_file = "NOTICE"
|
|
90
|
+
|
|
91
|
+
[tool.readme_standards.distributions.pypi]
|
|
92
|
+
name = "swarmauri_llm_perplexity"
|
|
93
|
+
published = true
|
|
94
|
+
|
|
95
|
+
[tool.readme_standards.examples.quick_start]
|
|
96
|
+
source = "docs/readme/quick_start.py"
|
|
97
|
+
test = "tests/unit/test_readme_sources.py"
|
|
98
|
+
language = "python"
|
|
99
|
+
expected_exit_code = 0
|
|
100
|
+
|
|
101
|
+
[tool.readme_standards.examples.usage]
|
|
102
|
+
source = "docs/readme/usage.py"
|
|
103
|
+
test = "tests/unit/test_readme_sources.py"
|
|
104
|
+
language = "python"
|
|
105
|
+
expected_exit_code = 0
|
|
106
|
+
|
|
107
|
+
[tool.readme_standards.statuses.readme]
|
|
108
|
+
label = "CI gate"
|
|
109
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
|
|
110
|
+
|
|
111
|
+
[tool.readme_standards.statuses.tests]
|
|
112
|
+
label = "example source"
|
|
113
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/tests/unit/test_readme_sources.py"
|
|
114
|
+
|
|
115
|
+
[tool.readme_standards.statuses.certification]
|
|
116
|
+
label = "not certified"
|
|
117
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/pkgs/50-community/swarmauri_llm_perplexity/README.md#certification-status"
|
|
118
|
+
|
|
119
|
+
[tool.readme_standards.statuses.governance]
|
|
120
|
+
label = "repository policy"
|
|
121
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/blob/master/tools/readme/POLICY.md"
|
|
122
|
+
|
|
123
|
+
[tool.readme_standards.statuses.evidence]
|
|
124
|
+
label = "source and CI"
|
|
125
|
+
url = "https://github.com/swarmauri/swarmauri-sdk/actions/workflows/readme-standards.yml"
|
|
126
|
+
[project.entry-points.'swarmauri.llms']
|
|
127
|
+
PerplexityModel = "swarmauri_llm_perplexity.PerplexityModel:PerplexityModel"
|
|
128
|
+
|
|
129
|
+
[build-system]
|
|
130
|
+
requires = ["poetry-core>=1.0.0"]
|
|
131
|
+
build-backend = "poetry.core.masonry.api"
|
|
132
|
+
|
|
133
|
+
[dependency-groups]
|
|
134
|
+
dev = [
|
|
135
|
+
"pytest>=8.0",
|
|
136
|
+
"pytest-asyncio>=0.24.0",
|
|
137
|
+
"pytest-xdist>=3.6.1",
|
|
138
|
+
"pytest-json-report>=1.5.0",
|
|
139
|
+
"python-dotenv",
|
|
140
|
+
"httpx>=0.27",
|
|
141
|
+
"flake8>=7.0",
|
|
142
|
+
"pytest-timeout>=2.3.1",
|
|
143
|
+
"ruff>=0.9.9",
|
|
144
|
+
"pytest-benchmark>=4.0.0",
|
|
145
|
+
"readme-standards==0.1.3; python_version >= \"3.11\"",
|
|
146
|
+
]
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: swarmauri_llm_perplexity
|
|
3
|
-
Version: 0.1.1.dev2
|
|
4
|
-
Summary: Swarmauri Perplexity LLM adapters from swarmauri_standard.
|
|
5
|
-
License-Expression: Apache-2.0
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Keywords: swarmauri,llm,perplexity,model
|
|
8
|
-
Author: Jacob Stewart
|
|
9
|
-
Author-email: jacob@swarmauri.com
|
|
10
|
-
Requires-Python: >=3.10,<3.15
|
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Development Status :: 3 - Alpha
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
-
Classifier: Programming Language :: Python
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
-
Requires-Dist: swarmauri_base
|
|
25
|
-
Requires-Dist: swarmauri_core
|
|
26
|
-
Requires-Dist: swarmauri_standard
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
<p align="center">
|
|
32
|
-
<a href="https://pepy.tech/project/swarmauri_llm_perplexity/">
|
|
33
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_perplexity/month" alt="PyPI - Downloads"/></a>
|
|
34
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_perplexity/">
|
|
35
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_perplexity.svg"/></a>
|
|
36
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
37
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
38
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
39
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_perplexity" alt="PyPI - License"/></a>
|
|
40
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
41
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_perplexity?label=swarmauri_llm_perplexity&color=green" alt="PyPI - swarmauri_llm_perplexity"/></a>
|
|
42
|
-
</p>
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
# swarmauri_llm_perplexity
|
|
46
|
-
|
|
47
|
-
Provider-specific Perplexity LLM package for Swarmauri. This package offers direct imports for PerplexityModel while keeping implementation parity with `swarmauri_standard`.
|
|
48
|
-
|
|
49
|
-
## Features
|
|
50
|
-
|
|
51
|
-
- `PerplexityModel` adapter exported from `swarmauri_standard.llms.PerplexityModel`.
|
|
52
|
-
- Compatible with Python 3.10 through 3.12.
|
|
53
|
-
|
|
54
|
-
## Installation
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
# uv
|
|
58
|
-
uv add swarmauri_llm_perplexity
|
|
59
|
-
|
|
60
|
-
# pip
|
|
61
|
-
pip install swarmauri_llm_perplexity
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Usage
|
|
65
|
-
|
|
66
|
-
```python
|
|
67
|
-
from swarmauri_llm_perplexity import PerplexityModel
|
|
68
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
69
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
70
|
-
|
|
71
|
-
conversation = Conversation()
|
|
72
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
73
|
-
|
|
74
|
-
model = PerplexityModel()
|
|
75
|
-
# Configure provider credentials before making requests.
|
|
76
|
-
# result = model.predict(conversation=conversation)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Workflow Notes
|
|
80
|
-
|
|
81
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
82
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
83
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
84
|
-
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://pepy.tech/project/swarmauri_llm_perplexity/">
|
|
5
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_perplexity/month" alt="PyPI - Downloads"/></a>
|
|
6
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_perplexity/">
|
|
7
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_perplexity.svg"/></a>
|
|
8
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
9
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
10
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
11
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_perplexity" alt="PyPI - License"/></a>
|
|
12
|
-
<a href="https://pypi.org/project/swarmauri_llm_perplexity/">
|
|
13
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_perplexity?label=swarmauri_llm_perplexity&color=green" alt="PyPI - swarmauri_llm_perplexity"/></a>
|
|
14
|
-
</p>
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# swarmauri_llm_perplexity
|
|
18
|
-
|
|
19
|
-
Provider-specific Perplexity LLM package for Swarmauri. This package offers direct imports for PerplexityModel while keeping implementation parity with `swarmauri_standard`.
|
|
20
|
-
|
|
21
|
-
## Features
|
|
22
|
-
|
|
23
|
-
- `PerplexityModel` adapter exported from `swarmauri_standard.llms.PerplexityModel`.
|
|
24
|
-
- Compatible with Python 3.10 through 3.12.
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
# uv
|
|
30
|
-
uv add swarmauri_llm_perplexity
|
|
31
|
-
|
|
32
|
-
# pip
|
|
33
|
-
pip install swarmauri_llm_perplexity
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Usage
|
|
37
|
-
|
|
38
|
-
```python
|
|
39
|
-
from swarmauri_llm_perplexity import PerplexityModel
|
|
40
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
41
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
42
|
-
|
|
43
|
-
conversation = Conversation()
|
|
44
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
45
|
-
|
|
46
|
-
model = PerplexityModel()
|
|
47
|
-
# Configure provider credentials before making requests.
|
|
48
|
-
# result = model.predict(conversation=conversation)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Workflow Notes
|
|
52
|
-
|
|
53
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
54
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
55
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "swarmauri_llm_perplexity"
|
|
3
|
-
version = "0.1.1.dev2"
|
|
4
|
-
description = "Swarmauri Perplexity LLM adapters from swarmauri_standard."
|
|
5
|
-
license = "Apache-2.0"
|
|
6
|
-
readme = "README.md"
|
|
7
|
-
repository = "http://github.com/swarmauri/swarmauri-sdk"
|
|
8
|
-
requires-python = ">=3.10,<3.15"
|
|
9
|
-
classifiers = [
|
|
10
|
-
"License :: OSI Approved :: Apache Software License",
|
|
11
|
-
"Natural Language :: English",
|
|
12
|
-
"Development Status :: 3 - Alpha",
|
|
13
|
-
"Intended Audience :: Developers",
|
|
14
|
-
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
15
|
-
"Programming Language :: Python",
|
|
16
|
-
"Programming Language :: Python :: 3",
|
|
17
|
-
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
-
"Programming Language :: Python :: 3.10",
|
|
19
|
-
"Programming Language :: Python :: 3.11",
|
|
20
|
-
"Programming Language :: Python :: 3.12",
|
|
21
|
-
"Programming Language :: Python :: 3.13",
|
|
22
|
-
"Programming Language :: Python :: 3.14",
|
|
23
|
-
]
|
|
24
|
-
authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
|
|
25
|
-
dependencies = [
|
|
26
|
-
"swarmauri_core",
|
|
27
|
-
"swarmauri_base",
|
|
28
|
-
"swarmauri_standard",
|
|
29
|
-
]
|
|
30
|
-
keywords = [
|
|
31
|
-
"swarmauri",
|
|
32
|
-
"llm",
|
|
33
|
-
"perplexity",
|
|
34
|
-
"model",
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
[tool.uv.sources]
|
|
38
|
-
swarmauri_core = { workspace = true }
|
|
39
|
-
swarmauri_base = { workspace = true }
|
|
40
|
-
swarmauri_standard = { workspace = true }
|
|
41
|
-
|
|
42
|
-
[tool.pytest.ini_options]
|
|
43
|
-
norecursedirs = ["combined", "scripts"]
|
|
44
|
-
markers = [
|
|
45
|
-
"test: standard test",
|
|
46
|
-
"unit: Unit tests",
|
|
47
|
-
"i9n: Integration tests",
|
|
48
|
-
"r8n: Regression tests",
|
|
49
|
-
"timeout: mark test to timeout after X seconds",
|
|
50
|
-
"xpass: Expected passes",
|
|
51
|
-
"xfail: Expected failures",
|
|
52
|
-
"acceptance: Acceptance tests",
|
|
53
|
-
"perf: Performance tests that measure execution time and resource usage",
|
|
54
|
-
]
|
|
55
|
-
timeout = 300
|
|
56
|
-
log_cli = true
|
|
57
|
-
log_cli_level = "INFO"
|
|
58
|
-
log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
|
|
59
|
-
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
|
|
60
|
-
asyncio_default_fixture_loop_scope = "function"
|
|
61
|
-
|
|
62
|
-
[project.entry-points.'swarmauri.llms']
|
|
63
|
-
PerplexityModel = "swarmauri_llm_perplexity.PerplexityModel:PerplexityModel"
|
|
64
|
-
|
|
65
|
-
[build-system]
|
|
66
|
-
requires = ["poetry-core>=1.0.0"]
|
|
67
|
-
build-backend = "poetry.core.masonry.api"
|
|
68
|
-
|
|
69
|
-
[dependency-groups]
|
|
70
|
-
dev = [
|
|
71
|
-
"pytest>=8.0",
|
|
72
|
-
"pytest-asyncio>=0.24.0",
|
|
73
|
-
"pytest-xdist>=3.6.1",
|
|
74
|
-
"pytest-json-report>=1.5.0",
|
|
75
|
-
"python-dotenv",
|
|
76
|
-
"requests>=2.32.3",
|
|
77
|
-
"flake8>=7.0",
|
|
78
|
-
"pytest-timeout>=2.3.1",
|
|
79
|
-
"ruff>=0.9.9",
|
|
80
|
-
"pytest-benchmark>=4.0.0",
|
|
81
|
-
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|