@perplexity-ai/perplexity_ai 0.39.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -2
- package/dist/client.js.map +1 -1
- package/dist/generated/api.d.ts +236 -22
- package/dist/generated/api.d.ts.map +1 -1
- package/dist/generated/api.js +88 -3
- package/dist/generated/api.js.map +1 -1
- package/dist/generated/runtime.d.ts +1 -1
- package/dist/generated/runtime.d.ts.map +1 -1
- package/dist/generated/runtime.js +12 -1
- package/dist/generated/runtime.js.map +1 -1
- package/dist/resources/batches.d.ts +6 -0
- package/dist/resources/batches.d.ts.map +1 -0
- package/dist/resources/batches.js +3 -0
- package/dist/resources/batches.js.map +1 -0
- package/dist/resources/client.d.ts +13 -0
- package/dist/resources/client.d.ts.map +1 -1
- package/dist/resources/client.js +4 -0
- package/dist/resources/client.js.map +1 -1
- package/dist/resources/files.d.ts +7 -0
- package/dist/resources/files.d.ts.map +1 -0
- package/dist/resources/files.js +3 -0
- package/dist/resources/files.js.map +1 -0
- package/dist/resources/index.d.ts +2 -0
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +2 -0
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/shared.d.ts +7 -0
- package/dist/resources/shared.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/client.ts +7 -2
- package/src/generated/api.ts +306 -25
- package/src/generated/runtime.ts +11 -1
- package/src/resources/batches.ts +5 -0
- package/src/resources/client.ts +15 -0
- package/src/resources/files.ts +6 -0
- package/src/resources/index.ts +2 -0
- package/src/resources/shared.ts +7 -0
- package/src/version.ts +1 -1
package/src/generated/api.ts
CHANGED
|
@@ -1,26 +1,6 @@
|
|
|
1
|
-
import { addOutputText, legacyQuery, legacyRequestOptions, ownBoolean, ownCursor, normalizeHeaders, multipartBody, pathSegment } from "./runtime.js";
|
|
1
|
+
import { addOutputText, legacyQuery, legacyRequestOptions, ownBoolean, ownCursor, ownParameter, normalizeHeaders, multipartBody, pathSegment } from "./runtime.js";
|
|
2
2
|
import type { APIPromise, RequestOptions, SdkTransport, Stream } from "./runtime.js";
|
|
3
3
|
export type { APIPromise, HeaderValue, HeadersLike, RequestOptions, SdkTransport, Stream } from "./runtime.js";
|
|
4
|
-
export type AdvisorResultOutputItemInput = {
|
|
5
|
-
advice?: string;
|
|
6
|
-
arguments?: string;
|
|
7
|
-
call_id: string;
|
|
8
|
-
error_code?: string;
|
|
9
|
-
error_message?: string;
|
|
10
|
-
question?: string;
|
|
11
|
-
status: StatusInput;
|
|
12
|
-
type: "advisor_result";
|
|
13
|
-
};
|
|
14
|
-
export type AdvisorResultOutputItemOutput = {
|
|
15
|
-
advice?: string;
|
|
16
|
-
arguments?: string;
|
|
17
|
-
call_id: string;
|
|
18
|
-
error_code?: string;
|
|
19
|
-
error_message?: string;
|
|
20
|
-
question?: string;
|
|
21
|
-
status: StatusOutput;
|
|
22
|
-
type: "advisor_result";
|
|
23
|
-
};
|
|
24
4
|
export type AnnotationInput = {
|
|
25
5
|
end_index?: number;
|
|
26
6
|
start_index?: number;
|
|
@@ -301,6 +281,128 @@ export type AsyncApiChatCompletionsResponseSummaryOutput = {
|
|
|
301
281
|
};
|
|
302
282
|
export type AsyncProcessingStatusInput = "CREATED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
|
|
303
283
|
export type AsyncProcessingStatusOutput = "CREATED" | "IN_PROGRESS" | "COMPLETED" | "FAILED";
|
|
284
|
+
export type BatchInput = {
|
|
285
|
+
cancelled_at?: number | null;
|
|
286
|
+
cancelling_at?: number | null;
|
|
287
|
+
completed_at?: number | null;
|
|
288
|
+
completion_window: string;
|
|
289
|
+
created_at: number;
|
|
290
|
+
endpoint: string;
|
|
291
|
+
error_file_id?: string | null;
|
|
292
|
+
errors?: BatchErrorsInput | null;
|
|
293
|
+
expired_at?: number | null;
|
|
294
|
+
expires_at?: number | null;
|
|
295
|
+
failed_at?: number | null;
|
|
296
|
+
finalizing_at?: number | null;
|
|
297
|
+
id: string;
|
|
298
|
+
in_progress_at?: number | null;
|
|
299
|
+
input_file_id: string;
|
|
300
|
+
metadata?: ({} & Record<string, string>) | null;
|
|
301
|
+
object: "batch";
|
|
302
|
+
output_file_id?: string | null;
|
|
303
|
+
request_counts: BatchRequestCountsInput;
|
|
304
|
+
status: "validating" | "in_progress" | "finalizing" | "completed" | "expired" | "cancelling" | "cancelled" | "failed";
|
|
305
|
+
usage: BatchUsageInput;
|
|
306
|
+
};
|
|
307
|
+
export type BatchOutput = {
|
|
308
|
+
cancelled_at?: number | null;
|
|
309
|
+
cancelling_at?: number | null;
|
|
310
|
+
completed_at?: number | null;
|
|
311
|
+
completion_window: string;
|
|
312
|
+
created_at: number;
|
|
313
|
+
endpoint: string;
|
|
314
|
+
error_file_id?: string | null;
|
|
315
|
+
errors?: BatchErrorsOutput | null;
|
|
316
|
+
expired_at?: number | null;
|
|
317
|
+
expires_at?: number | null;
|
|
318
|
+
failed_at?: number | null;
|
|
319
|
+
finalizing_at?: number | null;
|
|
320
|
+
id: string;
|
|
321
|
+
in_progress_at?: number | null;
|
|
322
|
+
input_file_id: string;
|
|
323
|
+
metadata?: ({} & Record<string, string>) | null;
|
|
324
|
+
object: "batch";
|
|
325
|
+
output_file_id?: string | null;
|
|
326
|
+
request_counts: BatchRequestCountsOutput;
|
|
327
|
+
status: "validating" | "in_progress" | "finalizing" | "completed" | "expired" | "cancelling" | "cancelled" | "failed";
|
|
328
|
+
usage: BatchUsageOutput;
|
|
329
|
+
};
|
|
330
|
+
export type BatchCreateRequestInput = {
|
|
331
|
+
completion_window?: "24h";
|
|
332
|
+
endpoint: "/v1/responses";
|
|
333
|
+
input_file_id: string;
|
|
334
|
+
metadata?: ({} & Record<string, string>) | null;
|
|
335
|
+
};
|
|
336
|
+
export type BatchCreateRequestOutput = {
|
|
337
|
+
completion_window?: "24h";
|
|
338
|
+
endpoint: "/v1/responses";
|
|
339
|
+
input_file_id: string;
|
|
340
|
+
metadata?: ({} & Record<string, string>) | null;
|
|
341
|
+
};
|
|
342
|
+
export type BatchErrorInput = {
|
|
343
|
+
code: string;
|
|
344
|
+
line?: number | null;
|
|
345
|
+
message: string;
|
|
346
|
+
};
|
|
347
|
+
export type BatchErrorOutput = {
|
|
348
|
+
code: string;
|
|
349
|
+
line?: number | null;
|
|
350
|
+
message: string;
|
|
351
|
+
};
|
|
352
|
+
export type BatchErrorsInput = {
|
|
353
|
+
data: BatchErrorInput[];
|
|
354
|
+
object: "list";
|
|
355
|
+
};
|
|
356
|
+
export type BatchErrorsOutput = {
|
|
357
|
+
data: BatchErrorOutput[];
|
|
358
|
+
object: "list";
|
|
359
|
+
};
|
|
360
|
+
export type BatchListInput = {
|
|
361
|
+
data: BatchInput[];
|
|
362
|
+
first_id?: string | null;
|
|
363
|
+
has_more: boolean;
|
|
364
|
+
last_id?: string | null;
|
|
365
|
+
object: "list";
|
|
366
|
+
};
|
|
367
|
+
export type BatchListOutput = {
|
|
368
|
+
data: BatchOutput[];
|
|
369
|
+
first_id?: string | null;
|
|
370
|
+
has_more: boolean;
|
|
371
|
+
last_id?: string | null;
|
|
372
|
+
object: "list";
|
|
373
|
+
};
|
|
374
|
+
export type BatchRequestCountsInput = {
|
|
375
|
+
completed: number;
|
|
376
|
+
failed: number;
|
|
377
|
+
total: number;
|
|
378
|
+
};
|
|
379
|
+
export type BatchRequestCountsOutput = {
|
|
380
|
+
completed: number;
|
|
381
|
+
failed: number;
|
|
382
|
+
total: number;
|
|
383
|
+
};
|
|
384
|
+
export type BatchUsageInput = {
|
|
385
|
+
input_tokens: number;
|
|
386
|
+
input_tokens_details: {
|
|
387
|
+
cached_tokens: number;
|
|
388
|
+
};
|
|
389
|
+
output_tokens: number;
|
|
390
|
+
output_tokens_details: {
|
|
391
|
+
reasoning_tokens: number;
|
|
392
|
+
};
|
|
393
|
+
total_tokens: number;
|
|
394
|
+
};
|
|
395
|
+
export type BatchUsageOutput = {
|
|
396
|
+
input_tokens: number;
|
|
397
|
+
input_tokens_details: {
|
|
398
|
+
cached_tokens: number;
|
|
399
|
+
};
|
|
400
|
+
output_tokens: number;
|
|
401
|
+
output_tokens_details: {
|
|
402
|
+
reasoning_tokens: number;
|
|
403
|
+
};
|
|
404
|
+
total_tokens: number;
|
|
405
|
+
};
|
|
304
406
|
export type BrowserSessionResponseInput = {
|
|
305
407
|
session_id?: string;
|
|
306
408
|
status?: "running" | "stopped";
|
|
@@ -761,6 +863,58 @@ export type FetchUrlToolOutput = {
|
|
|
761
863
|
max_urls?: number;
|
|
762
864
|
type: "fetch_url";
|
|
763
865
|
};
|
|
866
|
+
export type FileDeletedInput = {
|
|
867
|
+
deleted: boolean;
|
|
868
|
+
id: string;
|
|
869
|
+
object: "file";
|
|
870
|
+
};
|
|
871
|
+
export type FileDeletedOutput = {
|
|
872
|
+
deleted: boolean;
|
|
873
|
+
id: string;
|
|
874
|
+
object: "file";
|
|
875
|
+
};
|
|
876
|
+
export type FileObjectInput = {
|
|
877
|
+
bytes: number;
|
|
878
|
+
created_at: number;
|
|
879
|
+
expires_at?: number | null;
|
|
880
|
+
filename: string;
|
|
881
|
+
id: string;
|
|
882
|
+
object: "file";
|
|
883
|
+
purpose: FilePurposeInput;
|
|
884
|
+
};
|
|
885
|
+
export type FileObjectOutput = {
|
|
886
|
+
bytes: number;
|
|
887
|
+
created_at: number;
|
|
888
|
+
expires_at?: number | null;
|
|
889
|
+
filename: string;
|
|
890
|
+
id: string;
|
|
891
|
+
object: "file";
|
|
892
|
+
purpose: FilePurposeOutput;
|
|
893
|
+
};
|
|
894
|
+
export type FileObjectListInput = {
|
|
895
|
+
data: FileObjectInput[];
|
|
896
|
+
first_id?: string | null;
|
|
897
|
+
has_more: boolean;
|
|
898
|
+
last_id?: string | null;
|
|
899
|
+
object: "list";
|
|
900
|
+
};
|
|
901
|
+
export type FileObjectListOutput = {
|
|
902
|
+
data: FileObjectOutput[];
|
|
903
|
+
first_id?: string | null;
|
|
904
|
+
has_more: boolean;
|
|
905
|
+
last_id?: string | null;
|
|
906
|
+
object: "list";
|
|
907
|
+
};
|
|
908
|
+
export type FilePurposeInput = "batch" | "batch_output";
|
|
909
|
+
export type FilePurposeOutput = "batch" | "batch_output";
|
|
910
|
+
export type FileUploadInput = {
|
|
911
|
+
file: Blob;
|
|
912
|
+
purpose: "batch";
|
|
913
|
+
};
|
|
914
|
+
export type FileUploadOutput = {
|
|
915
|
+
file: string;
|
|
916
|
+
purpose: "batch";
|
|
917
|
+
};
|
|
764
918
|
export type FinanceSearchToolInput = {
|
|
765
919
|
type: "finance_search";
|
|
766
920
|
};
|
|
@@ -1265,8 +1419,8 @@ export type NamespaceToolDefOutput = {
|
|
|
1265
1419
|
parameters?: {} & Record<string, unknown>;
|
|
1266
1420
|
type: "function";
|
|
1267
1421
|
};
|
|
1268
|
-
export type OutputItemInput = MessageOutputItemInput | SearchResultsOutputItemInput | ImageSearchResultsOutputItemInput | FetchUrlResultsOutputItemInput | FunctionCallOutputItemInput | McpListToolsOutputItemInput | McpCallOutputItemInput | McpApprovalRequestOutputItemInput | ToolSearchOutputItemInput | SkillLoadedOutputItemInput |
|
|
1269
|
-
export type OutputItemOutput = MessageOutputItemOutput | SearchResultsOutputItemOutput | ImageSearchResultsOutputItemOutput | FetchUrlResultsOutputItemOutput | FunctionCallOutputItemOutput | McpListToolsOutputItemOutput | McpCallOutputItemOutput | McpApprovalRequestOutputItemOutput | ToolSearchOutputItemOutput | SkillLoadedOutputItemOutput |
|
|
1422
|
+
export type OutputItemInput = MessageOutputItemInput | SearchResultsOutputItemInput | ImageSearchResultsOutputItemInput | FetchUrlResultsOutputItemInput | FunctionCallOutputItemInput | McpListToolsOutputItemInput | McpCallOutputItemInput | McpApprovalRequestOutputItemInput | ToolSearchOutputItemInput | SkillLoadedOutputItemInput | SandboxResultsOutputItemInput | SandboxWriteFileOutputItemInput | SandboxReadFileOutputItemInput | SandboxEditFileOutputItemInput | SandboxGrepOutputItemInput | SandboxGlobOutputItemInput | SandboxApplyPatchOutputItemInput | ShareFileOutputItemInput | UnknownOutputItemInput;
|
|
1423
|
+
export type OutputItemOutput = MessageOutputItemOutput | SearchResultsOutputItemOutput | ImageSearchResultsOutputItemOutput | FetchUrlResultsOutputItemOutput | FunctionCallOutputItemOutput | McpListToolsOutputItemOutput | McpCallOutputItemOutput | McpApprovalRequestOutputItemOutput | ToolSearchOutputItemOutput | SkillLoadedOutputItemOutput | SandboxResultsOutputItemOutput | SandboxWriteFileOutputItemOutput | SandboxReadFileOutputItemOutput | SandboxEditFileOutputItemOutput | SandboxGrepOutputItemOutput | SandboxGlobOutputItemOutput | SandboxApplyPatchOutputItemOutput | ShareFileOutputItemOutput | UnknownOutputItemOutput;
|
|
1270
1424
|
export type OutputItemAddedEventInput = {
|
|
1271
1425
|
item: OutputItemInput;
|
|
1272
1426
|
output_index: number;
|
|
@@ -1564,6 +1718,7 @@ export type ResponsesRequestInput = {
|
|
|
1564
1718
|
response_format?: ResponseFormatInput;
|
|
1565
1719
|
service_tier?: "auto" | "default" | "flex" | "priority" | "fast";
|
|
1566
1720
|
skills?: SkillInput[];
|
|
1721
|
+
step_budget_reminder?: boolean;
|
|
1567
1722
|
store?: boolean;
|
|
1568
1723
|
stream?: boolean;
|
|
1569
1724
|
temperature?: number;
|
|
@@ -1588,6 +1743,7 @@ export type ResponsesRequestOutput = {
|
|
|
1588
1743
|
response_format?: ResponseFormatOutput;
|
|
1589
1744
|
service_tier?: "auto" | "default" | "flex" | "priority" | "fast";
|
|
1590
1745
|
skills?: SkillOutput[];
|
|
1746
|
+
step_budget_reminder?: boolean;
|
|
1591
1747
|
store?: boolean;
|
|
1592
1748
|
stream?: boolean;
|
|
1593
1749
|
temperature?: number;
|
|
@@ -1603,6 +1759,7 @@ export type ResponsesResponseInput = {
|
|
|
1603
1759
|
model: string;
|
|
1604
1760
|
object: ResponsesObjectTypeInput;
|
|
1605
1761
|
output: OutputItemInput[];
|
|
1762
|
+
preset?: string;
|
|
1606
1763
|
previous_response_id?: string | null;
|
|
1607
1764
|
prompt_cache_key?: string | null;
|
|
1608
1765
|
service_tier?: string;
|
|
@@ -1618,6 +1775,7 @@ export type ResponsesResponseOutput = {
|
|
|
1618
1775
|
model: string;
|
|
1619
1776
|
object: ResponsesObjectTypeOutput;
|
|
1620
1777
|
output: OutputItemOutput[];
|
|
1778
|
+
preset?: string;
|
|
1621
1779
|
previous_response_id?: string | null;
|
|
1622
1780
|
prompt_cache_key?: string | null;
|
|
1623
1781
|
service_tier?: string;
|
|
@@ -2307,6 +2465,47 @@ export class AsyncResource {
|
|
|
2307
2465
|
this.chat = new AsyncChatResource(client);
|
|
2308
2466
|
}
|
|
2309
2467
|
}
|
|
2468
|
+
export class BatchesResource {
|
|
2469
|
+
private readonly _client: SdkTransport;
|
|
2470
|
+
constructor(client: SdkTransport) {
|
|
2471
|
+
this._client = client;
|
|
2472
|
+
}
|
|
2473
|
+
cancel(batchID: string, options?: RequestOptions): APIPromise<BatchOutput> {
|
|
2474
|
+
return this._client.post<BatchOutput>(`/v1/batches/${pathSegment(batchID)}/cancel`, {
|
|
2475
|
+
...options
|
|
2476
|
+
});
|
|
2477
|
+
}
|
|
2478
|
+
create(body: BatchCreateRequestInput, params?: {
|
|
2479
|
+
"Idempotency-Key"?: string;
|
|
2480
|
+
}, options?: RequestOptions): APIPromise<BatchOutput> {
|
|
2481
|
+
return this._client.post<BatchOutput>("/v1/batches", {
|
|
2482
|
+
...options,
|
|
2483
|
+
body: body,
|
|
2484
|
+
headers: {
|
|
2485
|
+
"Idempotency-Key": params?.["Idempotency-Key"],
|
|
2486
|
+
...normalizeHeaders(options?.headers)
|
|
2487
|
+
}
|
|
2488
|
+
});
|
|
2489
|
+
}
|
|
2490
|
+
list(params?: {
|
|
2491
|
+
after?: string;
|
|
2492
|
+
limit?: number;
|
|
2493
|
+
}, options?: RequestOptions): APIPromise<BatchListOutput> {
|
|
2494
|
+
return this._client.get<BatchListOutput>("/v1/batches", {
|
|
2495
|
+
...options,
|
|
2496
|
+
query: {
|
|
2497
|
+
after: params?.after,
|
|
2498
|
+
limit: params?.limit,
|
|
2499
|
+
...options?.query
|
|
2500
|
+
}
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
retrieve(batchID: string, options?: RequestOptions): APIPromise<BatchOutput> {
|
|
2504
|
+
return this._client.get<BatchOutput>(`/v1/batches/${pathSegment(batchID)}`, {
|
|
2505
|
+
...options
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
}
|
|
2310
2509
|
export class BrowserResource {
|
|
2311
2510
|
readonly sessions: BrowserSessionsResource;
|
|
2312
2511
|
constructor(client: SdkTransport) {
|
|
@@ -2355,6 +2554,55 @@ export class EmbeddingsResource {
|
|
|
2355
2554
|
});
|
|
2356
2555
|
}
|
|
2357
2556
|
}
|
|
2557
|
+
export class FilesResource {
|
|
2558
|
+
private readonly _client: SdkTransport;
|
|
2559
|
+
constructor(client: SdkTransport) {
|
|
2560
|
+
this._client = client;
|
|
2561
|
+
}
|
|
2562
|
+
content(fileID: string, options?: RequestOptions): APIPromise<Response> {
|
|
2563
|
+
return this._client.get<Response>(`/v1/files/${pathSegment(fileID)}/content`, {
|
|
2564
|
+
...options,
|
|
2565
|
+
headers: {
|
|
2566
|
+
"Accept": "application/octet-stream",
|
|
2567
|
+
...normalizeHeaders(options?.headers)
|
|
2568
|
+
},
|
|
2569
|
+
__binaryResponse: true
|
|
2570
|
+
});
|
|
2571
|
+
}
|
|
2572
|
+
create(body: FileUploadInput, options?: RequestOptions): APIPromise<FileObjectOutput> {
|
|
2573
|
+
return this._client.post<FileObjectOutput>("/v1/files", {
|
|
2574
|
+
...options,
|
|
2575
|
+
body: multipartBody(body, ["file"], ["purpose"])
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
delete(fileID: string, options?: RequestOptions): APIPromise<FileDeletedOutput> {
|
|
2579
|
+
return this._client.delete<FileDeletedOutput>(`/v1/files/${pathSegment(fileID)}`, {
|
|
2580
|
+
...options
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
list(params?: {
|
|
2584
|
+
after?: string;
|
|
2585
|
+
limit?: number;
|
|
2586
|
+
order?: "asc" | "desc";
|
|
2587
|
+
purpose?: FilePurposeInput;
|
|
2588
|
+
}, options?: RequestOptions): APIPromise<FileObjectListOutput> {
|
|
2589
|
+
return this._client.get<FileObjectListOutput>("/v1/files", {
|
|
2590
|
+
...options,
|
|
2591
|
+
query: {
|
|
2592
|
+
after: params?.after,
|
|
2593
|
+
limit: params?.limit,
|
|
2594
|
+
order: params?.order,
|
|
2595
|
+
purpose: params?.purpose,
|
|
2596
|
+
...options?.query
|
|
2597
|
+
}
|
|
2598
|
+
});
|
|
2599
|
+
}
|
|
2600
|
+
retrieve(fileID: string, options?: RequestOptions): APIPromise<FileObjectOutput> {
|
|
2601
|
+
return this._client.get<FileObjectOutput>(`/v1/files/${pathSegment(fileID)}`, {
|
|
2602
|
+
...options
|
|
2603
|
+
});
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2358
2606
|
export class ModelsResource {
|
|
2359
2607
|
private readonly _client: SdkTransport;
|
|
2360
2608
|
constructor(client: SdkTransport) {
|
|
@@ -2414,6 +2662,7 @@ export class ResponsesResource {
|
|
|
2414
2662
|
return promise;
|
|
2415
2663
|
}
|
|
2416
2664
|
retrieve(responseID: string, params?: Omit<{
|
|
2665
|
+
format?: "default" | "short";
|
|
2417
2666
|
starting_after?: number;
|
|
2418
2667
|
stream?: boolean;
|
|
2419
2668
|
}, "stream"> & {
|
|
@@ -2422,12 +2671,14 @@ export class ResponsesResource {
|
|
|
2422
2671
|
output_text: string;
|
|
2423
2672
|
}>;
|
|
2424
2673
|
retrieve(responseID: string, params: Omit<Required<{
|
|
2674
|
+
format?: "default" | "short";
|
|
2425
2675
|
starting_after?: number;
|
|
2426
2676
|
stream?: boolean;
|
|
2427
2677
|
}>, "stream"> & {
|
|
2428
2678
|
stream: true;
|
|
2429
2679
|
}, options?: RequestOptions): APIPromise<Stream<ResponseStreamEventOutput>>;
|
|
2430
2680
|
retrieve(responseID: string, params: Omit<Required<{
|
|
2681
|
+
format?: "default" | "short";
|
|
2431
2682
|
starting_after?: number;
|
|
2432
2683
|
stream?: boolean;
|
|
2433
2684
|
}>, "stream"> & {
|
|
@@ -2436,17 +2687,20 @@ export class ResponsesResource {
|
|
|
2436
2687
|
output_text: string;
|
|
2437
2688
|
}) | Stream<ResponseStreamEventOutput>>;
|
|
2438
2689
|
retrieve(responseID: string, params?: Omit<RequestOptions, "__binaryResponse" | "body" | "defaultBaseURL" | "method" | "path"> & {
|
|
2690
|
+
format?: never;
|
|
2439
2691
|
starting_after?: never;
|
|
2440
2692
|
}, options?: RequestOptions): APIPromise<ResponsesResponseOutput & {
|
|
2441
2693
|
output_text: string;
|
|
2442
2694
|
}>;
|
|
2443
2695
|
retrieve(responseID: string, params?: {
|
|
2696
|
+
format?: "default" | "short";
|
|
2444
2697
|
starting_after?: number;
|
|
2445
2698
|
stream?: boolean;
|
|
2446
2699
|
}, options?: RequestOptions): APIPromise<(ResponsesResponseOutput & {
|
|
2447
2700
|
output_text: string;
|
|
2448
2701
|
}) | Stream<ResponseStreamEventOutput>>;
|
|
2449
2702
|
retrieve(responseID: string, params?: {
|
|
2703
|
+
format?: "default" | "short";
|
|
2450
2704
|
starting_after?: number;
|
|
2451
2705
|
stream?: boolean;
|
|
2452
2706
|
} & RequestOptions, options?: RequestOptions): APIPromise<ResponsesResponseOutput | Stream<ResponseStreamEventOutput>> {
|
|
@@ -2456,10 +2710,11 @@ export class ResponsesResource {
|
|
|
2456
2710
|
...legacyRequestOptions(params, cursor, streamFlag),
|
|
2457
2711
|
...options,
|
|
2458
2712
|
query: {
|
|
2459
|
-
...legacyQuery(params, ["starting_after", "stream"], cursor),
|
|
2713
|
+
...legacyQuery(params, ["format", "starting_after", "stream"], cursor),
|
|
2460
2714
|
...options?.query,
|
|
2461
2715
|
starting_after: cursor,
|
|
2462
|
-
stream: streamFlag
|
|
2716
|
+
stream: streamFlag,
|
|
2717
|
+
format: ownParameter(params, "format")
|
|
2463
2718
|
},
|
|
2464
2719
|
stream: streamFlag === true
|
|
2465
2720
|
});
|
|
@@ -2566,22 +2821,26 @@ export class SkillsResource {
|
|
|
2566
2821
|
}
|
|
2567
2822
|
export class PerplexitySdk {
|
|
2568
2823
|
readonly async: AsyncResource;
|
|
2824
|
+
readonly batches: BatchesResource;
|
|
2569
2825
|
readonly browser: BrowserResource;
|
|
2570
2826
|
readonly chat: ChatResource;
|
|
2571
2827
|
readonly contextualizedEmbeddings: ContextualizedEmbeddingsResource;
|
|
2572
2828
|
readonly decisions: DecisionsResource;
|
|
2573
2829
|
readonly embeddings: EmbeddingsResource;
|
|
2830
|
+
readonly files: FilesResource;
|
|
2574
2831
|
readonly models: ModelsResource;
|
|
2575
2832
|
readonly responses: ResponsesResource;
|
|
2576
2833
|
readonly search: SearchResource;
|
|
2577
2834
|
readonly skills: SkillsResource;
|
|
2578
2835
|
constructor(client: SdkTransport) {
|
|
2579
2836
|
this.async = new AsyncResource(client);
|
|
2837
|
+
this.batches = new BatchesResource(client);
|
|
2580
2838
|
this.browser = new BrowserResource(client);
|
|
2581
2839
|
this.chat = new ChatResource(client);
|
|
2582
2840
|
this.contextualizedEmbeddings = new ContextualizedEmbeddingsResource(client);
|
|
2583
2841
|
this.decisions = new DecisionsResource(client);
|
|
2584
2842
|
this.embeddings = new EmbeddingsResource(client);
|
|
2843
|
+
this.files = new FilesResource(client);
|
|
2585
2844
|
this.models = new ModelsResource(client);
|
|
2586
2845
|
this.responses = new ResponsesResource(client);
|
|
2587
2846
|
this.search = new SearchResource(client);
|
|
@@ -2590,6 +2849,8 @@ export class PerplexitySdk {
|
|
|
2590
2849
|
}
|
|
2591
2850
|
export class Async extends AsyncResource {
|
|
2592
2851
|
}
|
|
2852
|
+
export class Batches extends BatchesResource {
|
|
2853
|
+
}
|
|
2593
2854
|
export class Browser extends BrowserResource {
|
|
2594
2855
|
}
|
|
2595
2856
|
export class Chat extends ChatResource {
|
|
@@ -2600,6 +2861,8 @@ export class Decisions extends DecisionsResource {
|
|
|
2600
2861
|
}
|
|
2601
2862
|
export class Embeddings extends EmbeddingsResource {
|
|
2602
2863
|
}
|
|
2864
|
+
export class Files extends FilesResource {
|
|
2865
|
+
}
|
|
2603
2866
|
export class Models extends ModelsResource {
|
|
2604
2867
|
}
|
|
2605
2868
|
export class Responses extends ResponsesResource {
|
|
@@ -2610,6 +2873,9 @@ export class Skills extends SkillsResource {
|
|
|
2610
2873
|
}
|
|
2611
2874
|
export type Annotation = AnnotationOutput;
|
|
2612
2875
|
export type APIPublicSearchResult = ApiPublicSearchResultOutput;
|
|
2876
|
+
export type Batch = BatchOutput;
|
|
2877
|
+
export type BatchCreateParams = BatchCreateRequestInput;
|
|
2878
|
+
export type BatchListResponse = BatchListOutput;
|
|
2613
2879
|
export type BrowserSessionResponse = BrowserSessionResponseOutput;
|
|
2614
2880
|
export type ChatMessageInput = ChatMessageInputInput;
|
|
2615
2881
|
export type ChatMessageOutput = ChatMessageOutputOutput;
|
|
@@ -2627,6 +2893,10 @@ export type EmbeddingCreateResponse = EmbeddingsResponseOutput;
|
|
|
2627
2893
|
export type EmbeddingObject = EmbeddingObjectOutput;
|
|
2628
2894
|
export type EmbeddingsUsage = EmbeddingsUsageOutput;
|
|
2629
2895
|
export type ErrorInfo = ErrorInfoOutput;
|
|
2896
|
+
export type FileCreateParams = FileUploadInput;
|
|
2897
|
+
export type FileDeleted = FileDeletedOutput;
|
|
2898
|
+
export type FileListResponse = FileObjectListOutput;
|
|
2899
|
+
export type FileObject = FileObjectOutput;
|
|
2630
2900
|
export type FunctionCallOutputItem = FunctionCallOutputItemOutput;
|
|
2631
2901
|
export type FunctionTool = FunctionToolInput;
|
|
2632
2902
|
export type ImageResult = ImageResultOutput;
|
|
@@ -2684,6 +2954,11 @@ export namespace Async {
|
|
|
2684
2954
|
}
|
|
2685
2955
|
}
|
|
2686
2956
|
}
|
|
2957
|
+
export namespace Batches {
|
|
2958
|
+
export type Batch = BatchOutput;
|
|
2959
|
+
export type BatchCreateParams = BatchCreateRequestInput;
|
|
2960
|
+
export type BatchListResponse = BatchListOutput;
|
|
2961
|
+
}
|
|
2687
2962
|
export namespace Browser {
|
|
2688
2963
|
export class Sessions extends BrowserSessionsResource {
|
|
2689
2964
|
}
|
|
@@ -2727,6 +3002,12 @@ export namespace Embeddings {
|
|
|
2727
3002
|
export type EmbeddingCreateParams = EmbeddingsRequestInput;
|
|
2728
3003
|
export type EmbeddingCreateResponse = EmbeddingsResponseOutput;
|
|
2729
3004
|
}
|
|
3005
|
+
export namespace Files {
|
|
3006
|
+
export type FileCreateParams = FileUploadInput;
|
|
3007
|
+
export type FileDeleted = FileDeletedOutput;
|
|
3008
|
+
export type FileListResponse = FileObjectListOutput;
|
|
3009
|
+
export type FileObject = FileObjectOutput;
|
|
3010
|
+
}
|
|
2730
3011
|
export namespace Models {
|
|
2731
3012
|
export type Model = ModelOutput;
|
|
2732
3013
|
export type ModelListResponse = Awaited<ReturnType<ModelsResource["list"]>>;
|
package/src/generated/runtime.ts
CHANGED
|
@@ -57,8 +57,9 @@ export type SdkTransport = {
|
|
|
57
57
|
|
|
58
58
|
// Builds form data from the schema's fields only; other keys are not sent.
|
|
59
59
|
export function multipartBody(
|
|
60
|
-
body: Record<string, Blob | undefined>,
|
|
60
|
+
body: Record<string, Blob | string | undefined>,
|
|
61
61
|
fields: readonly string[],
|
|
62
|
+
textFields: readonly string[] = [],
|
|
62
63
|
): FormData {
|
|
63
64
|
const form = new FormData();
|
|
64
65
|
for (const name of fields) {
|
|
@@ -72,6 +73,15 @@ export function multipartBody(
|
|
|
72
73
|
}
|
|
73
74
|
form.append(name, file);
|
|
74
75
|
}
|
|
76
|
+
for (const name of textFields) {
|
|
77
|
+
if (!Object.prototype.hasOwnProperty.call(body, name)) continue;
|
|
78
|
+
const value = body[name];
|
|
79
|
+
if (value === undefined) continue;
|
|
80
|
+
if (typeof value !== 'string') {
|
|
81
|
+
throw new TypeError(`Multipart field ${name} must be a string.`);
|
|
82
|
+
}
|
|
83
|
+
form.append(name, value);
|
|
84
|
+
}
|
|
75
85
|
return form;
|
|
76
86
|
}
|
|
77
87
|
|
package/src/resources/client.ts
CHANGED
|
@@ -2,11 +2,13 @@ import * as API from '../generated/api.js';
|
|
|
2
2
|
import type { SdkTransport } from '../generated/api.js';
|
|
3
3
|
export interface ClientResources {
|
|
4
4
|
readonly async: API.Async;
|
|
5
|
+
readonly batches: API.Batches;
|
|
5
6
|
readonly browser: API.Browser;
|
|
6
7
|
readonly chat: API.Chat;
|
|
7
8
|
readonly contextualizedEmbeddings: API.ContextualizedEmbeddings;
|
|
8
9
|
readonly decisions: API.Decisions;
|
|
9
10
|
readonly embeddings: API.Embeddings;
|
|
11
|
+
readonly files: API.Files;
|
|
10
12
|
readonly models: API.Models;
|
|
11
13
|
readonly responses: API.Responses;
|
|
12
14
|
readonly search: API.Search;
|
|
@@ -14,11 +16,13 @@ export interface ClientResources {
|
|
|
14
16
|
}
|
|
15
17
|
export const clientResourceClasses = {
|
|
16
18
|
Async: API.Async,
|
|
19
|
+
Batches: API.Batches,
|
|
17
20
|
Browser: API.Browser,
|
|
18
21
|
Chat: API.Chat,
|
|
19
22
|
ContextualizedEmbeddings: API.ContextualizedEmbeddings,
|
|
20
23
|
Decisions: API.Decisions,
|
|
21
24
|
Embeddings: API.Embeddings,
|
|
25
|
+
Files: API.Files,
|
|
22
26
|
Models: API.Models,
|
|
23
27
|
Responses: API.Responses,
|
|
24
28
|
Search: API.Search,
|
|
@@ -27,11 +31,13 @@ export const clientResourceClasses = {
|
|
|
27
31
|
export function createClientResources(client: SdkTransport): ClientResources {
|
|
28
32
|
return {
|
|
29
33
|
async: new API.Async(client),
|
|
34
|
+
batches: new API.Batches(client),
|
|
30
35
|
browser: new API.Browser(client),
|
|
31
36
|
chat: new API.Chat(client),
|
|
32
37
|
contextualizedEmbeddings: new API.ContextualizedEmbeddings(client),
|
|
33
38
|
decisions: new API.Decisions(client),
|
|
34
39
|
embeddings: new API.Embeddings(client),
|
|
40
|
+
files: new API.Files(client),
|
|
35
41
|
models: new API.Models(client),
|
|
36
42
|
responses: new API.Responses(client),
|
|
37
43
|
search: new API.Search(client),
|
|
@@ -43,6 +49,10 @@ declare module '../client.js' {
|
|
|
43
49
|
}
|
|
44
50
|
namespace Perplexity {
|
|
45
51
|
export import Async = API.Async;
|
|
52
|
+
export import Batches = API.Batches;
|
|
53
|
+
export type Batch = API.Batches.Batch;
|
|
54
|
+
export type BatchCreateParams = API.Batches.BatchCreateParams;
|
|
55
|
+
export type BatchListResponse = API.Batches.BatchListResponse;
|
|
46
56
|
export import Browser = API.Browser;
|
|
47
57
|
export type SessionCreateParams = API.Browser.SessionCreateParams;
|
|
48
58
|
export import Chat = API.Chat;
|
|
@@ -61,6 +71,11 @@ declare module '../client.js' {
|
|
|
61
71
|
export import Embeddings = API.Embeddings;
|
|
62
72
|
export type EmbeddingCreateParams = API.Embeddings.EmbeddingCreateParams;
|
|
63
73
|
export type EmbeddingCreateResponse = API.Embeddings.EmbeddingCreateResponse;
|
|
74
|
+
export import Files = API.Files;
|
|
75
|
+
export type FileCreateParams = API.Files.FileCreateParams;
|
|
76
|
+
export type FileDeleted = API.Files.FileDeleted;
|
|
77
|
+
export type FileListResponse = API.Files.FileListResponse;
|
|
78
|
+
export type FileObject = API.Files.FileObject;
|
|
64
79
|
export import Models = API.Models;
|
|
65
80
|
export type Model = API.Models.Model;
|
|
66
81
|
export type ModelListResponse = API.Models.ModelListResponse;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as API from '../generated/api.js';
|
|
2
|
+
export import Files = API.Files;
|
|
3
|
+
export type FileCreateParams = API.Files.FileCreateParams;
|
|
4
|
+
export type FileDeleted = API.Files.FileDeleted;
|
|
5
|
+
export type FileListResponse = API.Files.FileListResponse;
|
|
6
|
+
export type FileObject = API.Files.FileObject;
|
package/src/resources/index.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export * from './shared.js';
|
|
2
2
|
export { Async } from './async/async.js';
|
|
3
|
+
export { Batches, type Batch, type BatchCreateParams, type BatchListResponse } from './batches.js';
|
|
3
4
|
export { Browser, type SessionCreateParams } from './browser/browser.js';
|
|
4
5
|
export { Chat, type CompletionCreateParams, type CompletionCreateParamsBase, type CompletionCreateParamsNonStreaming, type CompletionCreateParamsStreaming, type StreamChunk } from './chat/chat.js';
|
|
5
6
|
export { ContextualizedEmbeddings, type ContextualizedEmbeddingCreateParams, type ContextualizedEmbeddingCreateResponse } from './contextualized-embeddings.js';
|
|
6
7
|
export { Decisions, type DecisionAnswer, type DecisionCreateParams, type DecisionCreateResponse, type DecisionQuestion } from './decisions.js';
|
|
7
8
|
export { Embeddings, type EmbeddingCreateParams, type EmbeddingCreateResponse } from './embeddings.js';
|
|
9
|
+
export { Files, type FileCreateParams, type FileDeleted, type FileListResponse, type FileObject } from './files.js';
|
|
8
10
|
export { Models, type Model, type ModelListResponse } from './models.js';
|
|
9
11
|
export { Responses, type Annotation, type ContentPart, type ErrorInfo, type FileContentParams, type FunctionCallOutputItem, type FunctionTool, type ImageResult, type ImageSearchResultsOutputItem, type ImageSearchTool, type InputItem, type OutputItem, type ResponseCancelResponse, type ResponseCreateParams, type ResponseCreateParamsBase, type ResponseCreateParamsNonStreaming, type ResponseCreateParamsStreaming, type ResponseCreateResponse, type ResponseFile, type ResponseFileList, type ResponseRetrieveResponse, type ResponsesCreateParams, type ResponseStreamChunk, type ResponsesUsage } from './responses/responses.js';
|
|
10
12
|
export { Search, type SearchCreateParams, type SearchCreateResponse } from './search.js';
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type * as API from '../generated/api.js';
|
|
2
2
|
export type Annotation = API.Annotation;
|
|
3
3
|
export type APIPublicSearchResult = API.APIPublicSearchResult;
|
|
4
|
+
export type Batch = API.Batch;
|
|
5
|
+
export type BatchCreateParams = API.BatchCreateParams;
|
|
6
|
+
export type BatchListResponse = API.BatchListResponse;
|
|
4
7
|
export type BrowserSessionResponse = API.BrowserSessionResponse;
|
|
5
8
|
export type ChatMessageInput = API.ChatMessageInput;
|
|
6
9
|
export type ChatMessageOutput = API.ChatMessageOutput;
|
|
@@ -18,6 +21,10 @@ export type EmbeddingCreateResponse = API.EmbeddingCreateResponse;
|
|
|
18
21
|
export type EmbeddingObject = API.EmbeddingObject;
|
|
19
22
|
export type EmbeddingsUsage = API.EmbeddingsUsage;
|
|
20
23
|
export type ErrorInfo = API.ErrorInfo;
|
|
24
|
+
export type FileCreateParams = API.FileCreateParams;
|
|
25
|
+
export type FileDeleted = API.FileDeleted;
|
|
26
|
+
export type FileListResponse = API.FileListResponse;
|
|
27
|
+
export type FileObject = API.FileObject;
|
|
21
28
|
export type FunctionCallOutputItem = API.FunctionCallOutputItem;
|
|
22
29
|
export type FunctionTool = API.FunctionTool;
|
|
23
30
|
export type ImageResult = API.ImageResult;
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.40.0'; // x-release-please-version
|