Skip to content

Commit e575052

Browse files
authored
Merge pull request #39 from perplexityai/release-please--branches--main--changes--next--components--perplexity_ai
2 parents 6edf40f + bb9d49f commit e575052

File tree

5 files changed

+28
-39
lines changed

5 files changed

+28
-39
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.26.3"
2+
".": "0.26.4"
33
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.26.4 (2026-03-22)
4+
5+
Full Changelog: [v0.26.3...v0.26.4](https://github.com/perplexityai/perplexity-node/compare/v0.26.3...v0.26.4)
6+
37
## 0.26.3 (2026-03-16)
48

59
Full Changelog: [v0.26.2...v0.26.3](https://github.com/perplexityai/perplexity-node/compare/v0.26.2...v0.26.3)

README.md

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const client = new Perplexity({
3131

3232
const search = await client.search.create({
3333
query: "latest AI developments 2024",
34-
maxResults: 5
34+
max_results: 5
3535
});
3636

3737
for (const result of search.results) {
@@ -71,7 +71,7 @@ const search = await client.search.create({
7171
"solar power innovations",
7272
"wind energy developments"
7373
],
74-
maxResults: 10
74+
max_results: 10
7575
});
7676
```
7777

@@ -82,13 +82,13 @@ Limit search results to specific trusted domains:
8282
```js
8383
const search = await client.search.create({
8484
query: "climate change research",
85-
searchDomainFilter: [
85+
search_domain_filter: [
8686
"science.org",
8787
"pnas.org",
8888
"cell.com",
8989
"nature.com"
9090
],
91-
maxResults: 10
91+
max_results: 10
9292
});
9393
```
9494

@@ -100,14 +100,14 @@ Filter results by recency or specific date ranges:
100100
// Get results from the past week
101101
const recentSearch = await client.search.create({
102102
query: "latest AI developments",
103-
searchRecencyFilter: "week"
103+
search_recency_filter: "week"
104104
});
105105

106106
// Search within a specific date range
107107
const dateRangeSearch = await client.search.create({
108108
query: "AI developments",
109-
searchAfterDateFilter: "01/01/2024",
110-
searchBeforeDateFilter: "12/31/2024"
109+
search_after_date_filter: "01/01/2024",
110+
search_before_date_filter: "12/31/2024"
111111
});
112112
```
113113

@@ -118,24 +118,8 @@ Search academic sources for research purposes:
118118
```js
119119
const academicSearch = await client.search.create({
120120
query: "machine learning algorithms",
121-
searchMode: "academic",
122-
maxResults: 10
123-
});
124-
```
125-
126-
#### Location-Based Search
127-
128-
Get geographically relevant results:
129-
130-
```js
131-
const localSearch = await client.search.create({
132-
query: "local restaurants",
133-
userLocationFilter: {
134-
latitude: 37.7749,
135-
longitude: -122.4194,
136-
radius: 10 // km
137-
},
138-
maxResults: 10
121+
search_mode: "academic",
122+
max_results: 10
139123
});
140124
```
141125

@@ -175,16 +159,17 @@ const client = new Perplexity({
175159
// Search API types
176160
const searchParams: Perplexity.Search.SearchCreateParams = {
177161
query: "artificial intelligence trends",
178-
maxResults: 5,
179-
searchMode: "web"
162+
max_results: 5,
163+
search_mode: "web"
180164
};
181165
const searchResponse: Perplexity.Search.SearchCreateResponse = await client.search.create(searchParams);
182166

183-
// Content API types
184-
const contentParams: Perplexity.Content.ContentCreateParams = {
185-
urls: ["https://example.com/article"]
167+
// Responses API types
168+
const responseParams: Perplexity.ResponseCreateParams = {
169+
input: "What is the capital of France?",
170+
model: "sonar",
186171
};
187-
const contentResponse: Perplexity.Content.ContentCreateResponse = await client.content.create(contentParams);
172+
const response: Perplexity.ResponseCreateResponse = await client.responses.create(responseParams);
188173

189174
// Chat Completions types
190175
const chatParams: Perplexity.Chat.CompletionCreateParams = {
@@ -205,7 +190,7 @@ a subclass of `APIError` will be thrown:
205190
```ts
206191
// Search API error handling
207192
const search = await client.search
208-
.create({ query: "AI developments", maxResults: 5 })
193+
.create({ query: "AI developments", max_results: 5 })
209194
.catch(async (err) => {
210195
if (err instanceof Perplexity.APIError) {
211196
console.log(err.status); // 400
@@ -261,7 +246,7 @@ const client = new Perplexity({
261246
});
262247

263248
// Or, configure per-request:
264-
await client.search.create({ query: "AI developments", maxResults: 5 }, {
249+
await client.search.create({ query: "AI developments", max_results: 5 }, {
265250
maxRetries: 5,
266251
});
267252

@@ -281,7 +266,7 @@ const client = new Perplexity({
281266
});
282267

283268
// Override per-request:
284-
await client.search.create({ query: "AI developments", maxResults: 5 }, {
269+
await client.search.create({ query: "AI developments", max_results: 5 }, {
285270
timeout: 5 * 1000,
286271
});
287272

@@ -309,13 +294,13 @@ const client = new Perplexity();
309294

310295
// With search API
311296
const searchResponse = await client.search
312-
.create({ query: "AI developments", maxResults: 5 })
297+
.create({ query: "AI developments", max_results: 5 })
313298
.asResponse();
314299
console.log(searchResponse.headers.get('X-My-Header'));
315300
console.log(searchResponse.statusText); // access the underlying Response object
316301

317302
const { data: search, response: rawSearchResponse } = await client.search
318-
.create({ query: "AI developments", maxResults: 5 })
303+
.create({ query: "AI developments", max_results: 5 })
319304
.withResponse();
320305
console.log(rawSearchResponse.headers.get('X-My-Header'));
321306
console.log(search.results.length);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@perplexity-ai/perplexity_ai",
3-
"version": "0.26.3",
3+
"version": "0.26.4",
44
"description": "The official TypeScript library for the Perplexity API",
55
"author": "Perplexity <api@perplexity.ai>",
66
"types": "dist/index.d.ts",

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '0.26.3'; // x-release-please-version
1+
export const VERSION = '0.26.4'; // x-release-please-version

0 commit comments

Comments
 (0)