Skip to content

Commit

Permalink
Merge pull request #146 from andrewnguonly/1.0.12
Browse files Browse the repository at this point in the history
PR for app version `1.0.12`
  • Loading branch information
andrewnguonly authored Mar 29, 2024
2 parents ed5e34a + f8898d5 commit efb8835
Show file tree
Hide file tree
Showing 20 changed files with 505 additions and 116 deletions.
24 changes: 22 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"@typescript-eslint",
"react",
"react-hooks",
"prettier"
"prettier",
"import"
],
"extends": [
"eslint:recommended",
Expand All @@ -16,7 +17,26 @@
],
"ignorePatterns": [],
"rules": {
"react/react-in-jsx-scope": "off"
"react/react-in-jsx-scope": "off",
"import/order": [
"error",
{
"groups": ["builtin", "external", "internal", "parent", "sibling", "index"],
"pathGroups": [
{
"pattern": "react",
"group": "external",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"newlines-between": "always"
}
]
},
"settings": {
"react": {
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A RAG LLM co-pilot for browsing the web, powered by local LLMs.

![Screenshot of Lumos](./screenshots/lumos_screenshot_3.png)
![Screenshot of Lumos](./screenshots/lumos_screenshot_4.png)

This Chrome extension is powered by [Ollama](https://ollama.ai/). Inference is done on your local machine without any _external_ server support. However, due to security constraints in the Chrome extension platform, the app does rely on _local_ server support to run the LLM. This app is inspired by the [Chrome extension example](https://github.com/mlc-ai/web-llm/tree/main/examples/chrome-extension) provided by the [Web LLM project](https://webllm.mlc.ai/) and the [local LLM examples](https://js.langchain.com/docs/use_cases/question_answering/local_retrieval_qa) provided by [LangChain](https://github.com/langchain-ai/langchainjs).

Expand Down Expand Up @@ -210,11 +210,23 @@ Note: Content that is highlighted will not be cached in the vector store cache.
- `cmd + j`: Toggle `Disable content parsing` checkbox.
- `cmd + k`: Clear all messages.
- `cmd + ;`: Open/close Chat History panel.
- `ctrl + c`: Cancel request (LLM request/streaming or embeddings generation)

## Multimodal

Lumos supports multimodal models! Images that are present on the current page will be downloaded and bound to the model for prompting. See documentation and examples [here](./docs/multimodal.md).

## File Attachments

File attachments can be uploaded to Lumos. The contents of a file will be parsed and processed through Lumos's RAG workflow (similar to processing page content). By default, the text content of a file will be parsed if the extension type is not listed below (e.g. `.py`).

Supported extension types:
- `.csv`
- `.json`
- `.txt`

Note: If an attachment is present, page content will not be parsed. Remove the file attachment to resume parsing page content.

## Tools (Experimental)

Lumos invokes [Tools](https://js.langchain.com/docs/modules/agents/tools/) automatically based on the provided prompt. See documentation and examples [here](./docs/tools.md).
Expand Down
17 changes: 17 additions & 0 deletions __tests__/document_loaders/csv.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { CSVPackedLoader } from "../../src/document_loaders/csv";

describe("Calculator", () => {
let loader: CSVPackedLoader;

beforeEach(() => {
loader = new CSVPackedLoader("path/to/file.csv");
});

describe("parse", () => {
test("should parse rows", async () => {
const raw = "foo,bar\n1,2\n3,4";
const expected = ["foo: 1\nbar: 2", "foo: 3\nbar: 4"];
expect(await loader.parse(raw)).toStrictEqual(expected);
});
});
});
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.11",
"version": "1.0.12",
"manifest_version": 3,
"name": "Lumos",
"description": "An LLM co-pilot for browsing the web, powered by local LLMs. Your prompts never leave the browser.",
Expand Down
72 changes: 61 additions & 11 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lumos",
"version": "1.0.11",
"version": "1.0.12",
"private": true,
"dependencies": {
"@chatscope/chat-ui-kit-react": "^1.10.1",
Expand All @@ -20,6 +20,7 @@
"@types/react-dom": "^18.2.15",
"@xenova/transformers": "^2.8.0",
"buffer": "^6.0.3",
"d3-dsv": "^2.0.0",
"fuse.js": "^7.0.0",
"langchain": "^0.1.21",
"markdown-to-jsx": "^7.4.1",
Expand Down Expand Up @@ -57,12 +58,14 @@
},
"devDependencies": {
"@types/css-modules": "^1.0.5",
"@types/d3-dsv": "^3.0.7",
"@types/react-syntax-highlighter": "^15.5.11",
"@typescript-eslint/parser": "^5.62.0",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.8.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
Expand Down
Binary file removed screenshots/lumos_screenshot_3.png
Binary file not shown.
Binary file added screenshots/lumos_screenshot_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit efb8835

Please sign in to comment.