Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic category from expense title #80

Merged
merged 19 commits into from
Feb 4, 2024

Conversation

mertd
Copy link
Contributor

@mertd mertd commented Feb 4, 2024

Automatically deduce category from expense title using the OpenAI API. See #72

I tried to follow the structure of the existing component and action files. Since spliit is the first project I am contributing to using Next.js and OpenAI APIs, I am particularly looking forward to feedback in this area.

The environment variable used to enable this feature could be merged with the one added in #69, e.g. NEXT_PUBLIC_ENABLE_AI. Similar to the receipt extraction feature, we could also add a "Beta" note to the category field. Please let me know your preferences.

@mertd
Copy link
Contributor Author

mertd commented Feb 4, 2024

I noticed that the receipt extract feature was not yet using the presigned uploads introduced in #65. I updated this and added a note to the Readme that S3 endpoints need to be public (internet facing). I also added a formatting util for string representations of categories.

@mertd mertd marked this pull request as draft February 4, 2024 06:35
@mertd mertd marked this pull request as ready for review February 4, 2024 06:54
Copy link
Member

@scastiel scastiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, it works so well!

An improvement suggestion (not a blocker for the PR): when the user enters a title and leaves the input, we could display a tiny loader at the right of the field to indicate there is something pending, until we get the result. @mertd let me know if you want to add it before I merge, if you want to do it later, or not 😉

@mertd
Copy link
Contributor Author

mertd commented Feb 4, 2024

Thank you! I like your suggestion. What do you think of replacing the dropdown arrow with a spinner like this when loading?
image

@scastiel
Copy link
Member

scastiel commented Feb 4, 2024

Thank you! I like your suggestion. What do you think of replacing the dropdown arrow with a spinner like this when loading? image

That’d be perfect!

Edit: oh you implemented it already, amazing! 🚀

@scastiel scastiel merged commit fb49fb5 into spliit-app:main Feb 4, 2024
1 check passed
@mertd mertd deleted the automatic-category branch February 4, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants