@perplexity-ai/perplexity_ai 0.39.1 → 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 +12 -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 +227 -22
- package/dist/generated/api.d.ts.map +1 -1
- package/dist/generated/api.js +84 -0
- 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 +292 -22
- 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
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;
|
|
@@ -2311,6 +2465,47 @@ export class AsyncResource {
|
|
|
2311
2465
|
this.chat = new AsyncChatResource(client);
|
|
2312
2466
|
}
|
|
2313
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
|
+
}
|
|
2314
2509
|
export class BrowserResource {
|
|
2315
2510
|
readonly sessions: BrowserSessionsResource;
|
|
2316
2511
|
constructor(client: SdkTransport) {
|
|
@@ -2359,6 +2554,55 @@ export class EmbeddingsResource {
|
|
|
2359
2554
|
});
|
|
2360
2555
|
}
|
|
2361
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
|
+
}
|
|
2362
2606
|
export class ModelsResource {
|
|
2363
2607
|
private readonly _client: SdkTransport;
|
|
2364
2608
|
constructor(client: SdkTransport) {
|
|
@@ -2577,22 +2821,26 @@ export class SkillsResource {
|
|
|
2577
2821
|
}
|
|
2578
2822
|
export class PerplexitySdk {
|
|
2579
2823
|
readonly async: AsyncResource;
|
|
2824
|
+
readonly batches: BatchesResource;
|
|
2580
2825
|
readonly browser: BrowserResource;
|
|
2581
2826
|
readonly chat: ChatResource;
|
|
2582
2827
|
readonly contextualizedEmbeddings: ContextualizedEmbeddingsResource;
|
|
2583
2828
|
readonly decisions: DecisionsResource;
|
|
2584
2829
|
readonly embeddings: EmbeddingsResource;
|
|
2830
|
+
readonly files: FilesResource;
|
|
2585
2831
|
readonly models: ModelsResource;
|
|
2586
2832
|
readonly responses: ResponsesResource;
|
|
2587
2833
|
readonly search: SearchResource;
|
|
2588
2834
|
readonly skills: SkillsResource;
|
|
2589
2835
|
constructor(client: SdkTransport) {
|
|
2590
2836
|
this.async = new AsyncResource(client);
|
|
2837
|
+
this.batches = new BatchesResource(client);
|
|
2591
2838
|
this.browser = new BrowserResource(client);
|
|
2592
2839
|
this.chat = new ChatResource(client);
|
|
2593
2840
|
this.contextualizedEmbeddings = new ContextualizedEmbeddingsResource(client);
|
|
2594
2841
|
this.decisions = new DecisionsResource(client);
|
|
2595
2842
|
this.embeddings = new EmbeddingsResource(client);
|
|
2843
|
+
this.files = new FilesResource(client);
|
|
2596
2844
|
this.models = new ModelsResource(client);
|
|
2597
2845
|
this.responses = new ResponsesResource(client);
|
|
2598
2846
|
this.search = new SearchResource(client);
|
|
@@ -2601,6 +2849,8 @@ export class PerplexitySdk {
|
|
|
2601
2849
|
}
|
|
2602
2850
|
export class Async extends AsyncResource {
|
|
2603
2851
|
}
|
|
2852
|
+
export class Batches extends BatchesResource {
|
|
2853
|
+
}
|
|
2604
2854
|
export class Browser extends BrowserResource {
|
|
2605
2855
|
}
|
|
2606
2856
|
export class Chat extends ChatResource {
|
|
@@ -2611,6 +2861,8 @@ export class Decisions extends DecisionsResource {
|
|
|
2611
2861
|
}
|
|
2612
2862
|
export class Embeddings extends EmbeddingsResource {
|
|
2613
2863
|
}
|
|
2864
|
+
export class Files extends FilesResource {
|
|
2865
|
+
}
|
|
2614
2866
|
export class Models extends ModelsResource {
|
|
2615
2867
|
}
|
|
2616
2868
|
export class Responses extends ResponsesResource {
|
|
@@ -2621,6 +2873,9 @@ export class Skills extends SkillsResource {
|
|
|
2621
2873
|
}
|
|
2622
2874
|
export type Annotation = AnnotationOutput;
|
|
2623
2875
|
export type APIPublicSearchResult = ApiPublicSearchResultOutput;
|
|
2876
|
+
export type Batch = BatchOutput;
|
|
2877
|
+
export type BatchCreateParams = BatchCreateRequestInput;
|
|
2878
|
+
export type BatchListResponse = BatchListOutput;
|
|
2624
2879
|
export type BrowserSessionResponse = BrowserSessionResponseOutput;
|
|
2625
2880
|
export type ChatMessageInput = ChatMessageInputInput;
|
|
2626
2881
|
export type ChatMessageOutput = ChatMessageOutputOutput;
|
|
@@ -2638,6 +2893,10 @@ export type EmbeddingCreateResponse = EmbeddingsResponseOutput;
|
|
|
2638
2893
|
export type EmbeddingObject = EmbeddingObjectOutput;
|
|
2639
2894
|
export type EmbeddingsUsage = EmbeddingsUsageOutput;
|
|
2640
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;
|
|
2641
2900
|
export type FunctionCallOutputItem = FunctionCallOutputItemOutput;
|
|
2642
2901
|
export type FunctionTool = FunctionToolInput;
|
|
2643
2902
|
export type ImageResult = ImageResultOutput;
|
|
@@ -2695,6 +2954,11 @@ export namespace Async {
|
|
|
2695
2954
|
}
|
|
2696
2955
|
}
|
|
2697
2956
|
}
|
|
2957
|
+
export namespace Batches {
|
|
2958
|
+
export type Batch = BatchOutput;
|
|
2959
|
+
export type BatchCreateParams = BatchCreateRequestInput;
|
|
2960
|
+
export type BatchListResponse = BatchListOutput;
|
|
2961
|
+
}
|
|
2698
2962
|
export namespace Browser {
|
|
2699
2963
|
export class Sessions extends BrowserSessionsResource {
|
|
2700
2964
|
}
|
|
@@ -2738,6 +3002,12 @@ export namespace Embeddings {
|
|
|
2738
3002
|
export type EmbeddingCreateParams = EmbeddingsRequestInput;
|
|
2739
3003
|
export type EmbeddingCreateResponse = EmbeddingsResponseOutput;
|
|
2740
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
|
+
}
|
|
2741
3011
|
export namespace Models {
|
|
2742
3012
|
export type Model = ModelOutput;
|
|
2743
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
|