Compare commits

...

3 Commits

Author SHA1 Message Date
github-actions[bot] 47a5b94b0c Release 0.11.17 (#2095)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-11 21:57:02 -07:00
Alex Yang d2be868b93 feat(cloud): missing agent api (#2094) 2025-07-11 20:45:22 -07:00
github-actions[bot] 50d42c4129 Release 0.11.16 (#2093)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-07-11 20:13:37 -07:00
33 changed files with 229 additions and 36 deletions
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/doc
## 0.2.38
### Patch Changes
- Updated dependencies [d2be868]
- @llamaindex/cloud@4.0.22
- llamaindex@0.11.17
## 0.2.37
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/doc",
"version": "0.2.37",
"version": "0.2.38",
"private": true,
"scripts": {
"postinstall": "fumadocs-mdx",
@@ -1,5 +1,11 @@
# @llamaindex/cloudflare-worker-agent-test
## 0.0.178
### Patch Changes
- llamaindex@0.11.17
## 0.0.177
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.177",
"version": "0.0.178",
"type": "module",
"private": true,
"scripts": {
@@ -1,5 +1,12 @@
# @llamaindex/llama-parse-browser-test
## 0.0.77
### Patch Changes
- Updated dependencies [d2be868]
- @llamaindex/cloud@4.0.22
## 0.0.76
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/llama-parse-browser-test",
"private": true,
"version": "0.0.76",
"version": "0.0.77",
"type": "module",
"scripts": {
"dev": "vite",
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/next-agent-test
## 0.1.178
### Patch Changes
- llamaindex@0.11.17
## 0.1.177
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-agent-test",
"version": "0.1.177",
"version": "0.1.178",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,11 @@
# test-edge-runtime
## 0.1.177
### Patch Changes
- llamaindex@0.11.17
## 0.1.176
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.176",
"version": "0.1.177",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,11 @@
# @llamaindex/next-node-runtime
## 0.1.46
### Patch Changes
- llamaindex@0.11.17
## 0.1.45
### Patch Changes
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-node-runtime-test",
"version": "0.1.45",
"version": "0.1.46",
"private": true,
"scripts": {
"dev": "next dev",
@@ -1,5 +1,11 @@
# vite-import-llamaindex
## 0.0.44
### Patch Changes
- llamaindex@0.11.17
## 0.0.43
### Patch Changes
@@ -1,7 +1,7 @@
{
"name": "vite-import-llamaindex",
"private": true,
"version": "0.0.43",
"version": "0.0.44",
"type": "module",
"scripts": {
"build": "vite build",
@@ -1,5 +1,11 @@
# @llamaindex/waku-query-engine-test
## 0.0.178
### Patch Changes
- llamaindex@0.11.17
## 0.0.177
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/waku-query-engine-test",
"version": "0.0.177",
"version": "0.0.178",
"type": "module",
"private": true,
"scripts": {
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/autotool
## 8.0.17
### Patch Changes
- llamaindex@0.11.17
## 8.0.16
### Patch Changes
@@ -1,5 +1,12 @@
# @llamaindex/autotool-01-node-example
## 0.0.125
### Patch Changes
- llamaindex@0.11.17
- @llamaindex/autotool@8.0.17
## 0.0.124
### Patch Changes
@@ -13,5 +13,5 @@
"scripts": {
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
},
"version": "0.0.124"
"version": "0.0.125"
}
+1 -1
View File
@@ -6,7 +6,7 @@
"url": "git+https://github.com/run-llama/LlamaIndexTS.git",
"directory": "packages/autotool"
},
"version": "8.0.16",
"version": "8.0.17",
"description": "auto transpile your JS function to LLM Agent compatible",
"files": [
"dist",
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/cloud
## 4.0.22
### Patch Changes
- d2be868: Bug fixes for new beta agent-data cloud API
## 4.0.21
### Patch Changes
+8 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloud",
"version": "4.0.21",
"version": "4.0.22",
"type": "module",
"license": "MIT",
"scripts": {
@@ -13,20 +13,20 @@
"./api",
"./reader",
"./parse",
"./agent"
"./beta/agent"
],
"exports": {
"./openapi.json": "./openapi.json",
"./agent": {
"./beta/agent": {
"require": {
"types": "./agent/dist/index.d.cts",
"default": "./agent/dist/index.cjs"
"types": "./beta/agent/dist/index.d.cts",
"default": "./beta/agent/dist/index.cjs"
},
"import": {
"types": "./agent/dist/index.d.ts",
"default": "./agent/dist/index.js"
"types": "./beta/agent/dist/index.d.ts",
"default": "./beta/agent/dist/index.js"
},
"default": "./agent/dist/index.js"
"default": "./beta/agent/dist/index.js"
},
"./api": {
"require": {
-1
View File
@@ -1 +0,0 @@
export { AgentClient, createAgentClient } from "./client";
@@ -1,36 +1,55 @@
import { createClient, createConfig } from "@hey-api/client-fetch";
import { getEnv } from "@llamaindex/env";
import {
aggregateAgentDataApiV1BetaAgentDataAggregatePost,
createAgentDataApiV1BetaAgentDataPost,
deleteAgentDataApiV1BetaAgentDataItemIdDelete,
getAgentDataApiV1BetaAgentDataItemIdGet,
searchAgentDataApiV1BetaAgentDataSearchPost,
updateAgentDataApiV1BetaAgentDataItemIdPut,
type AgentData,
type AggregateRequest,
type PaginatedResponseAgentData,
type PaginatedResponseAggregateGroup,
type SearchRequest,
} from "../client";
} from "../../client";
type AgentClientOptions = {
apiKey?: string;
baseUrl?: string;
collection: string;
agentUrlId: string;
collection?: string;
agentUrlId?: string;
windowUrl?: string;
};
/**
* Async client for agent data operations
*/
export class AgentClient {
export class AgentClient<T = unknown> {
private client: ReturnType<typeof createClient>;
private baseUrl: string;
private headers: Record<string, string>;
private collection: string;
private agentUrlId: string;
constructor(options: AgentClientOptions) {
this.collection = options.collection;
this.agentUrlId = options.agentUrlId;
constructor(options: AgentClientOptions = {}) {
// Handle windowUrl to infer agentUrlId
let inferredAgentUrlId: string | undefined;
if (options.windowUrl && !options.agentUrlId) {
try {
const path = new URL(options.windowUrl).pathname;
// /deployments/<agent-url-id>/ui/ -> ["", "deployments", "<agent-url-id>", "ui"]
inferredAgentUrlId = path.split("/")[2];
} catch (error) {
console.warn(
"Failed to infer agent url id from window url, falling back to default",
error,
);
}
}
this.collection = options.collection || "default";
this.agentUrlId = options.agentUrlId || inferredAgentUrlId || "default";
const apiKey = options?.apiKey || getEnv("LLAMA_CLOUD_API_KEY");
this.baseUrl = options?.baseUrl || "https://api.cloud.llamaindex.ai/";
@@ -50,7 +69,7 @@ export class AgentClient {
/**
* Create new agent data
*/
async createItem<T>(data: T): Promise<AgentData> {
async createItem(data: T): Promise<AgentData> {
const response = await createAgentDataApiV1BetaAgentDataPost({
throwOnError: true,
body: {
@@ -91,7 +110,7 @@ export class AgentClient {
/**
* Update agent data
*/
async updateItem<T>(id: string, data: T): Promise<AgentData> {
async updateItem(id: string, data: T): Promise<AgentData> {
const response = await updateAgentDataApiV1BetaAgentDataItemIdPut({
throwOnError: true,
path: { item_id: id },
@@ -107,7 +126,7 @@ export class AgentClient {
/**
* Delete agent data
*/
async delete(id: string): Promise<void> {
async deleteItem(id: string): Promise<void> {
await deleteAgentDataApiV1BetaAgentDataItemIdDelete({
throwOnError: true,
path: { item_id: id },
@@ -116,13 +135,36 @@ export class AgentClient {
}
/**
* List agent data
* Search agent data
*/
async list(options: SearchRequest): Promise<PaginatedResponseAgentData> {
async search(
options: Partial<SearchRequest> = {},
): Promise<PaginatedResponseAgentData> {
const response = await searchAgentDataApiV1BetaAgentDataSearchPost({
throwOnError: true,
body: {
...options,
agent_slug: this.agentUrlId,
collection: this.collection,
},
client: this.client,
});
return response.data;
}
/**
* Aggregate agent data into groups
*/
async aggregate(
options: Partial<AggregateRequest> = {},
): Promise<PaginatedResponseAggregateGroup> {
const response = await aggregateAgentDataApiV1BetaAgentDataAggregatePost({
throwOnError: true,
body: {
...options,
agent_slug: this.agentUrlId,
collection: this.collection,
},
client: this.client,
});
@@ -131,6 +173,8 @@ export class AgentClient {
}
}
export function createAgentClient(options: AgentClientOptions): AgentClient {
return new AgentClient(options);
export function createAgentDataClient<T = unknown>(
options: AgentClientOptions = {},
): AgentClient<T> {
return new AgentClient<T>(options);
}
+15
View File
@@ -0,0 +1,15 @@
export { AgentClient, createAgentDataClient } from "./client";
export type {
AgentData,
AggregateGroup,
AggregateRequest,
ExtractedData,
FilterOperation,
PaginatedResponseAgentData,
PaginatedResponseAggregateGroup,
SearchRequest,
StatusType,
} from "./types";
export { StatusType as StatusTypeEnum } from "./types";
+44
View File
@@ -0,0 +1,44 @@
// Re-export types from the client
export type {
AgentData,
AggregateGroup,
AggregateRequest,
FilterOperation,
PaginatedResponseAgentData,
PaginatedResponseAggregateGroup,
SearchRequest,
} from "../../client";
/**
* Status types for agent data processing
*/
export const StatusType = {
ERROR: "error",
ACCEPTED: "accepted",
REJECTED: "rejected",
PENDING_REVIEW: "pending_review",
} as const;
export type StatusType = (typeof StatusType)[keyof typeof StatusType];
/**
* Base extracted data interface
*/
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;
/** 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 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. */
file_name?: string;
/** The hash of the file that was used to extract the data. */
file_hash?: string;
/** Additional metadata about the extracted data, such as errors, tokens, etc. */
metadata?: Record<string, unknown>;
}
+6
View File
@@ -1,5 +1,11 @@
# @llamaindex/experimental
## 0.0.194
### Patch Changes
- llamaindex@0.11.17
## 0.0.193
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.193",
"version": "0.0.194",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
+7
View File
@@ -1,5 +1,12 @@
# llamaindex
## 0.11.17
### Patch Changes
- Updated dependencies [d2be868]
- @llamaindex/cloud@4.0.22
## 0.11.16
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llamaindex",
"version": "0.11.16",
"version": "0.11.17",
"license": "MIT",
"type": "module",
"keywords": [
+8
View File
@@ -1,5 +1,13 @@
# @llamaindex/unit-test
## 0.1.46
### Patch Changes
- Updated dependencies [d2be868]
- @llamaindex/cloud@4.0.22
- llamaindex@0.11.17
## 0.1.45
### Patch Changes
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/unit-test",
"private": true,
"version": "0.1.45",
"version": "0.1.46",
"type": "module",
"scripts": {
"test": "vitest run"