Skip to content

Commit 71f69c3

Browse files
authored
Merge pull request #6 from perplexityai/release-please--branches--main--changes--next--components--perplexity_ai
2 parents f3eda82 + fcefb62 commit 71f69c3

File tree

15 files changed

+77
-22
lines changed

15 files changed

+77
-22
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.8.0"
2+
".": "0.9.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 5
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-aba0c21c569842e93e17b69cae9cee58d389fce9c2482f4d251fd8727db05679.yml
3-
openapi_spec_hash: 3d01b1c1425f7d43a8acf8b99bb9b321
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-51a3b755ae8040a6baeff490b3226a94c02a71aca6c4754dd365d7d0de8e399d.yml
3+
openapi_spec_hash: 03d28237de381a5b914ef738b3587bb5
44
config_hash: 0be7520657a7a0fb6b5a839e716fe30c

CHANGELOG.md

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

3+
## 0.9.0 (2025-10-08)
4+
5+
Full Changelog: [v0.8.0...v0.9.0](https://github.com/perplexityai/perplexity-node/compare/v0.8.0...v0.9.0)
6+
7+
### Features
8+
9+
* **api:** manual updates ([d17785c](https://github.com/perplexityai/perplexity-node/commit/d17785c3ec2ec4bf22d0719da119f13db8c8c0fd))
10+
11+
12+
### Chores
13+
14+
* **internal:** use npm pack for build uploads ([b2d7e82](https://github.com/perplexityai/perplexity-node/commit/b2d7e82ea8ac19c91e8b675230ffc81c73915f21))
15+
* **jsdoc:** fix [@link](https://github.com/link) annotations to refer only to parts of the package‘s public interface ([657927d](https://github.com/perplexityai/perplexity-node/commit/657927d9f2a0b50f8fd93ec68ee7f2b1c35e7845))
16+
317
## 0.8.0 (2025-10-02)
418

519
Full Changelog: [v0.7.1...v0.8.0](https://github.com/perplexityai/perplexity-node/compare/v0.7.1...v0.8.0)

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

scripts/utils/upload-artifact.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then
1212
exit 1
1313
fi
1414

15-
UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \
15+
TARBALL=$(cd dist && npm pack --silent)
16+
17+
UPLOAD_RESPONSE=$(curl -v -X PUT \
1618
-H "Content-Type: application/gzip" \
17-
--data-binary @- "$SIGNED_URL" 2>&1)
19+
--data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1)
1820

1921
if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
2022
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"

src/internal/to-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export type ToFileInput =
7373

7474
/**
7575
* Helper for creating a {@link File} to pass to an SDK upload method from a variety of different data formats
76-
* @param value the raw content of the file. Can be an {@link Uploadable}, {@link BlobLikePart}, or {@link AsyncIterable} of {@link BlobLikePart}s
76+
* @param value the raw content of the file. Can be an {@link Uploadable}, BlobLikePart, or AsyncIterable of BlobLikeParts
7777
* @param {string=} name the name of the file. If omitted, toFile will try to determine a file name from bits if possible
7878
* @param {Object=} options additional properties
7979
* @param {string=} options.type the MIME type of the content

src/resources/async/chat/completions.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,21 @@ import { path } from '../../../internal/utils/path';
1010

1111
export class Completions extends APIResource {
1212
/**
13-
* FastAPI wrapper around async chat completions
14-
*
15-
* This endpoint creates an asynchronous chat completion job and returns a job ID
16-
* that can be used to poll for results.
13+
* Submit an asynchronous chat completion request.
1714
*/
1815
create(body: CompletionCreateParams, options?: RequestOptions): APIPromise<CompletionCreateResponse> {
1916
return this._client.post('/async/chat/completions', { body, ...options });
2017
}
2118

2219
/**
23-
* list all async chat completion requests for a given user.
20+
* Retrieve a list of all asynchronous chat completion requests for a given user.
2421
*/
2522
list(options?: RequestOptions): APIPromise<CompletionListResponse> {
2623
return this._client.get('/async/chat/completions', options);
2724
}
2825

2926
/**
30-
* get the response for a given async chat completion request.
27+
* Retrieve the response for a given asynchronous chat completion request.
3128
*/
3229
get(
3330
apiRequest: string,
@@ -37,6 +34,7 @@ export class Completions extends APIResource {
3734
const {
3835
'x-client-env': xClientEnv,
3936
'x-client-name': xClientName,
37+
'x-created-at-epoch-seconds': xCreatedAtEpochSeconds,
4038
'x-request-time': xRequestTime,
4139
'x-usage-tier': xUsageTier,
4240
'x-user-id': xUserID,
@@ -49,6 +47,9 @@ export class Completions extends APIResource {
4947
{
5048
...(xClientEnv != null ? { 'x-client-env': xClientEnv } : undefined),
5149
...(xClientName != null ? { 'x-client-name': xClientName } : undefined),
50+
...(xCreatedAtEpochSeconds != null ?
51+
{ 'x-created-at-epoch-seconds': xCreatedAtEpochSeconds }
52+
: undefined),
5253
...(xRequestTime != null ? { 'x-request-time': xRequestTime } : undefined),
5354
...(xUsageTier != null ? { 'x-usage-tier': xUsageTier } : undefined),
5455
...(xUserID != null ? { 'x-user-id': xUserID } : undefined),
@@ -176,6 +177,8 @@ export namespace CompletionCreateParams {
176177

177178
image_format_filter?: Array<string> | null;
178179

180+
language_preference?: string | null;
181+
179182
last_updated_after_filter?: string | null;
180183

181184
last_updated_before_filter?: string | null;
@@ -234,8 +237,12 @@ export namespace CompletionCreateParams {
234237

235238
stream?: boolean | null;
236239

240+
stream_mode?: 'full' | 'concise';
241+
237242
temperature?: number | null;
238243

244+
thread_id?: string | null;
245+
239246
tool_choice?: 'none' | 'auto' | 'required' | null;
240247

241248
tools?: Array<Request.Tool> | null;
@@ -250,6 +257,8 @@ export namespace CompletionCreateParams {
250257

251258
updated_before_timestamp?: number | null;
252259

260+
use_threads?: boolean | null;
261+
253262
web_search_options?: Request.WebSearchOptions;
254263
}
255264

@@ -335,7 +344,7 @@ export namespace CompletionCreateParams {
335344

336345
search_context_size?: 'low' | 'medium' | 'high';
337346

338-
search_type?: 'fast' | 'pro' | 'auto';
347+
search_type?: 'fast' | 'pro' | 'auto' | null;
339348

340349
user_location?: WebSearchOptions.UserLocation | null;
341350
}
@@ -372,6 +381,11 @@ export interface CompletionGetParams {
372381
*/
373382
'x-client-name'?: string;
374383

384+
/**
385+
* Header param:
386+
*/
387+
'x-created-at-epoch-seconds'?: string;
388+
375389
/**
376390
* Header param:
377391
*/

src/resources/chat/chat.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ export interface StreamChunk {
2323

2424
model: string;
2525

26-
usage: Shared.UsageInfo;
27-
2826
citations?: Array<string> | null;
2927

3028
object?: string;
@@ -34,6 +32,8 @@ export interface StreamChunk {
3432
status?: 'PENDING' | 'COMPLETED' | null;
3533

3634
type?: 'message' | 'info' | 'end_of_stream' | null;
35+
36+
usage?: Shared.UsageInfo | null;
3737
}
3838

3939
Chat.Completions = Completions;

src/resources/chat/completions.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { RequestOptions } from '../../internal/request-options';
1010

1111
export class Completions extends APIResource {
1212
/**
13-
* FastAPI wrapper around chat completions
13+
* Generate a chat completion response for the given conversation.
1414
*/
1515
create(body: CompletionCreateParamsNonStreaming, options?: RequestOptions): APIPromise<ChatAPI.StreamChunk>;
1616
create(
@@ -70,6 +70,8 @@ export interface CompletionCreateParamsBase {
7070

7171
image_format_filter?: Array<string> | null;
7272

73+
language_preference?: string | null;
74+
7375
last_updated_after_filter?: string | null;
7476

7577
last_updated_before_filter?: string | null;
@@ -128,8 +130,12 @@ export interface CompletionCreateParamsBase {
128130

129131
stream?: boolean | null;
130132

133+
stream_mode?: 'full' | 'concise';
134+
131135
temperature?: number | null;
132136

137+
thread_id?: string | null;
138+
133139
tool_choice?: 'none' | 'auto' | 'required' | null;
134140

135141
tools?: Array<CompletionCreateParams.Tool> | null;
@@ -144,6 +150,8 @@ export interface CompletionCreateParamsBase {
144150

145151
updated_before_timestamp?: number | null;
146152

153+
use_threads?: boolean | null;
154+
147155
web_search_options?: CompletionCreateParams.WebSearchOptions;
148156
}
149157

@@ -229,7 +237,7 @@ export namespace CompletionCreateParams {
229237

230238
search_context_size?: 'low' | 'medium' | 'high';
231239

232-
search_type?: 'fast' | 'pro' | 'auto';
240+
search_type?: 'fast' | 'pro' | 'auto' | null;
233241

234242
user_location?: WebSearchOptions.UserLocation | null;
235243
}

src/resources/search.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { RequestOptions } from '../internal/request-options';
66

77
export class Search extends APIResource {
88
/**
9-
* Search
9+
* Search the web and retrieve relevant web page contents.
1010
*/
1111
create(body: SearchCreateParams, options?: RequestOptions): APIPromise<SearchCreateResponse> {
1212
return this._client.post('/search', { body, ...options });
@@ -17,6 +17,8 @@ export interface SearchCreateResponse {
1717
id: string;
1818

1919
results: Array<SearchCreateResponse.Result>;
20+
21+
server_time?: string | null;
2022
}
2123

2224
export namespace SearchCreateResponse {
@@ -36,7 +38,7 @@ export namespace SearchCreateResponse {
3638
export interface SearchCreateParams {
3739
query: string | Array<string>;
3840

39-
country?: string | null;
41+
display_server_time?: boolean;
4042

4143
max_results?: number;
4244

0 commit comments

Comments
 (0)