Skip to content

Commit

Permalink
feat(plugin/inbox): iterate on inbox v2
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminshafii authored Nov 16, 2024
1 parent dceccec commit 2474b02
Show file tree
Hide file tree
Showing 13 changed files with 908 additions and 1,053 deletions.
26 changes: 25 additions & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export async function POST(req: Request) {

import { ToolInvocation } from 'ai';
import { Message, useChat } from 'ai/react';
import { pipeline } from 'stream'

export default function Chat() {
const {
Expand Down Expand Up @@ -228,4 +229,27 @@ Additional Notes:
• Regularly update dependencies and libraries to their latest versions for improved performance and security.
• Test the chatbot thoroughly to handle edge cases and unexpected user inputs.

This revised prompt organizes the information more clearly, making it easier to understand and follow. It highlights key project guidelines, structures, and code examples, providing a comprehensive overview for anyone involved in the development process.
This revised prompt organizes the information more clearly, making it easier to understand and follow. It highlights key project guidelines, structures, and code examples, providing a comprehensive overview for anyone involved in the development process.


## pipeline

We have an inbox that processes files.

The process happens in these steps:
- preprocess : trim content | check if we support file type | check if we have a license
- extract (ai): extract text from file, we have a function in the plugin/index.ts for that
- classify (ai): classify the file, we have a function in the plugin/index.ts for that
- tag (ai): tag the file, we have a function in the plugin/index.ts for that
- format (ai): format the file, we have a function in the plugin/index.ts for that
- move: move the file to the correct folder, we have a function in the plugin/index.ts for that


each step should be logged in the record manager, and we should record the start and end of each step.

all the ai steps are two folds one api call to get the llm recommendations
and one call to apply the recommendation. add tag after tagging , move file after folder recommendation, rename file after naming

when you classify apply a tag to the document there's append tag funciton on plugin
only format if 1. there's a classification 2. there's no tag with the classification presetn

12 changes: 10 additions & 2 deletions plugin/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { Notice } from "obsidian";

export const VALID_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "gif", "svg", "webp"];
export const VALID_IMAGE_EXTENSIONS = [
"png",
"jpg",
"jpeg",
"gif",
"svg",
"webp",
];

export const VALID_AUDIO_EXTENSIONS = [
"mp3",
Expand All @@ -15,6 +22,7 @@ export const VALID_AUDIO_EXTENSIONS = [
export const VALID_MEDIA_EXTENSIONS = [
...VALID_IMAGE_EXTENSIONS,
...VALID_AUDIO_EXTENSIONS,
"pdf",
];

export const VALID_TEXT_EXTENSIONS = ["md", "txt"];
Expand All @@ -36,4 +44,4 @@ export const isValidExtension = (extension: string): boolean => {
new Notice("Sorry, FileOrganizer does not support this file type.");
}
return isSupported;
};
};
Loading

0 comments on commit 2474b02

Please sign in to comment.