mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-19 18:43:34 -04:00
feat: bump llama cloud sdk (#1903)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@llamaindex/cloud": patch
|
||||
"llamaindex": patch
|
||||
---
|
||||
|
||||
feat: bump llama cloud sdk
|
||||
@@ -2,15 +2,6 @@
|
||||
|
||||
> LlamaCloud is a new generation of managed parsing, ingestion, and retrieval services, designed to bring production-grade context-augmentation to your LLM and RAG applications.
|
||||
|
||||
## Usage
|
||||
|
||||
```ts
|
||||
import { OpenAPI } from "@llamaindex/cloud/api";
|
||||
OpenAPI.TOKEN = "YOUR_API_KEY";
|
||||
OpenAPI.BASE = "https://api.cloud.llamaindex.ai/";
|
||||
// ...
|
||||
```
|
||||
|
||||
For more information, see the [API documentation](https://docs.cloud.llamaindex.ai/).
|
||||
|
||||
## License
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
import { defineConfig } from "@hey-api/openapi-ts";
|
||||
import { defaultPlugins, defineConfig } from "@hey-api/openapi-ts";
|
||||
|
||||
export default defineConfig({
|
||||
// you can download this file to get the latest version of the OpenAPI document
|
||||
// @link https://api.cloud.llamaindex.ai/api/openapi.json
|
||||
input: "./openapi.json",
|
||||
client: "@hey-api/client-fetch",
|
||||
output: {
|
||||
path: "./src/client",
|
||||
format: "prettier",
|
||||
lint: "eslint",
|
||||
},
|
||||
plugins: [
|
||||
"@hey-api/schemas",
|
||||
"@hey-api/sdk",
|
||||
...defaultPlugins,
|
||||
"@hey-api/client-fetch",
|
||||
{
|
||||
enums: "javascript",
|
||||
identifierCase: "preserve",
|
||||
name: "@hey-api/typescript",
|
||||
name: "@hey-api/sdk",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
+2975
-4384
File diff suppressed because it is too large
Load Diff
@@ -55,8 +55,8 @@
|
||||
"directory": "packages/cloud"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@hey-api/client-fetch": "^0.6.0",
|
||||
"@hey-api/openapi-ts": "^0.61.0",
|
||||
"@hey-api/client-fetch": "^0.10.0",
|
||||
"@hey-api/openapi-ts": "^0.66.7",
|
||||
"@llamaindex/core": "workspace:*",
|
||||
"@llamaindex/env": "workspace:*"
|
||||
},
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
import { client } from "./client/client.gen";
|
||||
|
||||
client.setConfig({
|
||||
baseUrl: "https://api.cloud.llamaindex.ai/",
|
||||
headers: {
|
||||
"X-SDK-Name": "llamaindex-ts",
|
||||
},
|
||||
});
|
||||
|
||||
export * from "./client";
|
||||
export { client };
|
||||
|
||||
@@ -4,7 +4,8 @@ import { Document, FileReader } from "@llamaindex/core/schema";
|
||||
import { fs, getEnv, path } from "@llamaindex/env";
|
||||
import pRetry from "p-retry";
|
||||
import {
|
||||
type Body_upload_file_api_v1_parsing_upload_post,
|
||||
type BodyUploadFileApiParsingUploadPost,
|
||||
type FailPageMode,
|
||||
type ParserLanguages,
|
||||
type ParsingMode,
|
||||
getJobApiV1ParsingJobJobIdGet,
|
||||
@@ -162,6 +163,15 @@ export class LlamaParseReader extends FileReader {
|
||||
content_guideline_instruction?: string | undefined;
|
||||
adaptive_long_table?: boolean | undefined;
|
||||
model?: string | undefined;
|
||||
auto_mode_configuration_json?: string | undefined;
|
||||
compact_markdown_table?: boolean | undefined;
|
||||
markdown_table_multiline_header_separator?: string | undefined;
|
||||
page_error_tolerance?: number | undefined;
|
||||
replace_failed_page_mode?: FailPageMode | undefined;
|
||||
replace_failed_page_with_error_message_prefix?: string | undefined;
|
||||
replace_failed_page_with_error_message_suffix?: string | undefined;
|
||||
save_images?: boolean | undefined;
|
||||
preset?: string | undefined;
|
||||
|
||||
constructor(
|
||||
params: Partial<Omit<LlamaParseReader, "language" | "apiKey">> & {
|
||||
@@ -331,11 +341,23 @@ export class LlamaParseReader extends FileReader {
|
||||
content_guideline_instruction: this.content_guideline_instruction,
|
||||
adaptive_long_table: this.adaptive_long_table,
|
||||
model: this.model,
|
||||
auto_mode_configuration_json: this.auto_mode_configuration_json,
|
||||
compact_markdown_table: this.compact_markdown_table,
|
||||
markdown_table_multiline_header_separator:
|
||||
this.markdown_table_multiline_header_separator,
|
||||
page_error_tolerance: this.page_error_tolerance,
|
||||
replace_failed_page_mode: this.replace_failed_page_mode,
|
||||
replace_failed_page_with_error_message_prefix:
|
||||
this.replace_failed_page_with_error_message_prefix,
|
||||
replace_failed_page_with_error_message_suffix:
|
||||
this.replace_failed_page_with_error_message_suffix,
|
||||
save_images: this.save_images,
|
||||
preset: this.preset,
|
||||
} satisfies {
|
||||
[Key in keyof Body_upload_file_api_v1_parsing_upload_post]-?:
|
||||
| Body_upload_file_api_v1_parsing_upload_post[Key]
|
||||
[Key in keyof BodyUploadFileApiParsingUploadPost]-?:
|
||||
| BodyUploadFileApiParsingUploadPost[Key]
|
||||
| undefined;
|
||||
} as unknown as Body_upload_file_api_v1_parsing_upload_post;
|
||||
} as unknown as BodyUploadFileApiParsingUploadPost;
|
||||
|
||||
const response = await uploadFileApiV1ParsingUploadPost({
|
||||
client: this.#client,
|
||||
@@ -382,10 +404,6 @@ export class LlamaParseReader extends FileReader {
|
||||
client: this.#client,
|
||||
throwOnError: true,
|
||||
path: { job_id: jobId },
|
||||
query: {
|
||||
project_id: this.project_id ?? null,
|
||||
organization_id: this.organization_id ?? null,
|
||||
},
|
||||
signal: AbortSignal.timeout(this.maxTimeout * 1000),
|
||||
}),
|
||||
{
|
||||
@@ -431,7 +449,6 @@ export class LlamaParseReader extends FileReader {
|
||||
throwOnError: true,
|
||||
path: { job_id: jobId },
|
||||
query: {
|
||||
project_id: this.project_id ?? null,
|
||||
organization_id: this.organization_id ?? null,
|
||||
},
|
||||
signal: AbortSignal.timeout(this.maxTimeout * 1000),
|
||||
@@ -445,7 +462,6 @@ export class LlamaParseReader extends FileReader {
|
||||
throwOnError: true,
|
||||
path: { job_id: jobId },
|
||||
query: {
|
||||
project_id: this.project_id ?? null,
|
||||
organization_id: this.organization_id ?? null,
|
||||
},
|
||||
signal: AbortSignal.timeout(this.maxTimeout * 1000),
|
||||
@@ -459,7 +475,6 @@ export class LlamaParseReader extends FileReader {
|
||||
throwOnError: true,
|
||||
path: { job_id: jobId },
|
||||
query: {
|
||||
project_id: this.project_id ?? null,
|
||||
organization_id: this.organization_id ?? null,
|
||||
},
|
||||
signal: AbortSignal.timeout(this.maxTimeout * 1000),
|
||||
@@ -689,10 +704,6 @@ export class LlamaParseReader extends FileReader {
|
||||
job_id: jobId,
|
||||
name: imageName,
|
||||
},
|
||||
query: {
|
||||
project_id: this.project_id ?? null,
|
||||
organization_id: this.organization_id ?? null,
|
||||
},
|
||||
});
|
||||
if (response.error) {
|
||||
throw new Error(`Failed to download image: ${response.error.detail}`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {
|
||||
addFilesToPipelineApiV1PipelinesPipelineIdFilesPut,
|
||||
addFilesToPipelineApiApiV1PipelinesPipelineIdFilesPut,
|
||||
getPipelineFileStatusApiV1PipelinesPipelineIdFilesFileIdStatusGet,
|
||||
listPipelineFilesApiV1PipelinesPipelineIdFilesGet,
|
||||
listProjectsApiV1ProjectsGet,
|
||||
@@ -56,7 +56,7 @@ export class LLamaCloudFileService {
|
||||
custom_metadata: { file_id: file.id, ...customMetadata },
|
||||
},
|
||||
];
|
||||
await addFilesToPipelineApiV1PipelinesPipelineIdFilesPut({
|
||||
await addFilesToPipelineApiApiV1PipelinesPipelineIdFilesPut({
|
||||
path: {
|
||||
pipeline_id: pipelineId,
|
||||
},
|
||||
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
deletePipelineDocumentApiV1PipelinesPipelineIdDocumentsDocumentIdDelete,
|
||||
getPipelineDocumentStatusApiV1PipelinesPipelineIdDocumentsDocumentIdStatusGet,
|
||||
getPipelineStatusApiV1PipelinesPipelineIdStatusGet,
|
||||
type PipelineCreate,
|
||||
type PipelineCreateReadable,
|
||||
searchPipelinesApiV1PipelinesGet,
|
||||
upsertBatchPipelineDocumentsApiV1PipelinesPipelineIdDocumentsPut,
|
||||
upsertPipelineApiV1PipelinesPut,
|
||||
@@ -182,8 +182,8 @@ export class LlamaCloudIndex {
|
||||
verbose?: boolean;
|
||||
} & CloudConstructorParams,
|
||||
config?: {
|
||||
embedding: PipelineCreate["embedding_config"];
|
||||
transform: PipelineCreate["transform_config"];
|
||||
embedding: PipelineCreateReadable["embedding_config"];
|
||||
transform: PipelineCreateReadable["transform_config"];
|
||||
},
|
||||
): Promise<LlamaCloudIndex> {
|
||||
const index = new LlamaCloudIndex({ ...params });
|
||||
@@ -348,8 +348,8 @@ export class LlamaCloudIndex {
|
||||
}
|
||||
|
||||
public async ensureIndex(config?: {
|
||||
embedding?: PipelineCreate["embedding_config"];
|
||||
transform?: PipelineCreate["transform_config"];
|
||||
embedding?: PipelineCreateReadable["embedding_config"];
|
||||
transform?: PipelineCreateReadable["transform_config"];
|
||||
verbose?: boolean;
|
||||
}): Promise<void> {
|
||||
const projectId = await this.getProjectId();
|
||||
|
||||
Generated
+20
-15
@@ -892,11 +892,11 @@ importers:
|
||||
version: 6.2.1
|
||||
devDependencies:
|
||||
'@hey-api/client-fetch':
|
||||
specifier: ^0.6.0
|
||||
version: 0.6.0
|
||||
specifier: ^0.10.0
|
||||
version: 0.10.0(@hey-api/openapi-ts@0.66.7(typescript@5.8.3))
|
||||
'@hey-api/openapi-ts':
|
||||
specifier: ^0.61.0
|
||||
version: 0.61.3(typescript@5.8.3)
|
||||
specifier: ^0.66.7
|
||||
version: 0.66.7(typescript@5.8.3)
|
||||
'@llamaindex/core':
|
||||
specifier: workspace:*
|
||||
version: link:../core
|
||||
@@ -3220,16 +3220,18 @@ packages:
|
||||
peerDependencies:
|
||||
vue: ^3.2.0
|
||||
|
||||
'@hey-api/client-fetch@0.6.0':
|
||||
resolution: {integrity: sha512-FlhFsVeH8RxJe/nq8xUzxNbiOpe+GadxlD2pfvDyOyLdCTU4o/LRv46ZVWstaW7DgF4nxhI328chy3+AulwVXw==}
|
||||
'@hey-api/client-fetch@0.10.0':
|
||||
resolution: {integrity: sha512-C7vzj4t52qPiHCqjn1l8cRTI2p4pZCd7ViLtJDTHr5ZwI4sWOYC1tmv6bd529qqY6HFFbhGCz4TAZSwKAMJncg==}
|
||||
peerDependencies:
|
||||
'@hey-api/openapi-ts': < 2
|
||||
|
||||
'@hey-api/json-schema-ref-parser@1.0.1':
|
||||
resolution: {integrity: sha512-dBt0A7op9kf4BcK++x6HBYDmvCvnJUZEGe5QytghPFHnMXPyKwDKomwL/v5e9ERk6E0e1GzL/e/y6pWUso9zrQ==}
|
||||
'@hey-api/json-schema-ref-parser@1.0.5':
|
||||
resolution: {integrity: sha512-bWUV9ICwvU5I3YKVZqWIUXFC2SIXznUi/u+LqurJx6ILiyImfZD5+g/lj3w4EiyXxmjqyaxptzUz/1IgK3vVtw==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
'@hey-api/openapi-ts@0.61.3':
|
||||
resolution: {integrity: sha512-Ls9MBRa5+vg7UHw6fIcfdgcCyZ9vKtRw63nWxwF9zjJIPlzVOZO6xKuzGmDc6o0Pb6XCdTz6lPV5hcV0R4b/ag==}
|
||||
engines: {node: ^18.20.5 || ^20.11.1 || >=22.11.0}
|
||||
'@hey-api/openapi-ts@0.66.7':
|
||||
resolution: {integrity: sha512-BQMrbiNTWPHwZQ2wMnFdKXVMR47P77hc8fuUseQmmXsXG3Rvt2qstXtlQPmbEds/RO5iTL+JKqdcbhPSWuu/og==}
|
||||
engines: {node: ^18.18.0 || ^20.9.0 || >=22.10.0}
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
typescript: ^5.5.3
|
||||
@@ -14991,17 +14993,20 @@ snapshots:
|
||||
'@tanstack/vue-virtual': 3.13.6(vue@3.5.13(typescript@5.7.3))
|
||||
vue: 3.5.13(typescript@5.7.3)
|
||||
|
||||
'@hey-api/client-fetch@0.6.0': {}
|
||||
'@hey-api/client-fetch@0.10.0(@hey-api/openapi-ts@0.66.7(typescript@5.8.3))':
|
||||
dependencies:
|
||||
'@hey-api/openapi-ts': 0.66.7(typescript@5.8.3)
|
||||
|
||||
'@hey-api/json-schema-ref-parser@1.0.1':
|
||||
'@hey-api/json-schema-ref-parser@1.0.5':
|
||||
dependencies:
|
||||
'@jsdevtools/ono': 7.1.3
|
||||
'@types/json-schema': 7.0.15
|
||||
js-yaml: 4.1.0
|
||||
lodash: 4.17.21
|
||||
|
||||
'@hey-api/openapi-ts@0.61.3(typescript@5.8.3)':
|
||||
'@hey-api/openapi-ts@0.66.7(typescript@5.8.3)':
|
||||
dependencies:
|
||||
'@hey-api/json-schema-ref-parser': 1.0.1
|
||||
'@hey-api/json-schema-ref-parser': 1.0.5
|
||||
c12: 2.0.1
|
||||
commander: 13.0.0
|
||||
handlebars: 4.7.8
|
||||
|
||||
Reference in New Issue
Block a user