From 659cf62198caebd226509583cec3e0adb729c23d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 18:32:54 +0000 Subject: [PATCH 1/3] chore: break long lines in snippets into multiline --- README.md | 5 +- .../async/chat/completions.test.ts | 16 ++++++- tests/api-resources/chat/completions.test.ts | 16 ++++++- tests/index.test.ts | 48 +++++++++++++++---- 4 files changed, 72 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3716a09..b077ced 100644 --- a/README.md +++ b/README.md @@ -218,7 +218,10 @@ const search = await client.search // Chat completions error handling const streamChunk = await client.chat.completions - .create({ messages: [{ role: 'user', content: 'What is the capital of France?' }], model: 'sonar' }) + .create({ + messages: [{ role: 'user', content: 'What is the capital of France?' }], + model: 'sonar', + }) .catch(async (err) => { if (err instanceof Perplexity.APIError) { console.log(err.status); // 400 diff --git a/tests/api-resources/async/chat/completions.test.ts b/tests/api-resources/async/chat/completions.test.ts index 6bb39b9..a1371c3 100644 --- a/tests/api-resources/async/chat/completions.test.ts +++ b/tests/api-resources/async/chat/completions.test.ts @@ -63,7 +63,13 @@ describe('resource completions', () => { }, ], tool_call_id: 'tool_call_id', - tool_calls: [{ id: 'id', function: { arguments: 'arguments', name: 'name' }, type: 'function' }], + tool_calls: [ + { + id: 'id', + function: { arguments: 'arguments', name: 'name' }, + type: 'function', + }, + ], }, ], model: 'model', @@ -142,7 +148,13 @@ describe('resource completions', () => { image_results_enhanced_relevance: true, search_context_size: 'low', search_type: 'fast', - user_location: { city: 'city', country: 'country', latitude: 0, longitude: 0, region: 'region' }, + user_location: { + city: 'city', + country: 'country', + latitude: 0, + longitude: 0, + region: 'region', + }, }, }, idempotency_key: 'idempotency_key', diff --git a/tests/api-resources/chat/completions.test.ts b/tests/api-resources/chat/completions.test.ts index 2126016..0671ef1 100644 --- a/tests/api-resources/chat/completions.test.ts +++ b/tests/api-resources/chat/completions.test.ts @@ -63,7 +63,13 @@ describe('resource completions', () => { }, ], tool_call_id: 'tool_call_id', - tool_calls: [{ id: 'id', function: { arguments: 'arguments', name: 'name' }, type: 'function' }], + tool_calls: [ + { + id: 'id', + function: { arguments: 'arguments', name: 'name' }, + type: 'function', + }, + ], }, ], model: 'model', @@ -142,7 +148,13 @@ describe('resource completions', () => { image_results_enhanced_relevance: true, search_context_size: 'low', search_type: 'fast', - user_location: { city: 'city', country: 'country', latitude: 0, longitude: 0, region: 'region' }, + user_location: { + city: 'city', + country: 'country', + latitude: 0, + longitude: 0, + region: 'region', + }, }, }); }); diff --git a/tests/index.test.ts b/tests/index.test.ts index 78f27fb..704454e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -87,7 +87,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new Perplexity({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new Perplexity({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).toHaveBeenCalled(); @@ -107,7 +111,11 @@ describe('instantiate client', () => { error: jest.fn(), }; - const client = new Perplexity({ logger: logger, logLevel: 'info', apiKey: 'My API Key' }); + const client = new Perplexity({ + logger: logger, + logLevel: 'info', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -157,7 +165,11 @@ describe('instantiate client', () => { }; process.env['PERPLEXITY_LOG'] = 'debug'; - const client = new Perplexity({ logger: logger, logLevel: 'off', apiKey: 'My API Key' }); + const client = new Perplexity({ + logger: logger, + logLevel: 'off', + apiKey: 'My API Key', + }); await forceAPIResponseForClient(client); expect(debugMock).not.toHaveBeenCalled(); @@ -173,7 +185,11 @@ describe('instantiate client', () => { }; process.env['PERPLEXITY_LOG'] = 'not a log level'; - const client = new Perplexity({ logger: logger, logLevel: 'debug', apiKey: 'My API Key' }); + const client = new Perplexity({ + logger: logger, + logLevel: 'debug', + apiKey: 'My API Key', + }); expect(client.logLevel).toBe('debug'); expect(warnMock).not.toHaveBeenCalled(); }); @@ -543,7 +559,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Perplexity({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new Perplexity({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -573,7 +593,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Perplexity({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); @@ -597,7 +621,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Perplexity({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ @@ -659,7 +687,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Perplexity({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Perplexity({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ From 9b3231fda472fca273e7777ae6204f8ca8260b38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 20:35:14 +0000 Subject: [PATCH 2/3] chore: fix typo in descriptions --- src/resources/async/chat/completions.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/resources/async/chat/completions.ts b/src/resources/async/chat/completions.ts index 8289f65..924d28c 100644 --- a/src/resources/async/chat/completions.ts +++ b/src/resources/async/chat/completions.ts @@ -363,37 +363,37 @@ export namespace CompletionCreateParams { export interface CompletionGetParams { /** - * Query param: + * Query param */ local_mode?: boolean; /** - * Header param: + * Header param */ 'x-client-env'?: string; /** - * Header param: + * Header param */ 'x-client-name'?: string; /** - * Header param: + * Header param */ 'x-created-at-epoch-seconds'?: string; /** - * Header param: + * Header param */ 'x-request-time'?: string; /** - * Header param: + * Header param */ 'x-usage-tier'?: string; /** - * Header param: + * Header param */ 'x-user-id'?: string; } From 1a2b43dadc81bf41e89852d06ff5df186638c40e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 20:35:31 +0000 Subject: [PATCH 3/3] release: 0.18.4 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 45efac8..61a6aa3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.18.3" + ".": "0.18.4" } diff --git a/CHANGELOG.md b/CHANGELOG.md index b4e1056..6f7737c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.18.4 (2026-01-13) + +Full Changelog: [v0.18.3...v0.18.4](https://github.com/perplexityai/perplexity-node/compare/v0.18.3...v0.18.4) + +### Chores + +* break long lines in snippets into multiline ([659cf62](https://github.com/perplexityai/perplexity-node/commit/659cf62198caebd226509583cec3e0adb729c23d)) +* fix typo in descriptions ([9b3231f](https://github.com/perplexityai/perplexity-node/commit/9b3231fda472fca273e7777ae6204f8ca8260b38)) + ## 0.18.3 (2026-01-05) Full Changelog: [v0.18.2...v0.18.3](https://github.com/perplexityai/perplexity-node/compare/v0.18.2...v0.18.3) diff --git a/package.json b/package.json index e8198d7..92b799a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@perplexity-ai/perplexity_ai", - "version": "0.18.3", + "version": "0.18.4", "description": "The official TypeScript library for the Perplexity API", "author": "Perplexity ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 613e3d4..5cdf891 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.18.3'; // x-release-please-version +export const VERSION = '0.18.4'; // x-release-please-version