mirror of
https://github.com/run-llama/llama_cloud_services.git
synced 2026-07-18 07:44:41 -04:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bb7b08f72c | |||
| f18eb11e92 | |||
| d021499386 | |||
| 836c485f59 | |||
| 22887f38f6 | |||
| 10d96c253c |
@@ -6,8 +6,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "py/**"
|
||||
pull_request:
|
||||
|
||||
paths:
|
||||
- "py/**"
|
||||
env:
|
||||
UV_VERSION: "0.7.20"
|
||||
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
name: Build Package - TypeScript
|
||||
on: [pull_request]
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ts/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "ts/**"
|
||||
|
||||
jobs:
|
||||
pre_release:
|
||||
|
||||
@@ -4,9 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ts/**"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ts/**"
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
|
||||
@@ -4,7 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "py/**"
|
||||
pull_request:
|
||||
paths:
|
||||
- "py/**"
|
||||
|
||||
env:
|
||||
UV_VERSION: "0.7.20"
|
||||
|
||||
@@ -4,9 +4,11 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ts/**"
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "ts/**"
|
||||
|
||||
env:
|
||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
||||
@@ -15,7 +17,8 @@ env:
|
||||
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
test:
|
||||
name: Test - TypeScript
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -31,4 +34,4 @@ jobs:
|
||||
run: pnpm install --no-frozen-lockfile
|
||||
- name: Run tests
|
||||
working-directory: ts/llama_cloud_services/
|
||||
run: pnpm test --run
|
||||
run: pnpm test
|
||||
|
||||
@@ -63,13 +63,13 @@ repos:
|
||||
rev: v3.0.3
|
||||
hooks:
|
||||
- id: prettier
|
||||
exclude: uv.lock
|
||||
exclude: ^(uv.lock|ts/llama_cloud_services/pnpm-lock.yaml)
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.2.6
|
||||
hooks:
|
||||
- id: codespell
|
||||
additional_dependencies: [tomli]
|
||||
exclude: ^(uv.lock|docs|ts)
|
||||
exclude: ^(uv.lock|docs|ts|examples)
|
||||
args:
|
||||
[
|
||||
"--ignore-words-list",
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
"documents = []\n",
|
||||
"\n",
|
||||
"for i, page in enumerate(pages):\n",
|
||||
" # loop trough items of the page\n",
|
||||
" # loop through items of the page\n",
|
||||
" for item in page[\"items\"]:\n",
|
||||
" document = Document(\n",
|
||||
" text=item[\"md\"], extra_info={\"bbox\": item[\"bBox\"], \"page\": i}\n",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"dev": "bunchee --watch",
|
||||
"lint": "eslint src/ --ignore-pattern client/*.ts --no-warn-ignored",
|
||||
"format": "prettier --write ./src/",
|
||||
"test": "vitest",
|
||||
"test": "vitest run --testTimeout=60000",
|
||||
"test:watch": "vitest --watch",
|
||||
"test:ui": "vitest --ui",
|
||||
"test:coverage": "vitest --coverage"
|
||||
@@ -89,8 +89,8 @@
|
||||
"@eslint/js": "^9.32.0",
|
||||
"@hey-api/client-fetch": "^0.10.1",
|
||||
"@hey-api/openapi-ts": "^0.67.5",
|
||||
"@llama-flow/core": "^0.4.1",
|
||||
"@llamaindex/core": "^0.6.18",
|
||||
"@llamaindex/workflow-core": "^0.4.1",
|
||||
"@llamaindex/core": "^0.6.19",
|
||||
"@llamaindex/env": "^0.1.30",
|
||||
"@typescript-eslint/eslint-plugin": "^8.38.0",
|
||||
"@typescript-eslint/parser": "^8.38.0",
|
||||
@@ -107,10 +107,10 @@
|
||||
"vitest": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@llama-flow/core": "^0.4.1",
|
||||
"@llamaindex/core": "^0.6.18",
|
||||
"@llamaindex/workflow-core": "^0.4.1",
|
||||
"@llamaindex/core": "^0.6.19",
|
||||
"@llamaindex/env": "^0.1.30",
|
||||
"llamaindex": "^0.11.23"
|
||||
"llamaindex": "^0.11.25"
|
||||
},
|
||||
"dependencies": {
|
||||
"p-retry": "^6.2.1",
|
||||
|
||||
Generated
+1250
-2458
File diff suppressed because it is too large
Load Diff
@@ -261,8 +261,7 @@ export class AgentClient<T = unknown> {
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
export interface AgentDataClientOptions<T = unknown> {
|
||||
export interface AgentDataClientOptions {
|
||||
/** API key for the client */
|
||||
apiKey?: string;
|
||||
/** Base URL for the client */
|
||||
|
||||
@@ -28,6 +28,29 @@ export type ComparisonOperator =
|
||||
*/
|
||||
export type FilterOperation = RawFilterOperation;
|
||||
|
||||
/**
|
||||
* Metadata for an extracted field, including confidence and citation information
|
||||
*/
|
||||
export interface ExtractedFieldMetadata {
|
||||
/** The confidence score for the field, combined with parsing confidence if applicable */
|
||||
confidence?: number;
|
||||
/** The confidence score for the field based on the extracted text only */
|
||||
extracted_confidence?: number;
|
||||
/** The page number that the field occurred on */
|
||||
page_number?: number;
|
||||
/** The original text this field's value was derived from */
|
||||
matching_text?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dictionary mapping field names to their metadata
|
||||
* Values can be ExtractedFieldMetadata objects, nested dictionaries, or arrays
|
||||
*/
|
||||
export type ExtractedFieldMetadataDict = Record<
|
||||
string,
|
||||
ExtractedFieldMetadata | Record<string, unknown> | unknown[]
|
||||
>;
|
||||
|
||||
/**
|
||||
* Base extracted data interface
|
||||
*/
|
||||
@@ -35,11 +58,13 @@ export interface ExtractedData<T = unknown> {
|
||||
/** The original data that was extracted from the document. For tracking changes. Should not be updated. */
|
||||
original_data: T;
|
||||
/** The latest state of the data. Will differ if data has been updated. */
|
||||
data?: T;
|
||||
data: T;
|
||||
/** The status of the extracted data. Prefer to use the StatusType values, but any string is allowed. */
|
||||
status: StatusType | string;
|
||||
/** Confidence scores, if any, for each primitive field in the original_data data. */
|
||||
confidence?: Record<string, unknown>;
|
||||
/** The overall confidence score for the extracted data. */
|
||||
overall_confidence?: number;
|
||||
/** Page links, and perhaps eventually bounding boxes, for individual fields in the extracted data. */
|
||||
field_metadata?: ExtractedFieldMetadataDict;
|
||||
/** The ID of the file that was used to extract the data. */
|
||||
file_id?: string;
|
||||
/** The name of the file that was used to extract the data. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { workflowEvent } from "@llama-flow/core";
|
||||
import { zodEvent } from "@llama-flow/core/util/zod";
|
||||
import { workflowEvent } from "@llamaindex/workflow-core";
|
||||
import { zodEvent } from "@llamaindex/workflow-core/util/zod";
|
||||
import { z } from "zod";
|
||||
import { parseFormSchema } from "./schema";
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import { createClient, createConfig } from "@hey-api/client-fetch";
|
||||
import { createWorkflow, type InferWorkflowEventData } from "@llama-flow/core";
|
||||
import { createStatefulMiddleware } from "@llama-flow/core/middleware/state";
|
||||
import { withTraceEvents } from "@llama-flow/core/middleware/trace-events";
|
||||
import { pRetryHandler } from "@llama-flow/core/util/p-retry";
|
||||
import {
|
||||
createWorkflow,
|
||||
type InferWorkflowEventData,
|
||||
} from "@llamaindex/workflow-core";
|
||||
import { createStatefulMiddleware } from "@llamaindex/workflow-core/middleware/state";
|
||||
import { withTraceEvents } from "@llamaindex/workflow-core/middleware/trace-events";
|
||||
import { pRetryHandler } from "@llamaindex/workflow-core/util/p-retry";
|
||||
import { fs, getEnv, path } from "@llamaindex/env";
|
||||
import {
|
||||
type BodyUploadFileApiV1ParsingUploadPost,
|
||||
|
||||
Reference in New Issue
Block a user