graphor 0.4.1

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.
Files changed (316) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/LICENSE +201 -0
  3. package/README.md +399 -0
  4. package/api-promise.d.mts +2 -0
  5. package/api-promise.d.mts.map +1 -0
  6. package/api-promise.d.ts +2 -0
  7. package/api-promise.d.ts.map +1 -0
  8. package/api-promise.js +6 -0
  9. package/api-promise.js.map +1 -0
  10. package/api-promise.mjs +2 -0
  11. package/api-promise.mjs.map +1 -0
  12. package/client.d.mts +180 -0
  13. package/client.d.mts.map +1 -0
  14. package/client.d.ts +180 -0
  15. package/client.d.ts.map +1 -0
  16. package/client.js +468 -0
  17. package/client.js.map +1 -0
  18. package/client.mjs +464 -0
  19. package/client.mjs.map +1 -0
  20. package/core/api-promise.d.mts +46 -0
  21. package/core/api-promise.d.mts.map +1 -0
  22. package/core/api-promise.d.ts +46 -0
  23. package/core/api-promise.d.ts.map +1 -0
  24. package/core/api-promise.js +74 -0
  25. package/core/api-promise.js.map +1 -0
  26. package/core/api-promise.mjs +70 -0
  27. package/core/api-promise.mjs.map +1 -0
  28. package/core/error.d.mts +46 -0
  29. package/core/error.d.mts.map +1 -0
  30. package/core/error.d.ts +46 -0
  31. package/core/error.d.ts.map +1 -0
  32. package/core/error.js +113 -0
  33. package/core/error.js.map +1 -0
  34. package/core/error.mjs +97 -0
  35. package/core/error.mjs.map +1 -0
  36. package/core/resource.d.mts +6 -0
  37. package/core/resource.d.mts.map +1 -0
  38. package/core/resource.d.ts +6 -0
  39. package/core/resource.d.ts.map +1 -0
  40. package/core/resource.js +11 -0
  41. package/core/resource.js.map +1 -0
  42. package/core/resource.mjs +7 -0
  43. package/core/resource.mjs.map +1 -0
  44. package/core/uploads.d.mts +3 -0
  45. package/core/uploads.d.mts.map +1 -0
  46. package/core/uploads.d.ts +3 -0
  47. package/core/uploads.d.ts.map +1 -0
  48. package/core/uploads.js +6 -0
  49. package/core/uploads.js.map +1 -0
  50. package/core/uploads.mjs +2 -0
  51. package/core/uploads.mjs.map +1 -0
  52. package/error.d.mts +2 -0
  53. package/error.d.mts.map +1 -0
  54. package/error.d.ts +2 -0
  55. package/error.d.ts.map +1 -0
  56. package/error.js +6 -0
  57. package/error.js.map +1 -0
  58. package/error.mjs +2 -0
  59. package/error.mjs.map +1 -0
  60. package/index.d.mts +6 -0
  61. package/index.d.mts.map +1 -0
  62. package/index.d.ts +6 -0
  63. package/index.d.ts.map +1 -0
  64. package/index.js +30 -0
  65. package/index.js.map +1 -0
  66. package/index.mjs +7 -0
  67. package/index.mjs.map +1 -0
  68. package/internal/builtin-types.d.mts +73 -0
  69. package/internal/builtin-types.d.mts.map +1 -0
  70. package/internal/builtin-types.d.ts +73 -0
  71. package/internal/builtin-types.d.ts.map +1 -0
  72. package/internal/builtin-types.js +4 -0
  73. package/internal/builtin-types.js.map +1 -0
  74. package/internal/builtin-types.mjs +3 -0
  75. package/internal/builtin-types.mjs.map +1 -0
  76. package/internal/detect-platform.d.mts +15 -0
  77. package/internal/detect-platform.d.mts.map +1 -0
  78. package/internal/detect-platform.d.ts +15 -0
  79. package/internal/detect-platform.d.ts.map +1 -0
  80. package/internal/detect-platform.js +162 -0
  81. package/internal/detect-platform.js.map +1 -0
  82. package/internal/detect-platform.mjs +157 -0
  83. package/internal/detect-platform.mjs.map +1 -0
  84. package/internal/errors.d.mts +3 -0
  85. package/internal/errors.d.mts.map +1 -0
  86. package/internal/errors.d.ts +3 -0
  87. package/internal/errors.d.ts.map +1 -0
  88. package/internal/errors.js +41 -0
  89. package/internal/errors.js.map +1 -0
  90. package/internal/errors.mjs +36 -0
  91. package/internal/errors.mjs.map +1 -0
  92. package/internal/headers.d.mts +20 -0
  93. package/internal/headers.d.mts.map +1 -0
  94. package/internal/headers.d.ts +20 -0
  95. package/internal/headers.d.ts.map +1 -0
  96. package/internal/headers.js +79 -0
  97. package/internal/headers.js.map +1 -0
  98. package/internal/headers.mjs +74 -0
  99. package/internal/headers.mjs.map +1 -0
  100. package/internal/parse.d.mts +12 -0
  101. package/internal/parse.d.mts.map +1 -0
  102. package/internal/parse.d.ts +12 -0
  103. package/internal/parse.d.ts.map +1 -0
  104. package/internal/parse.js +40 -0
  105. package/internal/parse.js.map +1 -0
  106. package/internal/parse.mjs +37 -0
  107. package/internal/parse.mjs.map +1 -0
  108. package/internal/request-options.d.mts +75 -0
  109. package/internal/request-options.d.mts.map +1 -0
  110. package/internal/request-options.d.ts +75 -0
  111. package/internal/request-options.d.ts.map +1 -0
  112. package/internal/request-options.js +14 -0
  113. package/internal/request-options.js.map +1 -0
  114. package/internal/request-options.mjs +10 -0
  115. package/internal/request-options.mjs.map +1 -0
  116. package/internal/shim-types.d.mts +17 -0
  117. package/internal/shim-types.d.mts.map +1 -0
  118. package/internal/shim-types.d.ts +17 -0
  119. package/internal/shim-types.d.ts.map +1 -0
  120. package/internal/shim-types.js +4 -0
  121. package/internal/shim-types.js.map +1 -0
  122. package/internal/shim-types.mjs +3 -0
  123. package/internal/shim-types.mjs.map +1 -0
  124. package/internal/shims.d.mts +20 -0
  125. package/internal/shims.d.mts.map +1 -0
  126. package/internal/shims.d.ts +20 -0
  127. package/internal/shims.d.ts.map +1 -0
  128. package/internal/shims.js +92 -0
  129. package/internal/shims.js.map +1 -0
  130. package/internal/shims.mjs +85 -0
  131. package/internal/shims.mjs.map +1 -0
  132. package/internal/to-file.d.mts +45 -0
  133. package/internal/to-file.d.mts.map +1 -0
  134. package/internal/to-file.d.ts +45 -0
  135. package/internal/to-file.d.ts.map +1 -0
  136. package/internal/to-file.js +91 -0
  137. package/internal/to-file.js.map +1 -0
  138. package/internal/to-file.mjs +88 -0
  139. package/internal/to-file.mjs.map +1 -0
  140. package/internal/tslib.js +81 -0
  141. package/internal/tslib.mjs +17 -0
  142. package/internal/types.d.mts +69 -0
  143. package/internal/types.d.mts.map +1 -0
  144. package/internal/types.d.ts +69 -0
  145. package/internal/types.d.ts.map +1 -0
  146. package/internal/types.js +4 -0
  147. package/internal/types.js.map +1 -0
  148. package/internal/types.mjs +3 -0
  149. package/internal/types.mjs.map +1 -0
  150. package/internal/uploads.d.mts +42 -0
  151. package/internal/uploads.d.mts.map +1 -0
  152. package/internal/uploads.d.ts +42 -0
  153. package/internal/uploads.d.ts.map +1 -0
  154. package/internal/uploads.js +141 -0
  155. package/internal/uploads.js.map +1 -0
  156. package/internal/uploads.mjs +131 -0
  157. package/internal/uploads.mjs.map +1 -0
  158. package/internal/utils/base64.d.mts +3 -0
  159. package/internal/utils/base64.d.mts.map +1 -0
  160. package/internal/utils/base64.d.ts +3 -0
  161. package/internal/utils/base64.d.ts.map +1 -0
  162. package/internal/utils/base64.js +38 -0
  163. package/internal/utils/base64.js.map +1 -0
  164. package/internal/utils/base64.mjs +33 -0
  165. package/internal/utils/base64.mjs.map +1 -0
  166. package/internal/utils/bytes.d.mts +4 -0
  167. package/internal/utils/bytes.d.mts.map +1 -0
  168. package/internal/utils/bytes.d.ts +4 -0
  169. package/internal/utils/bytes.d.ts.map +1 -0
  170. package/internal/utils/bytes.js +31 -0
  171. package/internal/utils/bytes.js.map +1 -0
  172. package/internal/utils/bytes.mjs +26 -0
  173. package/internal/utils/bytes.mjs.map +1 -0
  174. package/internal/utils/env.d.mts +9 -0
  175. package/internal/utils/env.d.mts.map +1 -0
  176. package/internal/utils/env.d.ts +9 -0
  177. package/internal/utils/env.d.ts.map +1 -0
  178. package/internal/utils/env.js +22 -0
  179. package/internal/utils/env.js.map +1 -0
  180. package/internal/utils/env.mjs +18 -0
  181. package/internal/utils/env.mjs.map +1 -0
  182. package/internal/utils/log.d.mts +37 -0
  183. package/internal/utils/log.d.mts.map +1 -0
  184. package/internal/utils/log.d.ts +37 -0
  185. package/internal/utils/log.d.ts.map +1 -0
  186. package/internal/utils/log.js +85 -0
  187. package/internal/utils/log.js.map +1 -0
  188. package/internal/utils/log.mjs +79 -0
  189. package/internal/utils/log.mjs.map +1 -0
  190. package/internal/utils/path.d.mts +15 -0
  191. package/internal/utils/path.d.mts.map +1 -0
  192. package/internal/utils/path.d.ts +15 -0
  193. package/internal/utils/path.d.ts.map +1 -0
  194. package/internal/utils/path.js +79 -0
  195. package/internal/utils/path.js.map +1 -0
  196. package/internal/utils/path.mjs +74 -0
  197. package/internal/utils/path.mjs.map +1 -0
  198. package/internal/utils/sleep.d.mts +2 -0
  199. package/internal/utils/sleep.d.mts.map +1 -0
  200. package/internal/utils/sleep.d.ts +2 -0
  201. package/internal/utils/sleep.d.ts.map +1 -0
  202. package/internal/utils/sleep.js +7 -0
  203. package/internal/utils/sleep.js.map +1 -0
  204. package/internal/utils/sleep.mjs +3 -0
  205. package/internal/utils/sleep.mjs.map +1 -0
  206. package/internal/utils/uuid.d.mts +5 -0
  207. package/internal/utils/uuid.d.mts.map +1 -0
  208. package/internal/utils/uuid.d.ts +5 -0
  209. package/internal/utils/uuid.d.ts.map +1 -0
  210. package/internal/utils/uuid.js +19 -0
  211. package/internal/utils/uuid.js.map +1 -0
  212. package/internal/utils/uuid.mjs +15 -0
  213. package/internal/utils/uuid.mjs.map +1 -0
  214. package/internal/utils/values.d.mts +18 -0
  215. package/internal/utils/values.d.mts.map +1 -0
  216. package/internal/utils/values.d.ts +18 -0
  217. package/internal/utils/values.d.ts.map +1 -0
  218. package/internal/utils/values.js +112 -0
  219. package/internal/utils/values.js.map +1 -0
  220. package/internal/utils/values.mjs +94 -0
  221. package/internal/utils/values.mjs.map +1 -0
  222. package/internal/utils.d.mts +7 -0
  223. package/internal/utils.d.mts.map +1 -0
  224. package/internal/utils.d.ts +7 -0
  225. package/internal/utils.d.ts.map +1 -0
  226. package/internal/utils.js +11 -0
  227. package/internal/utils.js.map +1 -0
  228. package/internal/utils.mjs +8 -0
  229. package/internal/utils.mjs.map +1 -0
  230. package/package.json +137 -0
  231. package/resource.d.mts +2 -0
  232. package/resource.d.mts.map +1 -0
  233. package/resource.d.ts +2 -0
  234. package/resource.d.ts.map +1 -0
  235. package/resource.js +6 -0
  236. package/resource.js.map +1 -0
  237. package/resource.mjs +2 -0
  238. package/resource.mjs.map +1 -0
  239. package/resources/index.d.mts +2 -0
  240. package/resources/index.d.mts.map +1 -0
  241. package/resources/index.d.ts +2 -0
  242. package/resources/index.d.ts.map +1 -0
  243. package/resources/index.js +7 -0
  244. package/resources/index.js.map +1 -0
  245. package/resources/index.mjs +3 -0
  246. package/resources/index.mjs.map +1 -0
  247. package/resources/sources.d.mts +418 -0
  248. package/resources/sources.d.mts.map +1 -0
  249. package/resources/sources.d.ts +418 -0
  250. package/resources/sources.d.ts.map +1 -0
  251. package/resources/sources.js +88 -0
  252. package/resources/sources.js.map +1 -0
  253. package/resources/sources.mjs +84 -0
  254. package/resources/sources.mjs.map +1 -0
  255. package/resources.d.mts +2 -0
  256. package/resources.d.mts.map +1 -0
  257. package/resources.d.ts +2 -0
  258. package/resources.d.ts.map +1 -0
  259. package/resources.js +5 -0
  260. package/resources.js.map +1 -0
  261. package/resources.mjs +2 -0
  262. package/resources.mjs.map +1 -0
  263. package/src/api-promise.ts +2 -0
  264. package/src/client.ts +773 -0
  265. package/src/core/README.md +3 -0
  266. package/src/core/api-promise.ts +92 -0
  267. package/src/core/error.ts +130 -0
  268. package/src/core/resource.ts +11 -0
  269. package/src/core/uploads.ts +2 -0
  270. package/src/error.ts +2 -0
  271. package/src/index.ts +22 -0
  272. package/src/internal/README.md +3 -0
  273. package/src/internal/builtin-types.ts +93 -0
  274. package/src/internal/detect-platform.ts +196 -0
  275. package/src/internal/errors.ts +33 -0
  276. package/src/internal/headers.ts +97 -0
  277. package/src/internal/parse.ts +56 -0
  278. package/src/internal/request-options.ts +91 -0
  279. package/src/internal/shim-types.ts +26 -0
  280. package/src/internal/shims.ts +107 -0
  281. package/src/internal/to-file.ts +154 -0
  282. package/src/internal/types.ts +95 -0
  283. package/src/internal/uploads.ts +187 -0
  284. package/src/internal/utils/base64.ts +40 -0
  285. package/src/internal/utils/bytes.ts +32 -0
  286. package/src/internal/utils/env.ts +18 -0
  287. package/src/internal/utils/log.ts +126 -0
  288. package/src/internal/utils/path.ts +88 -0
  289. package/src/internal/utils/sleep.ts +3 -0
  290. package/src/internal/utils/uuid.ts +17 -0
  291. package/src/internal/utils/values.ts +105 -0
  292. package/src/internal/utils.ts +8 -0
  293. package/src/lib/.keep +4 -0
  294. package/src/resource.ts +2 -0
  295. package/src/resources/index.ts +23 -0
  296. package/src/resources/sources.ts +557 -0
  297. package/src/resources.ts +1 -0
  298. package/src/tsconfig.json +11 -0
  299. package/src/uploads.ts +2 -0
  300. package/src/version.ts +1 -0
  301. package/uploads.d.mts +2 -0
  302. package/uploads.d.mts.map +1 -0
  303. package/uploads.d.ts +2 -0
  304. package/uploads.d.ts.map +1 -0
  305. package/uploads.js +6 -0
  306. package/uploads.js.map +1 -0
  307. package/uploads.mjs +2 -0
  308. package/uploads.mjs.map +1 -0
  309. package/version.d.mts +2 -0
  310. package/version.d.mts.map +1 -0
  311. package/version.d.ts +2 -0
  312. package/version.d.ts.map +1 -0
  313. package/version.js +5 -0
  314. package/version.js.map +1 -0
  315. package/version.mjs +2 -0
  316. package/version.mjs.map +1 -0
