Skip to content

Commit 80c06a6

Browse files
feat(api): manual updates
1 parent f48e28e commit 80c06a6

20 files changed

+45
-41
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 6
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-0a20b2c1a864613083f602f3589f85caa0e39b04c29c0a37db76f6398dfd2f50.yml
33
openapi_spec_hash: 5c8d07ba17d180b472679f2b85def126
4-
config_hash: 0f6dce622dad585b4661f4720322b17f
4+
config_hash: d3612805022ba4461f6399145be920d5

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ $ cd perplexity-node
5555
# With yarn
5656
$ yarn link
5757
$ cd ../my-package
58-
$ yarn link perplexity-node
58+
$ yarn link @perplexity-ai/perplexity_ai
5959

6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -—global perplexity-node
63+
$ pnpm link -—global @perplexity-ai/perplexity_ai
6464
```
6565

6666
## Running tests

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Perplexity TypeScript API Library
22

3-
[![NPM version](<https://img.shields.io/npm/v/perplexity-node.svg?label=npm%20(stable)>)](https://npmjs.org/package/perplexity-node) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/perplexity-node)
3+
[![NPM version](<https://img.shields.io/npm/v/@perplexity-ai/perplexity_ai.svg?label=npm%20(stable)>)](https://npmjs.org/package/@perplexity-ai/perplexity_ai) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/@perplexity-ai/perplexity_ai)
44

55
This library provides convenient access to the Perplexity REST API from server-side TypeScript or JavaScript.
66

@@ -11,7 +11,7 @@ It is generated with [Stainless](https://www.stainless.com/).
1111
## Installation
1212

1313
```sh
14-
npm install perplexity-node
14+
npm install @perplexity-ai/perplexity_ai
1515
```
1616

1717
## Usage
@@ -20,7 +20,7 @@ The full API of this library can be found in [api.md](api.md).
2020

2121
<!-- prettier-ignore -->
2222
```js
23-
import Perplexity from 'perplexity-node';
23+
import Perplexity from '@perplexity-ai/perplexity_ai';
2424

