Skip to content

Commit

Permalink
fix: cleaned up root and regenerated data sources with overlap
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusschiesser committed Oct 23, 2023
1 parent ad718fd commit 47a040d
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 91 deletions.
16 changes: 0 additions & 16 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,22 +1,6 @@

# Your openai api key. (required)
OPENAI_API_KEY=sk-xxxx

# Override openai api request base url. (optional)
# Default: https://api.openai.com
# Examples: http:https://your-openai-proxy.com
BASE_URL=

# Specify OpenAI organization ID.(optional)
# Default: Empty
# If you do not want users to input their own API key, set this value to 1.
OPENAI_ORG_ID=

# (optional)
# Default: Empty
# If you do not want users to use GPT-4, set this value to 1.
DISABLE_GPT4=

# see https://next-auth.js.org/providers/linkedin
LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=
Expand Down
11 changes: 0 additions & 11 deletions .gitpod.yml

This file was deleted.

26 changes: 9 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,6 @@ Unc is enterprise-ready, featuring:
- Supports [Azure OpenAI from Microsoft](https://azure.microsoft.com/en-us/products/ai-services/openai-service), eliminating traffic to OpenAI.
- Privacy first; personal data is stored locally in the browser.

## 💼 Enterprise

A typical enterprise installation requires:

- Custom user authentication (e.g. Active Directory).
- Installation in a corporate cloud (AWS or Azure).
- Integration with data from third-party systems (e.g., Salesforce, ServiceNow, SAP, Oracle).

For enterprise support and installations, reach out to me on
[LinkedIn](https://linkedin.com/marcusschiesser).

## ⚡️ Quick start

### Use Gitpod
Expand All @@ -60,12 +49,15 @@ cd unc
- Run the dev server

```bash
yarn install
yarn dev
pnpm install
pnpm dev
```

## ❤️ Community
### Recreate Storage

Join the Unc community on [GitHub Discussions](https://github.com/marcusschiesser/unc/discussions). You can ask questions, share ideas, and showcase your projects.

Feedback is paramount. Please do share any suggestions, ideas, or bugs you encounter via [GitHub issues](https://github.com/marcusschiesser/unc/issues). Your insight is invaluable for enhancing future releases.
The app is using a [`ChatEngine`](https://ts.llamaindex.ai/modules/high_level/chat_engine) for each bot with a different [`VectorStoreIndex`](https://ts.llamaindex.ai/modules/high_level/data_index) attached.
The `cache` folder in the file system is used as [Storage](The https://ts.llamaindex.ai/modules/low_level/storage) for the `VectorStoreIndex`. To re-create the storage
Vector Indexes
```bash
pnpm run generate
```
6 changes: 5 additions & 1 deletion app/api/llm/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ import {
import { NextRequest, NextResponse } from "next/server";
import { LLMConfig } from "../../client/platforms/llm";
import { getDataSource } from "./datasource";
import { DATASOURCES_CHUNK_SIZE } from "@/scripts/constants.mjs";
import {
DATASOURCES_CHUNK_OVERLAP,
DATASOURCES_CHUNK_SIZE,
} from "@/scripts/constants.mjs";
import { Embedding } from "@/app/client/fetch/url";

async function createChatEngine(
Expand Down Expand Up @@ -105,6 +108,7 @@ export async function POST(request: NextRequest) {
const serviceContext = serviceContextFromDefaults({
llm,
chunkSize: DATASOURCES_CHUNK_SIZE,
chunkOverlap: DATASOURCES_CHUNK_OVERLAP,
});

const chatEngine = await createChatEngine(
Expand Down
2 changes: 1 addition & 1 deletion cache/basic_law_germany/doc_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/basic_law_germany/index_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/basic_law_germany/vector_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/redhat/doc_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/redhat/index_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/redhat/vector_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/watchos/doc_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/watchos/index_store.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cache/watchos/vector_store.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "AGPL-3.0-or-later",
"scripts": {
"dev": "next dev",
"build": "cross-env next build",
"build": "next build",
"start": "next start",
"lint": "next lint",
"format:check": "prettier --check --ignore-path .gitignore app",
Expand Down Expand Up @@ -79,7 +79,6 @@
"@types/react": "^18.2.14",
"@types/react-dom": "^18.2.7",
"@types/react-katex": "^3.0.0",
"cross-env": "^7.0.3",
"eslint": "^8.44.0",
"eslint-config-next": "13.4.13",
"eslint-config-prettier": "^9.0.0",
Expand Down
11 changes: 0 additions & 11 deletions pnpm-lock.yaml

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

2 changes: 2 additions & 0 deletions scripts/generate.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
DATASOURCES_CACHE_DIR,
DATASOURCES_DIR,
DATASOURCES_CHUNK_SIZE,
DATASOURCES_CHUNK_OVERLAP,
} from "./constants.mjs";

async function getRuntime(func) {
Expand Down Expand Up @@ -44,6 +45,7 @@ async function generateDatasource(serviceContext, datasource) {
(async () => {
const serviceContext = serviceContextFromDefaults({
chunkSize: DATASOURCES_CHUNK_SIZE,
chunkOverlap: DATASOURCES_CHUNK_OVERLAP,
});

for (const datasource of DATASOURCES) {
Expand Down
24 changes: 0 additions & 24 deletions vercel.json

This file was deleted.

0 comments on commit 47a040d

Please sign in to comment.