Skip to content

Commit

Permalink
Merge branch 'main' into tp/add-vercel-chat-example
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser authored Dec 2, 2024
2 parents 5cb4d72 + 510191c commit 314a2b8
Show file tree
Hide file tree
Showing 33 changed files with 194 additions and 19 deletions.
5 changes: 0 additions & 5 deletions .changeset/stale-parents-perform.md

This file was deleted.

7 changes: 7 additions & 0 deletions apps/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# docs

## 0.0.129

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.128

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docs",
"version": "0.0.128",
"version": "0.0.129",
"private": true,
"scripts": {
"docusaurus": "docusaurus",
Expand Down
7 changes: 7 additions & 0 deletions apps/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/doc

## 0.0.27

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.26

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/doc",
"version": "0.0.26",
"version": "0.0.27",
"private": true,
"scripts": {
"build": "pnpm run build:docs && next build",
Expand Down
7 changes: 7 additions & 0 deletions e2e/examples/cloudflare-worker-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/cloudflare-worker-agent-test

## 0.0.120

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.119

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion e2e/examples/cloudflare-worker-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/cloudflare-worker-agent-test",
"version": "0.0.119",
"version": "0.0.120",
"type": "module",
"private": true,
"scripts": {
Expand Down
7 changes: 7 additions & 0 deletions e2e/examples/nextjs-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/next-agent-test

## 0.1.120

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.1.119

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion e2e/examples/nextjs-agent/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-agent-test",
"version": "0.1.119",
"version": "0.1.120",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
7 changes: 7 additions & 0 deletions e2e/examples/nextjs-edge-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# test-edge-runtime

## 0.1.119

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.1.118

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion e2e/examples/nextjs-edge-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/nextjs-edge-runtime-test",
"version": "0.1.118",
"version": "0.1.119",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
7 changes: 7 additions & 0 deletions e2e/examples/nextjs-node-runtime/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/next-node-runtime

## 0.0.101

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.100

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion e2e/examples/nextjs-node-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/next-node-runtime-test",
"version": "0.0.100",
"version": "0.0.101",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
7 changes: 7 additions & 0 deletions e2e/examples/waku-query-engine/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/waku-query-engine-test

## 0.0.120

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.119

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion e2e/examples/waku-query-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@llamaindex/waku-query-engine-test",
"version": "0.0.119",
"version": "0.0.120",
"type": "module",
"private": true,
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion examples/readers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"start:llamaparse-dir": "node --import tsx ./src/simple-directory-reader-with-llamaparse.ts",
"start:llamaparse-json": "node --import tsx ./src/llamaparse-json.ts",
"start:discord": "node --import tsx ./src/discord.ts",
"start:json": "node --import tsx ./src/json.ts"
"start:json": "node --import tsx ./src/json.ts",
"start:obsidian": "node --import tsx ./src/obsidian.ts"
},
"dependencies": {
"@llamaindex/readers": "*",
Expand Down
12 changes: 12 additions & 0 deletions examples/readers/src/obsidian.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { ObsidianReader } from "@llamaindex/readers/obsidian";

const obsidianReader = new ObsidianReader(
"/Users/jingyi/Documents/jingyi-vault",
);

obsidianReader.loadData().then((documents) => {
console.log("documents:", documents.length);
documents.forEach((doc) => {
console.log(`document (${doc.id_}):`, doc.getText());
});
});
7 changes: 7 additions & 0 deletions packages/autotool/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/autotool

## 5.0.24

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 5.0.23

### Patch Changes
Expand Down
8 changes: 8 additions & 0 deletions packages/autotool/examples/01_node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @llamaindex/autotool-01-node-example

## 0.0.67

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]
- @llamaindex/autotool@5.0.24

## 0.0.66

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/autotool/examples/01_node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
"scripts": {
"start": "node --import tsx --import @llamaindex/autotool/node ./src/index.ts"
},
"version": "0.0.66"
"version": "0.0.67"
}
8 changes: 8 additions & 0 deletions packages/autotool/examples/02_nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @llamaindex/autotool-02-next-example

## 0.1.111

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]
- @llamaindex/autotool@5.0.24