2525
const client = new Perplexity({
2626
apiKey: process.env['PERPLEXITY_API_KEY'], // This is the default and can be omitted
@@ -40,7 +40,7 @@ This library includes TypeScript definitions for all request params and response
4040

4141
<!-- prettier-ignore -->
4242
```ts
43-
import Perplexity from 'perplexity-node';
43+
import Perplexity from '@perplexity-ai/perplexity_ai';
4444

4545
const client = new Perplexity({
4646
apiKey: process.env['PERPLEXITY_API_KEY'], // This is the default and can be omitted
@@ -172,7 +172,7 @@ The log level can be configured in two ways:
172172
2. Using the `logLevel` client option (overrides the environment variable if set)
173173

174174
```ts
175-
import Perplexity from 'perplexity-node';
175+
import Perplexity from '@perplexity-ai/perplexity_ai';
176176

177177
const client = new Perplexity({
178178
logLevel: 'debug', // Show all log messages
@@ -200,7 +200,7 @@ When providing a custom logger, the `logLevel` option still controls which messa
200200
below the configured level will not be sent to your logger.
201201

202202
```ts
203-
import Perplexity from 'perplexity-node';
203+
import Perplexity from '@perplexity-ai/perplexity_ai';
204204
import pino from 'pino';
205205

206206
const logger = pino();
@@ -269,7 +269,7 @@ globalThis.fetch = fetch;
269269
Or pass it to the client:
270270

271271
```ts
272-
import Perplexity from 'perplexity-node';
272+
import Perplexity from '@perplexity-ai/perplexity_ai';
273273
import fetch from 'my-fetch';
274274

275275
const client = new Perplexity({ fetch });
@@ -280,7 +280,7 @@ const client = new Perplexity({ fetch });
280280
If you want to set custom `fetch` options without overriding the `fetch` function, you can provide a `fetchOptions` object when instantiating the client or making a request. (Request-specific options override client options.)
281281

282282
```ts
283-
import Perplexity from 'perplexity-node';
283+
import Perplexity from '@perplexity-ai/perplexity_ai';
284284

285285
const client = new Perplexity({
286286
fetchOptions: {
@@ -297,7 +297,7 @@ options to requests:
297297
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/node.svg" align="top" width="18" height="21"> **Node** <sup>[[docs](https://github.com/nodejs/undici/blob/main/docs/docs/api/ProxyAgent.md#example---proxyagent-with-fetch)]</sup>
298298

299299
```ts
300-
import Perplexity from 'perplexity-node';
300+
import Perplexity from '@perplexity-ai/perplexity_ai';
301301
import * as undici from 'undici';
302302

303303
const proxyAgent = new undici.ProxyAgent('http://localhost:8888');
@@ -311,7 +311,7 @@ const client = new Perplexity({
311311
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/bun.svg" align="top" width="18" height="21"> **Bun** <sup>[[docs](https://bun.sh/guides/http/proxy)]</sup>
312312

313313
```ts
314-
import Perplexity from 'perplexity-node';
314+
import Perplexity from '@perplexity-ai/perplexity_ai';
315315

316316
const client = new Perplexity({
317317
fetchOptions: {
@@ -323,7 +323,7 @@ const client = new Perplexity({
323323
<img src="https://raw.githubusercontent.com/stainless-api/sdk-assets/refs/heads/main/deno.svg" align="top" width="18" height="21"> **Deno** <sup>[[docs](https://docs.deno.com/api/deno/~/Deno.createHttpClient)]</sup>
324324

325325
```ts
326-
import Perplexity from 'npm:perplexity-node';
326+
import Perplexity from 'npm:@perplexity-ai/perplexity_ai';
327327

328328
const httpClient = Deno.createHttpClient({ proxy: { url: 'http://localhost:8888' } });
329329
const client = new Perplexity({

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export default tseslint.config(
2525
{
2626
patterns: [
2727
{
28-
regex: '^perplexity-node(/.*)?',
28+
regex: '^@perplexity-ai/perplexity_ai(/.*)?',
2929
message: 'Use a relative import, not a package import.',
3030
},
3131
],

jest.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ const config: JestConfigWithTsJest = {
77
'^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }],
88
},
99
moduleNameMapper: {
10-
'^perplexity-node$': '<rootDir>/src/index.ts',
11-
'^perplexity-node/(.*)$': '<rootDir>/src/$1',
10+
'^@perplexity-ai/perplexity_ai$': '<rootDir>/src/index.ts',
11+
'^@perplexity-ai/perplexity_ai/(.*)$': '<rootDir>/src/$1',
1212
},
1313
modulePathIgnorePatterns: [
1414
'<rootDir>/ecosystem-tests/',

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "perplexity-node",
2+
"name": "@perplexity-ai/perplexity_ai",
33
"version": "0.1.0",
44
"description": "The official TypeScript library for the Perplexity API",
55
"author": "Perplexity <>",

scripts/build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ node scripts/utils/check-version.cjs
88

99
# Build into dist and will publish the package from there,
1010
# so that src/resources/foo.ts becomes <package root>/resources/foo.js
11-
# This way importing from `"perplexity-node/resources/foo"` works
11+
# This way importing from `"@perplexity-ai/perplexity_ai/resources/foo"` works
1212
# even with `"moduleResolution": "node"`
1313

1414
rm -rf dist; mkdir dist
@@ -42,8 +42,8 @@ node scripts/utils/postprocess-files.cjs
4242

4343
# make sure that nothing crashes when we require the output CJS or
4444
# import the output ESM
45-
(cd dist && node -e 'require("perplexity-node")')
46-
(cd dist && node -e 'import("perplexity-node")' --input-type=module)
45+
(cd dist && node -e 'require("@perplexity-ai/perplexity_ai")')
46+
(cd dist && node -e 'import("@perplexity-ai/perplexity_ai")' --input-type=module)
4747

4848
if [ -e ./scripts/build-deno ]
4949
then

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import Perplexity from 'perplexity-node';
3+
import Perplexity from '@perplexity-ai/perplexity_ai';
44

55
const client = new Perplexity({
66
apiKey: 'My API Key',

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import Perplexity from 'perplexity-node';
3+
import Perplexity from '@perplexity-ai/perplexity_ai';
44

55
const client = new Perplexity({
66
apiKey: 'My API Key',

tests/api-resources/content.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import Perplexity from 'perplexity-node';
3+
import Perplexity from '@perplexity-ai/perplexity_ai';
44

55
const client = new Perplexity({
66
apiKey: 'My API Key',

0 commit comments

Comments
 (0)