Skip to content

Commit 5f5d473

Browse files
authored
Merge pull request #24 from perplexityai/release-please--branches--main--changes--next--components--perplexity_ai
release: 0.18.4
2 parents 98345f3 + de255b4 commit 5f5d473

10 files changed

Lines changed: 341 additions & 330 deletions

File tree

.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.18.3"
2+
".": "0.18.4"
33
}

CHANGELOG.md

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

3+
## 0.18.4 (2026-01-15)
4+
5+
Full Changelog: [v0.18.3...v0.18.4](https://github.com/perplexityai/perplexity-node/compare/v0.18.3...v0.18.4)
6+
7+
### Chores
8+
9+
* break long lines in snippets into multiline ([659cf62](https://github.com/perplexityai/perplexity-node/commit/659cf62198caebd226509583cec3e0adb729c23d))
10+
* fix typo in descriptions ([9b3231f](https://github.com/perplexityai/perplexity-node/commit/9b3231fda472fca273e7777ae6204f8ca8260b38))
11+
* **internal:** upgrade babel, qs, js-yaml ([837eae4](https://github.com/perplexityai/perplexity-node/commit/837eae4116e93c285e45cd8db078917f02441804))
12+
313
## 0.18.3 (2026-01-05)
414

515
Full Changelog: [v0.18.2...v0.18.3](https://github.com/perplexityai/perplexity-node/compare/v0.18.2...v0.18.3)

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,10 @@ const search = await client.search
218218

219219
// Chat completions error handling
220220
const streamChunk = await client.chat.completions
221-
.create({ messages: [{ role: 'user', content: 'What is the capital of France?' }], model: 'sonar' })
221+
.create({
222+
messages: [{ role: 'user', content: 'What is the capital of France?' }],
223+
model: 'sonar',
224+
})
222225
.catch(async (err) => {
223226
if (err instanceof Perplexity.APIError) {
224227
console.log(err.status); // 400

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.18.3",
3+
"version": "0.18.4",
44
"description": "The official TypeScript library for the Perplexity API",
55
"author": "Perplexity <api@perplexity.ai>",
66
"types": "dist/index.d.ts",

src/resources/async/chat/completions.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,37 +363,37 @@ export namespace CompletionCreateParams {
363363

364364
export interface CompletionGetParams {
365365
/**
366-
* Query param:
366+
* Query param
367367
*/
368368
local_mode?: boolean;
369369

370370
/**
371-
* Header param:
371+
* Header param
372372
*/
373373
'x-client-env'?: string;
374374

375375
/**
376-
* Header param:
376+
* Header param
377377
*/
378378
'x-client-name'?: string;
379379

380380
/**
381-
* Header param:
381+
* Header param
382382
*/
383383
'x-created-at-epoch-seconds'?: string;
384384

385385
/**
386-
* Header param:
386+
* Header param
387387
*/
388388
'x-request-time'?: string;
389389

390390
/**
391-
* Header param:
391+
* Header param
392392
*/
393393
'x-usage-tier'?: string;
394394

395395
/**
396-
* Header param:
396+
* Header param
397397
*/
398398
'x-user-id'?: string;
399399
}

src/version.ts

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

tests/api-resources/async/chat/completions.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ describe('resource completions', () => {
6363
},
6464
],
6565
tool_call_id: 'tool_call_id',
66-
tool_calls: [{ id: 'id', function: { arguments: 'arguments', name: 'name' }, type: 'function' }],
66+
tool_calls: [
67+
{
68+
id: 'id',
69+
function: { arguments: 'arguments', name: 'name' },
70+
type: 'function',
71+
},
72+
],
6773
},
6874
],
6975
model: 'model',
@@ -142,7 +148,13 @@ describe('resource completions', () => {
142148
image_results_enhanced_relevance: true,
143149
search_context_size: 'low',
144150
search_type: 'fast',
145-
user_location: { city: 'city', country: 'country', latitude: 0, longitude: 0, region: 'region' },
151+
user_location: {
152+
city: 'city',
153+
country: 'country',
154+
latitude: 0,
155+
longitude: 0,
156+
region: 'region',
157+
},
146158
},
147159
},
148160
idempotency_key: 'idempotency_key',

tests/api-resources/chat/completions.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,13 @@ describe('resource completions', () => {
6363
},
6464
],
6565
tool_call_id: 'tool_call_id',
66-
tool_calls: [{ id: 'id', function: { arguments: 'arguments', name: 'name' }, type: 'function' }],
66+
tool_calls: [
67+
{
68+
id: 'id',
69+
function: { arguments: 'arguments', name: 'name' },
70+
type: 'function',
71+
},
72+
],
6773
},
6874
],
6975
model: 'model',
@@ -142,7 +148,13 @@ describe('resource completions', () => {
142148
image_results_enhanced_relevance: true,
143149
search_context_size: 'low',
144150
search_type: 'fast',
145-
user_location: { city: 'city', country: 'country', latitude: 0, longitude: 0, region: 'region' },
151+
user_location: {
152+
city: 'city',
153+
country: 'country',
154+
latitude: 0,
155+
longitude: 0,
156+
region: 'region',
157+
},
146158
},
147159
});
148160
});

tests/index.test.ts

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,11 @@ describe('instantiate client', () => {
8787
error: jest.fn(),
8888
};
8989

90-
const client = new Perplexity({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' });
90+
const client = new Perplexity({
91+
logger: logger,
92+
logLevel: 'debug',
93+
apiKey: 'My API Key',
94+
});
9195

9296
await forceAPIResponseForClient(client);
9397
expect(debugMock).toHaveBeenCalled();
@@ -107,7 +111,11 @@ describe('instantiate client', () => {
107111
error: jest.fn(),
108112
};
109113

110-
const client = new Perplexity({ logger: logger, logLevel: 'info', apiKey: 'My API Key' });
114+
const client = new Perplexity({
115+
logger: logger,
116+
logLevel: 'info',
117+
apiKey: 'My API Key',
118+
});
111119

112120
await forceAPIResponseForClient(client);
113121
expect(debugMock).not.toHaveBeenCalled();
@@ -157,7 +165,11 @@ describe('instantiate client', () => {
157165
};
158166

159167
process.env['PERPLEXITY_LOG'] = 'debug';
160-
const client = new Perplexity({ logger: logger, logLevel: 'off', apiKey: 'My API Key' });
168+
const client = new Perplexity({
169+
logger: logger,
170+
logLevel: 'off',
171+
apiKey: 'My API Key',
172+
});
161173

162174
await forceAPIResponseForClient(client);
163175
expect(debugMock).not.toHaveBeenCalled();
@@ -173,7 +185,11 @@ describe('instantiate client', () => {
173185
};
174186

175187
process.env['PERPLEXITY_LOG'] = 'not a log level';
176-
const client = new Perplexity({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' });
188+
const client = new Perplexity({
189+
logger: logger,
190+
logLevel: 'debug',
191+
apiKey: 'My API Key',
192+
});
177193
expect(client.logLevel).toBe('debug');
178194
expect(warnMock).not.toHaveBeenCalled();
179195
});
@@ -543,7 +559,11 @@ describe('retries', () => {
543559
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
544560
};
545561

546-
const client = new Perplexity({ apiKey: 'My API Key', timeout: 10, fetch: testFetch });
562+
const client = new Perplexity({
563+
apiKey: 'My API Key',
564+
timeout: 10,
565+
fetch: testFetch,
566+
});
547567

548568
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
549569
expect(count).toEqual(2);
@@ -573,7 +593,11 @@ describe('retries', () => {
573593
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
574594
};
575595

576-
const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
596+
const client = new Perplexity({
597+
apiKey: 'My API Key',
598+
fetch: testFetch,
599+
maxRetries: 4,
600+
});
577601

578602
expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 });
579603

@@ -597,7 +621,11 @@ describe('retries', () => {
597621
capturedRequest = init;
598622
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
599623
};
600-
const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
624+
const client = new Perplexity({
625+
apiKey: 'My API Key',
626+
fetch: testFetch,
627+
maxRetries: 4,
628+
});
601629

602630
expect(
603631
await client.request({
@@ -659,7 +687,11 @@ describe('retries', () => {
659687
capturedRequest = init;
660688
return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } });
661689
};
662-
const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 });
690+
const client = new Perplexity({
691+
apiKey: 'My API Key',
692+
fetch: testFetch,
693+
maxRetries: 4,
694+
});
663695

664696
expect(
665697
await client.request({

0 commit comments

Comments
 (0)