Skip to content

Commit

Permalink
refactor: migrate @llamaindex/azure/storage
Browse files Browse the repository at this point in the history
  • Loading branch information
thucpn committed Jan 21, 2025
1 parent 7b17967 commit 6e674c8
Show file tree
Hide file tree
Showing 22 changed files with 53 additions and 36 deletions.
3 changes: 0 additions & 3 deletions packages/llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
"@anthropic-ai/sdk": "0.32.1",
"@aws-crypto/sha256-js": "^5.2.0",
"@aws-sdk/client-sso-oidc": "^3.693.0",
"@azure/cosmos": "^4.1.1",
"@azure/identity": "^4.4.1",
"@azure/search-documents": "^12.1.0",
"@datastax/astra-db-ts": "^1.4.1",
"@discoveryjs/json-ext": "^0.6.1",
"@google-cloud/vertexai": "1.9.0",
Expand Down
10 changes: 2 additions & 8 deletions packages/llamaindex/src/storage/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "@llamaindex/azure/storage";
export * from "@llamaindex/core/storage/chat-store";
export * from "@llamaindex/core/storage/doc-store";
export * from "@llamaindex/core/storage/index-store";
Expand All @@ -7,14 +8,7 @@ export {
PostgresIndexStore,
PostgresKVStore,
} from "@llamaindex/postgres";
export * from "./chatStore/AzureCosmosMongovCoreChatStore.js";
export * from "./chatStore/AzureCosmosNoSqlChatStore.js";
export * from "./docStore/AzureCosmosMongovCoreDocumentStore.js";
export * from "./docStore/AzureCosmosNoSqlDocumentStore.js";
export { SimpleDocumentStore } from "./docStore/SimpleDocumentStore.js";
export * from "./FileSystem.js";
export * from "./indexStore/AzureCosmosMongovCoreIndexStore.js";
export * from "./indexStore/AzureCosmosNoSqlIndexStore.js";
export * from "./kvStore/AzureCosmosMongovCoreKVStore.js";
export * from "./kvStore/AzureCosmosNoSqlKVStore.js";

export * from "./StorageContext.js";
6 changes: 5 additions & 1 deletion packages/llamaindex/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"skipLibCheck": true,
"strict": true
},
"include": ["./src"],
"include": [
"./src",
"../providers/storage/azure/src/chatStore",
"../providers/storage/azure/src/kvStore"
],
"exclude": ["node_modules"],
"references": [
{
Expand Down
21 changes: 20 additions & 1 deletion packages/providers/storage/azure/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
},
"./storage": {
"edge-light": {
"types": "./dist/storage.edge-light.d.ts",
"default": "./dist/storage.edge-light.js"
},
"workerd": {
"types": "./dist/storage.edge-light.d.ts",
"default": "./dist/storage.edge-light.js"
},
"require": {
"types": "./dist/storage.d.cts",
"default": "./dist/storage.cjs"
},
"import": {
"types": "./dist/storage.d.ts",
"default": "./dist/storage.js"
}
}
},
"files": [
Expand All @@ -38,7 +56,8 @@
"dev": "bunchee --watch"
},
"devDependencies": {
"bunchee": "6.2.0"
"bunchee": "6.2.0",
"@types/node": "^22.9.0"
},
"dependencies": {
"@llamaindex/core": "workspace:*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KVDocumentStore } from "@llamaindex/core/storage/doc-store";
import { MongoClient } from "mongodb";
import { AzureCosmosVCoreKVStore } from "../kvStore/AzureCosmosMongovCoreKVStore.js";
import { AzureCosmosVCoreKVStore } from "../kvStore/AzureCosmosMongovCoreKVStore";

const DEFAULT_DATABASE = "DocumentStoreDB";
const DEFAULT_COLLECTION = "DocumentStoreCollection";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
type AadTokenOptions,
type AccountAndKeyOptions,
type ConnectionStringOptions,
} from "../kvStore/AzureCosmosNoSqlKVStore.js";
} from "../kvStore/AzureCosmosNoSqlKVStore";

const DEFAULT_DATABASE = "DocumentStoreDB";
const DEFAULT_CONTAINER = "DocumentStoreContainer";
Expand Down
14 changes: 7 additions & 7 deletions packages/providers/storage/azure/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Azure AI Search Vector Store
export * from "./azure/AzureAISearchVectorStore.js";
export * from "./azure/AzureAISearchVectorStoreConfig.js";
export * from "./storage.js";

// Azure Cosmos DB NoSQL Vector Store
export * from "./AzureCosmosDBNoSqlVectorStore.js";
export * from "./vectorStore/AzureAISearchVectorStore.js";
export * from "./vectorStore/AzureAISearchVectorStoreConfig.js";
export * from "./vectorStore/AzureCosmosDBMongoVectorStore.js";
export * from "./vectorStore/AzureCosmosDBNoSqlVectorStore.js";
export * from "./vectorStore/AzureQueryResultSearch.js";

// Azure Cosmos DB MongoDB Vector Store
export * from "./AzureCosmosDBMongoVectorStore.js";
export * from "./tools/AzureDynamicSessionTool.node.js";
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KVIndexStore } from "@llamaindex/core/storage/index-store";
import { MongoClient } from "mongodb";
import { AzureCosmosVCoreKVStore } from "../kvStore/AzureCosmosMongovCoreKVStore.js";
import { KVIndexStore } from "./KVIndexStore.js";
import { AzureCosmosVCoreKVStore } from "../kvStore/AzureCosmosMongovCoreKVStore";

const DEFAULT_DATABASE = "IndexStoreDB";
const DEFAULT_COLLECTION = "IndexStoreCollection";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { KVIndexStore } from "@llamaindex/core/storage/index-store";
import {
AzureCosmosNoSqlKVStore,
type AadTokenOptions,
type AccountAndKeyOptions,
type ConnectionStringOptions,
} from "../kvStore/AzureCosmosNoSqlKVStore.js";
import { KVIndexStore } from "./KVIndexStore.js";
} from "../kvStore/AzureCosmosNoSqlKVStore";

const DEFAULT_DATABASE = "IndexStoreDB";
const DEFAULT_CONTAINER = "IndexStoreContainer";
Expand Down
8 changes: 8 additions & 0 deletions packages/providers/storage/azure/src/storage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export * from "./chatStore/AzureCosmosMongovCoreChatStore.js";
export * from "./chatStore/AzureCosmosNoSqlChatStore.js";
export * from "./docStore/AzureCosmosMongovCoreDocumentStore.js";
export * from "./docStore/AzureCosmosNoSqlDocumentStore.js";
export * from "./indexStore/AzureCosmosMongovCoreIndexStore.js";
export * from "./indexStore/AzureCosmosNoSqlIndexStore.js";
export * from "./kvStore/AzureCosmosMongovCoreKVStore.js";
export * from "./kvStore/AzureCosmosNoSqlKVStore.js";
3 changes: 2 additions & 1 deletion packages/providers/storage/azure/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"module": "ESNext",
"moduleResolution": "bundler",
"outDir": "./lib",
"tsBuildInfoFile": "./lib/.tsbuildinfo"
"tsBuildInfoFile": "./lib/.tsbuildinfo",
"types": ["node"]
},
"include": ["./src"],
"references": [
Expand Down
12 changes: 3 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e674c8

Please sign in to comment.