@@ -0,0 +1,418 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { type Uploadable } from "../core/uploads.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Sources extends APIResource {
6
+ /**
7
+ * Get the source nodes of the knowledge graph for public access.
8
+ */
9
+ list(options?: RequestOptions): APIPromise<SourceListResponse>;
10
+ /**
11
+ * Delete a source from the project for public access.
12
+ *
13
+ * Accepts either file_id (preferred) or file_name (deprecated) as identifier.
14
+ */
15
+ delete(body: SourceDeleteParams, options?: RequestOptions): APIPromise<SourceDeleteResponse>;
16
+ /**
17
+ * Public endpoint to ask questions about the sources.
18
+ */
19
+ ask(body: SourceAskParams, options?: RequestOptions): APIPromise<SourceAskResponse>;
20
+ /**
21
+ * Run a one-off public extraction for files using the provided output schema.
22
+ */
23
+ extract(body: SourceExtractParams, options?: RequestOptions): APIPromise<SourceExtractResponse>;
24
+ /**
25
+ * Loads elements from a file with optional pagination for public access.
26
+ *
27
+ * Accepts either file_id (preferred) or file_name (deprecated) as identifier.
28
+ */
29
+ loadElements(body: SourceLoadElementsParams, options?: RequestOptions): APIPromise<SourceLoadElementsResponse>;
30
+ /**
31
+ * Process/parse an existing source.
32
+ *
33
+ * Accepts either file_id (preferred) or file_name (deprecated) as identifier.
34
+ */
35
+ parse(body: SourceParseParams, options?: RequestOptions): APIPromise<PublicSource>;
36
+ /**
37
+ * Public endpoint to retrieve relevant chunks from the prebuild RAG store. Uses
38
+ * Google File Search with grounding to find relevant document chunks.
39
+ *
40
+ * Accepts either file_ids (preferred) or file_names (deprecated) as identifier.
41
+ */
42
+ retrieveChunks(body: SourceRetrieveChunksParams, options?: RequestOptions): APIPromise<SourceRetrieveChunksResponse>;
43
+ /**
44
+ * Upload
45
+ */
46
+ upload(body: SourceUploadParams, options?: RequestOptions): APIPromise<PublicSource>;
47
+ /**
48
+ * Public endpoint to process a source from a GitHub repository using synchronous
49
+ * ingestion.
50
+ */
51
+ uploadGitHub(body: SourceUploadGitHubParams, options?: RequestOptions): APIPromise<PublicSource>;
52
+ /**
53
+ * Public endpoint to upload and process a source from a URL. Triggers background
54
+ * ingestion and returns immediately.
55
+ */
56
+ uploadURL(body: SourceUploadURLParams, options?: RequestOptions): APIPromise<PublicSource>;
57
+ /**
58
+ * Public endpoint to process a source from a YouTube video using synchronous
59
+ * ingestion.
60
+ */
61
+ uploadYoutube(body: SourceUploadYoutubeParams, options?: RequestOptions): APIPromise<PublicSource>;
62
+ }
63
+ export type PartitionMethod = 'basic' | 'hi_res' | 'hi_res_ft' | 'mai' | 'graphorlm' | 'ocr' | 'advanced' | 'yolox';
64
+ export interface PublicSource {
65
+ file_name: string;
66
+ file_size: number;
67
+ file_source: string;
68
+ file_type: string;
69
+ message: string;
70
+ project_id: string;
71
+ project_name: string;
72
+ status: string;
73
+ /**
74
+ * Unique identifier for the source
75
+ */
76
+ file_id?: string | null;
77
+ partition_method?: PartitionMethod | null;
78
+ }
79
+ export type SourceListResponse = Array<PublicSource>;
80
+ export interface SourceDeleteResponse {
81
+ /**
82
+ * The name of the deleted file
83
+ */
84
+ file_name: string;
85
+ /**
86
+ * The message of the deletion
87
+ */
88
+ message: string;
89
+ /**
90
+ * The ID of the project
91
+ */
92
+ project_id: string;
93
+ /**
94
+ * The name of the project
95
+ */
96
+ project_name: string;
97
+ /**
98
+ * The status of the deletion
99
+ */
100
+ status: string;
101
+ /**
102
+ * Unique identifier for the source
103
+ */
104
+ file_id?: string | null;
105
+ }
106
+ export interface SourceAskResponse {
107
+ /**
108
+ * The answer to the question. When output_schema is provided, this will be a short
109
+ * status message and the structured data will be in structured_output (and the raw
110
+ * JSON-text from Passo A in raw_json).
111
+ */
112
+ answer: string;
113
+ /**
114
+ * Conversation identifier used to maintain memory context
115
+ */
116
+ conversation_id?: string | null;
117
+ /**
118
+ * Optional raw JSON-text produced by the sources model before
119
+ * validation/correction.
120
+ */
121
+ raw_json?: string | null;
122
+ /**
123
+ * Optional structured output (object) validated against the requested
124
+ * output_schema.
125
+ */
126
+ structured_output?: {
127
+ [key: string]: unknown;
128
+ } | null;
129
+ }
130
+ export interface SourceExtractResponse {
131
+ /**
132
+ * List of file names used for extraction
133
+ */
134
+ file_names: Array<string>;
135
+ /**
136
+ * List of file IDs used for extraction
137
+ */
138
+ file_ids?: Array<string> | null;
139
+ /**
140
+ * Raw JSON-text produced by the model before validation/correction.
141
+ */
142
+ raw_json?: string | null;
143
+ /**
144
+ * Structured output (object) matching the requested output_schema.
145
+ */
146
+ structured_output?: {
147
+ [key: string]: unknown;
148
+ } | null;
149
+ }
150
+ export interface SourceLoadElementsResponse {
151
+ /**
152
+ * List of items in the current page
153
+ */
154
+ items: Array<SourceLoadElementsResponse.Item>;
155
+ /**
156
+ * Total number of items
157
+ */
158
+ total: number;
159
+ /**
160
+ * Current page
161
+ */
162
+ page?: number | null;
163
+ /**
164
+ * Items per page
165
+ */
166
+ page_size?: number | null;
167
+ /**
168
+ * Total number of pages
169
+ */
170
+ total_pages?: number | null;
171
+ }
172
+ export declare namespace SourceLoadElementsResponse {
173
+ /**
174
+ * Class for storing a piece of text and associated metadata.
175
+ *
176
+ * Example:
177
+ *
178
+ * .. code-block:: python
179
+ *
180
+ * from langchain_core.documents import Document
181
+ *
182
+ * document = Document(
183
+ * page_content="Hello, world!",
184
+ * metadata={"source": "https://example.com"}
185
+ * )
186
+ */
187
+ interface Item {
188
+ page_content: string;
189
+ id?: string | null;
190
+ metadata?: {
191
+ [key: string]: unknown;
192
+ };
193
+ type?: 'Document';
194
+ }
195
+ }
196
+ export interface SourceRetrieveChunksResponse {
197
+ /**
198
+ * The original search query
199
+ */
200
+ query: string;
201
+ /**
202
+ * Total number of chunks retrieved
203
+ */
204
+ total: number;
205
+ /**
206
+ * List of retrieved chunks
207
+ */
208
+ chunks?: Array<SourceRetrieveChunksResponse.Chunk>;
209
+ }
210
+ export declare namespace SourceRetrieveChunksResponse {
211
+ interface Chunk {
212
+ /**
213
+ * The text content of the chunk
214
+ */
215
+ text: string;
216
+ /**
217
+ * The unique identifier of the source file
218
+ */
219
+ file_id?: string | null;
220
+ /**
221
+ * The source file name
222
+ */
223
+ file_name?: string | null;
224
+ /**
225
+ * Additional metadata for the chunk
226
+ */
227
+ metadata?: {
228
+ [key: string]: unknown;
229
+ } | null;
230
+ /**
231
+ * The page number of the chunk
232
+ */
233
+ page_number?: number | null;
234
+ /**
235
+ * The relevance score of the chunk
236
+ */
237
+ score?: number | null;
238
+ }
239
+ }
240
+ export interface SourceDeleteParams {
241
+ /**
242
+ * Unique identifier for the source (preferred)
243
+ */
244
+ file_id?: string | null;
245
+ /**
246
+ * The name of the file to delete (deprecated, use file_id)
247
+ */
248
+ file_name?: string | null;
249
+ }
250
+ export interface SourceAskParams {
251
+ /**
252
+ * The question to ask about the sources
253
+ */
254
+ question: string;
255
+ /**
256
+ * Conversation identifier to maintain memory context
257
+ */
258
+ conversation_id?: string | null;
259
+ /**
260
+ * Optional list of file IDs to restrict search to one or more documents
261
+ * (preferred)
262
+ */
263
+ file_ids?: Array<string> | null;
264
+ /**
265
+ * Optional list of file display names to restrict search to one or more documents
266
+ * (deprecated, use file_ids)
267
+ */
268
+ file_names?: Array<string> | null;
269
+ /**
270
+ * Optional JSON Schema used to request a structured output. When provided, the
271
+ * system will first ask the sources model to output JSON-text, then
272
+ * validate/correct it with gemini-3-flash-preview.
273
+ */
274
+ output_schema?: {
275
+ [key: string]: unknown;
276
+ } | null;
277
+ /**
278
+ * When true, starts a new conversation and ignores history
279
+ */
280
+ reset?: boolean | null;
281
+ /**
282
+ * Controls model and thinking configuration: 'fast', 'balanced', 'accurate'
283
+ */
284
+ thinking_level?: 'fast' | 'balanced' | 'accurate' | null;
285
+ }
286
+ export interface SourceExtractParams {
287
+ /**
288
+ * JSON Schema used to request a structured output. The system will extract data
289
+ * according to this schema.
290
+ */
291
+ output_schema: {
292
+ [key: string]: unknown;
293
+ };
294
+ /**
295
+ * User instruction to guide the extraction
296
+ */
297
+ user_instruction: string;
298
+ /**
299
+ * List of file IDs to extract from (preferred)
300
+ */
301
+ file_ids?: Array<string> | null;
302
+ /**
303
+ * List of file names to extract from (deprecated, use file_ids)
304
+ */
305
+ file_names?: Array<string> | null;
306
+ /**
307
+ * Controls model and thinking configuration: 'fast', 'balanced', 'accurate'
308
+ */
309
+ thinking_level?: 'fast' | 'balanced' | 'accurate' | null;
310
+ }
311
+ export interface SourceLoadElementsParams {
312
+ /**
313
+ * Unique identifier for the source (preferred)
314
+ */
315
+ file_id?: string | null;
316
+ /**
317
+ * The name of the file (deprecated, use file_id)
318
+ */
319
+ file_name?: string | null;
320
+ /**
321
+ * The filter of the elements
322
+ */
323
+ filter?: SourceLoadElementsParams.Filter | null;
324
+ /**
325
+ * Current page number
326
+ */
327
+ page?: number | null;
328
+ /**
329
+ * Number of items per page
330
+ */
331
+ page_size?: number | null;
332
+ }
333
+ export declare namespace SourceLoadElementsParams {
334
+ /**
335
+ * The filter of the elements
336
+ */
337
+ interface Filter {
338
+ /**
339
+ * The elements to remove
340
+ */
341
+ elementsToRemove?: Array<string> | null;
342
+ /**
343
+ * The page numbers of the elements
344
+ */
345
+ page_numbers?: Array<number> | null;
346
+ /**
347
+ * The type of the element
348
+ */
349
+ type?: string | null;
350
+ }
351
+ }
352
+ export interface SourceParseParams {
353
+ /**
354
+ * Unique identifier for the source (preferred)
355
+ */
356
+ file_id?: string | null;
357
+ /**
358
+ * The name of the file (deprecated, use file_id)
359
+ */
360
+ file_name?: string | null;
361
+ /**
362
+ * The method used to partition the file
363
+ */
364
+ partition_method?: 'basic' | 'hi_res' | 'hi_res_ft' | 'mai' | 'graphorlm';
365
+ }
366
+ export interface SourceRetrieveChunksParams {
367
+ /**
368
+ * The search query to retrieve relevant chunks
369
+ */
370
+ query: string;
371
+ /**
372
+ * Optional list of file IDs to restrict retrieval to one or more documents
373
+ * (preferred)
374
+ */
375
+ file_ids?: Array<string> | null;
376
+ /**
377
+ * Optional list of file names to restrict retrieval to one or more documents
378
+ * (deprecated, use file_ids)
379
+ */
380
+ file_names?: Array<string> | null;
381
+ }
382
+ export interface SourceUploadParams {
383
+ file: Uploadable;
384
+ /**
385
+ * Partition methods available for public API endpoints.
386
+ */
387
+ partition_method?: 'basic' | 'hi_res' | 'hi_res_ft' | 'mai' | 'graphorlm' | null;
388
+ }
389
+ export interface SourceUploadGitHubParams {
390
+ /**
391
+ * The url of the github repository
392
+ */
393
+ url: string;
394
+ }
395
+ export interface SourceUploadURLParams {
396
+ /**
397
+ * The url of the source
398
+ */
399
+ url: string;
400
+ /**
401
+ * Whether to crawl urls from the source
402
+ */
403
+ crawlUrls?: boolean;
404
+ /**
405
+ * Partition methods available for public API endpoints.
406
+ */
407
+ partition_method?: 'basic' | 'hi_res' | 'hi_res_ft' | 'mai' | 'graphorlm' | null;
408
+ }
409
+ export interface SourceUploadYoutubeParams {
410
+ /**
411
+ * The url of the youtube video
412
+ */
413
+ url: string;
414
+ }
415
+ export declare namespace Sources {
416
+ export { type PartitionMethod as PartitionMethod, type PublicSource as PublicSource, type SourceListResponse as SourceListResponse, type SourceDeleteResponse as SourceDeleteResponse, type SourceAskResponse as SourceAskResponse, type SourceExtractResponse as SourceExtractResponse, type SourceLoadElementsResponse as SourceLoadElementsResponse, type SourceRetrieveChunksResponse as SourceRetrieveChunksResponse, type SourceDeleteParams as SourceDeleteParams, type SourceAskParams as SourceAskParams, type SourceExtractParams as SourceExtractParams, type SourceLoadElementsParams as SourceLoadElementsParams, type SourceParseParams as SourceParseParams, type SourceRetrieveChunksParams as SourceRetrieveChunksParams, type SourceUploadParams as SourceUploadParams, type SourceUploadGitHubParams as SourceUploadGitHubParams, type SourceUploadURLParams as SourceUploadURLParams, type SourceUploadYoutubeParams as SourceUploadYoutubeParams, };
417
+ }
418
+ //# sourceMappingURL=sources.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sources.d.mts","sourceRoot":"","sources":["../src/resources/sources.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,KAAK,UAAU,EAAE;OACnB,EAAE,cAAc,EAAE;AAGzB,qBAAa,OAAQ,SAAQ,WAAW;IACtC;;OAEG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI9D;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,oBAAoB,CAAC;IAI5F;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAInF;;OAEG;IACH,OAAO,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,c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