## 0.1.110

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/autotool/examples/02_nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool-02-next-example",
"private": true,
"version": "0.1.110",
"version": "0.1.111",
"scripts": {
"dev": "next dev",
"build": "next build",
Expand Down
2 changes: 1 addition & 1 deletion packages/autotool/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/autotool",
"type": "module",
"version": "5.0.23",
"version": "5.0.24",
"description": "auto transpile your JS function to LLM Agent compatible",
"files": [
"dist",
Expand Down
7 changes: 7 additions & 0 deletions packages/experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/experimental

## 0.0.136

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.135

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/experimental/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@llamaindex/experimental",
"description": "Experimental package for LlamaIndexTS",
"version": "0.0.135",
"version": "0.0.136",
"type": "module",
"types": "dist/type/index.d.ts",
"main": "dist/cjs/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/llamaindex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# llamaindex

## 0.8.24

### Patch Changes

- 515f2c1: Add vector store for CosmosDB

## 0.8.23

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/llamaindex/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "llamaindex",
"version": "0.8.23",
"version": "0.8.24",
"license": "MIT",
"type": "module",
"keywords": [
Expand Down
1 change: 1 addition & 0 deletions packages/llamaindex/src/readers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ export * from "@llamaindex/readers/json";
export * from "@llamaindex/readers/markdown";
export * from "@llamaindex/readers/mongo";
export * from "@llamaindex/readers/notion";
export * from "@llamaindex/readers/obsidian";
export * from "@llamaindex/readers/pdf";
export * from "@llamaindex/readers/text";
14 changes: 14 additions & 0 deletions packages/readers/obsidian/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"edge-light": "./dist/index.edge-light.js",
"workerd": "./dist/index.workerd.js",
"default": "./dist/index.js"
}
},
"private": true
}
19 changes: 19 additions & 0 deletions packages/readers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,24 @@
"default": "./notion/dist/index.js"
}
},
"./obsidian": {
"edge-light": {
"types": "./obsidian/dist/index.edge-light.d.ts",
"default": "./obsidian/dist/index.edge-light.js"
},
"workerd": {
"types": "./obsidian/dist/index.workerd.d.ts",
"default": "./obsidian/dist/index.workerd.js"
},
"require": {
"types": "./obsidian/dist/index.d.cts",
"default": "./obsidian/dist/index.cjs"
},
"import": {
"types": "./obsidian/dist/index.d.ts",
"default": "./obsidian/dist/index.js"
}
},
"./pdf": {
"require": {
"types": "./pdf/dist/index.d.cts",
Expand Down Expand Up @@ -176,6 +194,7 @@
"markdown",
"mongo",
"notion",
"obsidian",
"pdf",
"text",
"node"
Expand Down
41 changes: 41 additions & 0 deletions packages/readers/src/obsidian.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { type BaseReader, Document } from "@llamaindex/core/schema";
import * as fs from "node:fs";
import path from "node:path";
import { MarkdownReader } from "./markdown";

export class ObsidianReader implements BaseReader<Document> {
protected inputDir: string;
protected docs: Document[] = [];

constructor(inputDir: string) {
this.inputDir = inputDir;
}

private async processPath(file: fs.Dirent, filepath: string) {
if (file.isDirectory() && !file.name.startsWith(".")) {
await this.readFromPath(filepath);
} else if (file.isFile() && file.name.endsWith(".md")) {
await this.convertToDocuments(filepath);
} else {
console.log(`Skipping ${filepath}`);
}
}

private async readFromPath(dir: string) {
const files = await fs.promises.readdir(dir, { withFileTypes: true });
for (const file of files) {
const filepath = path.join(dir, file.name);
await this.processPath(file, filepath);
}
}

private async convertToDocuments(filepath: string) {
const content = await new MarkdownReader().loadData(filepath);
this.docs.push(...content);
}

async loadData(): Promise<Document[]> {
await this.readFromPath(this.inputDir);
return this.docs;
}
}
7 changes: 7 additions & 0 deletions unit/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @llamaindex/unit-test

## 0.0.34

### Patch Changes

- Updated dependencies [515f2c1]
- [email protected]

## 0.0.33

### Patch Changes
Expand Down
Loading

0 comments on commit 314a2b8

Please sign in to comment.