-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbatch.ts
More file actions
102 lines (85 loc) · 2.66 KB
/
batch.ts
File metadata and controls
102 lines (85 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import * as DocumentsAPI from './documents';
import * as ChunksAPI from './retrieve/chunks';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
export class Batch extends APIResource {
/**
* Retrieve specific chunks by their document ID and chunk number in a single batch
* operation.
*/
retrieveChunks(
body: BatchRetrieveChunksParams,
options?: RequestOptions,
): APIPromise<BatchRetrieveChunksResponse> {
return this._client.post('/batch/chunks', { body, ...options });
}
/**
* Retrieve multiple documents by their IDs in a single batch operation.
*/
retrieveDocuments(
body: BatchRetrieveDocumentsParams,
options?: RequestOptions,
): APIPromise<BatchRetrieveDocumentsResponse> {
return this._client.post('/batch/documents', { body, ...options });
}
}
export type BatchRetrieveChunksResponse = Array<ChunksAPI.ChunkResult>;
export type BatchRetrieveDocumentsResponse = Array<DocumentsAPI.Document>;
export interface BatchRetrieveChunksParams {
/**
* Optional end-user scope for the operation
*/
end_user_id?: string | null;
/**
* Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list
* of paths.
*/
folder_name?: string | Array<string> | null;
/**
* Output format for image chunks in retrieval results.
*/
output_format?: 'base64' | 'url' | 'text' | null;
/**
* List of chunk sources to retrieve
*/
sources?: Array<BatchRetrieveChunksParams.Source>;
/**
* Whether to use ColPali embeddings for retrieval
*/
use_colpali?: boolean | null;
}
export namespace BatchRetrieveChunksParams {
/**
* Source information for a chunk used in completion
*/
export interface Source {
chunk_number: number;
document_id: string;
score?: number | null;
}
}
export interface BatchRetrieveDocumentsParams {
/**
* List of document IDs to retrieve
*/
document_ids?: Array<string>;
/**
* Optional end-user scope for the operation
*/
end_user_id?: string | null;
/**
* Optional folder scope. Accepts a folder PATH (e.g., '/Company/Reports') or list
* of paths.
*/
folder_name?: string | Array<string> | null;
}
export declare namespace Batch {
export {
type BatchRetrieveChunksResponse as BatchRetrieveChunksResponse,
type BatchRetrieveDocumentsResponse as BatchRetrieveDocumentsResponse,
type BatchRetrieveChunksParams as BatchRetrieveChunksParams,
type BatchRetrieveDocumentsParams as BatchRetrieveDocumentsParams,
};
}