Skip to content

Commit 39e847a

Browse files
authored
Merge pull request #34 from perplexityai/release-please--branches--main--changes--next--components--perplexity_ai
release: 0.26.0
2 parents 54989b2 + 2575103 commit 39e847a

23 files changed

+184
-116
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.25.0"
2+
".": "0.26.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 8
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-78325ecc9bdc8e9850866fcdd3be3d209b06f151059c774afc7e6005a1775f09.yml
3-
openapi_spec_hash: 19a34c8ddd46f81dd0b0850af5ee42f3
4-
config_hash: 620d4d190431b939dd17ac5d442918e6
1+
configured_endpoints: 10
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-e5052719572f5155f4cf704d996e5c7a875700a16f68f2335975ea3d06140b17.yml
3+
openapi_spec_hash: 97d9df5dc228bb6d71be54212bc5b600
4+
config_hash: e09a1767e929614701fb498eaaac682d

CHANGELOG.md

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

3+
## 0.26.0 (2026-02-23)
4+
5+
Full Changelog: [v0.25.0...v0.26.0](https://github.com/perplexityai/perplexity-node/compare/v0.25.0...v0.26.0)
6+
7+
### Features
8+
9+
* **api:** Add browser and sandbox API endpoints ([a35f39c](https://github.com/perplexityai/perplexity-node/commit/a35f39c37eddf661d131c9f07a7b4ea25d95ab5d))
10+
* **api:** manual updates ([bb5e5a8](https://github.com/perplexityai/perplexity-node/commit/bb5e5a8e815f9d3ef3419e5b841ce40430e5df95))
11+
12+
13+
### Bug Fixes
14+
15+
* **docs/contributing:** correct pnpm link command ([2976eab](https://github.com/perplexityai/perplexity-node/commit/2976eab295ea08f4743af92a36d96c659ec90e3c))
16+
17+
18+
### Chores
19+
20+
* **internal/client:** fix form-urlencoded requests ([36bfdb4](https://github.com/perplexityai/perplexity-node/commit/36bfdb4f151bc3d20e946f5658679edfe78d7f73))
21+
* **internal:** remove mock server code ([4ea1e20](https://github.com/perplexityai/perplexity-node/commit/4ea1e202b3d5c6fa7bb993c5e4e62b690bdb48f6))
22+
* update mock server docs ([73990f1](https://github.com/perplexityai/perplexity-node/commit/73990f1119a8240fa06d0985b06ecf7066cc1caf))
23+
324
## 0.25.0 (2026-02-12)
425

526
Full Changelog: [v0.24.0...v0.25.0](https://github.com/perplexityai/perplexity-node/compare/v0.24.0...v0.25.0)

CONTRIBUTING.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,11 @@ $ yarn link @perplexity-ai/perplexity_ai
6060
# With pnpm
6161
$ pnpm link --global
6262
$ cd ../my-package
63-
$ pnpm link -global @perplexity-ai/perplexity_ai
63+
$ pnpm link --global @perplexity-ai/perplexity_ai
6464
```
6565

6666
## Running tests
6767

68-
Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
69-
70-
```sh
71-
$ npx prism mock path/to/your/openapi.yml
72-
```
73-
7468
```sh
7569
$ yarn run test
7670
```

api.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Types:
44

55
- <code><a href="./src/resources/shared.ts">APIPublicSearchResult</a></code>
6+
- <code><a href="./src/resources/shared.ts">BrowserSessionResponse</a></code>
67
- <code><a href="./src/resources/shared.ts">ChatMessageInput</a></code>
78
- <code><a href="./src/resources/shared.ts">ChatMessageOutput</a></code>
89
- <code><a href="./src/resources/shared.ts">Choice</a></code>
@@ -78,6 +79,15 @@ Methods:
7879

7980
- <code title="post /v1/contextualizedembeddings">client.contextualizedEmbeddings.<a href="./src/resources/contextualized-embeddings.ts">create</a>({ ...params }) -> ContextualizedEmbeddingCreateResponse</code>
8081

82+
# Browser
83+
84+
## Sessions
85+
86+
Methods:
87+
88+
- <code title="post /v1/browser/sessions">client.browser.sessions.<a href="./src/resources/browser/sessions.ts">create</a>() -> BrowserSessionResponse</code>
89+
- <code title="delete /v1/browser/sessions/{session_id}">client.browser.sessions.<a href="./src/resources/browser/sessions.ts">delete</a>(sessionID) -> void</code>
90+
8191
# Async
8292

8393
## Chat

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

scripts/mock

Lines changed: 0 additions & 41 deletions
This file was deleted.

scripts/test

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,53 +4,7 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
RED='\033[0;31m'
8-
GREEN='\033[0;32m'
9-
YELLOW='\033[0;33m'
10-
NC='\033[0m' # No Color
117

12-
function prism_is_running() {
13-
curl --silent "http://localhost:4010" >/dev/null 2>&1
14-
}
15-
16-
kill_server_on_port() {
17-
pids=$(lsof -t -i tcp:"$1" || echo "")
18-
if [ "$pids" != "" ]; then
19-
kill "$pids"
20-
echo "Stopped $pids."
21-
fi
22-
}
23-
24-
function is_overriding_api_base_url() {
25-
[ -n "$TEST_API_BASE_URL" ]
26-
}
27-
28-
if ! is_overriding_api_base_url && ! prism_is_running ; then
29-
# When we exit this script, make sure to kill the background mock server process
30-
trap 'kill_server_on_port 4010' EXIT
31-
32-
# Start the dev server
33-
./scripts/mock --daemon
34-
fi
35-
36-
if is_overriding_api_base_url ; then
37-
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
38-
echo
39-
elif ! prism_is_running ; then
40-
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
41-
echo -e "running against your OpenAPI spec."
42-
echo
43-
echo -e "To run the server, pass in the path or url of your OpenAPI"
44-
echo -e "spec to the prism command:"
45-
echo
46-
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
47-
echo
48-
49-
exit 1
50-
else
51-
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
52-
echo
53-
fi
548

559
echo "==> Running tests"
5610
./node_modules/.bin/jest "$@"

src/client.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import {
4141
} from './resources/responses';
4242
import { Search, SearchCreateParams, SearchCreateResponse } from './resources/search';
4343
import { Async } from './resources/async/async';
44+
import { Browser } from './resources/browser/browser';
4445
import { Chat, StreamChunk } from './resources/chat/chat';
4546
import { type Fetch } from './internal/builtin-types';
4647
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
@@ -722,6 +723,14 @@ export class Perplexity {
722723
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
723724
) {
724725
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
726+
} else if (
727+
typeof body === 'object' &&
728+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
729+
) {
730+
return {
731+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
732+
body: this.stringifyQuery(body as Record<string, unknown>),
733+
};
725734
} else {
726735
return this.#encoder({ body, headers });
727736
}
@@ -751,6 +760,7 @@ export class Perplexity {
751760
responses: API.Responses = new API.Responses(this);
752761
embeddings: API.Embeddings = new API.Embeddings(this);
753762
contextualizedEmbeddings: API.ContextualizedEmbeddings = new API.ContextualizedEmbeddings(this);
763+
browser: API.Browser = new API.Browser(this);
754764
async: API.Async = new API.Async(this);
755765
}
756766

@@ -759,6 +769,7 @@ Perplexity.Search = Search;
759769
Perplexity.Responses = Responses;
760770
Perplexity.Embeddings = Embeddings;
761771
Perplexity.ContextualizedEmbeddings = ContextualizedEmbeddings;
772+
Perplexity.Browser = Browser;
762773
Perplexity.Async = Async;
763774

764775
export declare namespace Perplexity {
@@ -802,9 +813,12 @@ export declare namespace Perplexity {
802813
type ContextualizedEmbeddingCreateParams as ContextualizedEmbeddingCreateParams,
803814
};
804815

816+
export { Browser as Browser };
817+
805818
export { Async as Async };
806819

807820
export type APIPublicSearchResult = API.APIPublicSearchResult;
821+
export type BrowserSessionResponse = API.BrowserSessionResponse;
808822
export type ChatMessageInput = API.ChatMessageInput;
809823
export type ChatMessageOutput = API.ChatMessageOutput;
810824
export type Choice = API.Choice;

src/resources/browser.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export * from './browser/index';

0 commit comments

Comments
 (0)