Personal finance AI (v1) #2022

Merged
zachgoll merged 66 commits from zachgoll/ai-improvements into main 2025-03-29 01:08:22 +08:00

66 Commits

Author SHA1 Message Date
Zach Gollwitzer
c03b8d53bc Provider data boundaries 2025-03-27 18:44:20 -04:00
Zach Gollwitzer
94a3a87c7e Centralize provider error handling 2025-03-27 16:12:03 -04:00
Zach Gollwitzer
b31e8990a1 Get tests working with streaming responses 2025-03-27 14:33:15 -04:00
Zach Gollwitzer
05add6f4b3 Make AI sidebar wider when left sidebar is collapsed 2025-03-27 11:30:06 -04:00
Zach Gollwitzer
ce042fd250 Get streaming working 2025-03-27 08:02:29 -04:00
Zach Gollwitzer
e03f88a18c basic stream implementation 2025-03-26 17:09:12 -04:00
Zach Gollwitzer
866a504003 Ensure VCR fixtures working with latest code 2025-03-26 12:41:40 -04:00
Zach Gollwitzer
61ee7e3925 Remove stale data definitions from functions 2025-03-26 12:29:01 -04:00
Zach Gollwitzer
32df8661cc Simplify and clean up "thinking" interactions with Turbo frames 2025-03-26 12:22:08 -04:00
Zach Gollwitzer
866bcdaa07 Add income statement function 2025-03-26 11:56:44 -04:00
Zach Gollwitzer
90fbd841b2 Add better function calling error visibility 2025-03-26 11:56:37 -04:00
Zach Gollwitzer
b8608dde3c Add balance sheet function to assistant 2025-03-26 08:11:47 -04:00
Zach Gollwitzer
65b7f5d25e Fix sync error when security price has bad data from provider 2025-03-26 08:11:32 -04:00
Zach Gollwitzer
b56418540c Add back thinking messages, clean up error handling for chat 2025-03-25 22:13:28 -04:00
Zach Gollwitzer
4f7e4e40d8 Assistant function base implementation 2025-03-25 20:14:18 -04:00
Zach Gollwitzer
d6b6f02126 Use OpenAI conversation state management 2025-03-25 20:13:53 -04:00
Zach Gollwitzer
573ec67af8 Message styles 2025-03-25 07:52:38 -04:00
Zach Gollwitzer
0ac1c458fb Fix naming conflicts for ChatResponse 2025-03-24 19:32:53 -04:00
Zach Gollwitzer
3be4eb3528 Merge branch 'main' of github.com:maybe-finance/maybe into zachgoll/ai-improvements 2025-03-24 19:28:39 -04:00
Zach Gollwitzer
982fbabca9 Rebuild gemfile 2025-03-24 19:28:35 -04:00
Zach Gollwitzer
a2f182ec87 Reconfigure test env 2025-03-24 17:45:02 -04:00
Zach Gollwitzer
96d4a1ae1e Update openai class naming to avoid conflicts 2025-03-24 17:26:46 -04:00
Zach Gollwitzer
8cca82d360 Tests passing 2025-03-24 16:58:11 -04:00
Zach Gollwitzer
8fcb7b7dc7 Remove stale code 2025-03-24 09:25:49 -04:00
Zach Gollwitzer
2b23ecae31 Chat UI back to working state again 2025-03-24 08:45:38 -04:00
Zach Gollwitzer
8f66c0fbaa Process tool calls within provider 2025-03-23 20:50:59 -04:00
Zach Gollwitzer
5f47599930 Test updates 2025-03-23 15:21:27 -04:00
Zach Gollwitzer
8e698bfd07 Get assistant test working again 2025-03-21 17:20:18 -04:00
Zach Gollwitzer
63e24623fd Tool call implementation and test 2025-03-21 16:57:47 -04:00
Zach Gollwitzer
a68e5fffdc Tool calling tests and fixtures 2025-03-21 10:30:46 -04:00
Zach Gollwitzer
31aca27173 Improve data model to support tool calls and message types 2025-03-20 21:58:48 -04:00
Zach Gollwitzer
ee1ec8f357 Merge branch 'main' of github.com:maybe-finance/maybe into zachgoll/ai-improvements 2025-03-19 15:54:59 -04:00
Zach Gollwitzer
cf09fb2661 Reset migrations 2025-03-17 14:22:09 -04:00
Zach Gollwitzer
c750d82606 Merge branch 'main' of github.com:maybe-finance/maybe into zachgoll/ai-improvements 2025-03-17 14:21:25 -04:00
Zach Gollwitzer
6dc3f30a0e Naming, domain alignment 2025-03-15 08:55:26 -04:00
Zach Gollwitzer
474260f213 Consolidate Stimulus controllers, thinking state, controllers, and views 2025-03-14 17:36:17 -04:00
Zach Gollwitzer
216f8a42bf AI rules refresh 2025-03-14 10:01:25 -04:00
Zach Gollwitzer
6ce984c6f1 Match Figma design spec, implement Turbo frames and actions for chats controller 2025-03-14 07:55:05 -04:00
Zach Gollwitzer
aeff1f213f Integrate AI chat styles into existing prose pattern 2025-03-13 09:54:32 -04:00
Zach Gollwitzer
decebc8053 Remove structure.mdc from version control 2025-03-13 09:25:22 -04:00
Zach Gollwitzer
22af3b0a0f Simplify data model and get tests passing 2025-03-13 09:22:01 -04:00
Josh Pigford
51ff75df3a Update test fixtures and configurations for AI chat functionality
- Add family association to chat fixtures and tests
- Set consistent password digest for test users
- Enable AI for test users
- Add OpenAI access token for test environment
- Update chat and user model tests to include family context
2025-03-11 12:13:33 -05:00
Josh Pigford
7fdce5ce64 Add beta testing usage note to AI consent modal 2025-03-11 11:57:13 -05:00
Josh Pigford
50be73fbb8 Upgrade Biome and refactor JavaScript template literals
- Update @biomejs/biome to latest version with caret (^) notation
- Refactor AI query and chat controllers to use template literals
- Standardize npm scripts formatting in package.json
2025-03-11 11:54:47 -05:00
Josh Pigford
e1af36dbd8 Merge branch 'main' into ai 2025-03-11 11:50:11 -05:00
Josh Pigford
2dde2cab5f Add AI consent and enable/disable functionality for AI chat 2025-03-11 11:49:57 -05:00
Josh Pigford
64e7183e4d Enhance AI chat interaction with improved thinking indicator and scrolling behavior 2025-03-10 16:01:23 -05:00
Josh Pigford
7d0591fb30 Improve AI debug logging with payload size limits and internal message flag 2025-03-10 14:11:05 -05:00
Josh Pigford
6ec997f7e1 Enhance AI response processing with chat history context 2025-03-10 14:07:03 -05:00
Josh Pigford
f73fe3b6ba Missing comma 2025-03-10 13:55:04 -05:00
Josh Pigford
0fbcab5050 Merge branch 'main' into ai 2025-03-10 13:46:52 -05:00
Josh Pigford
d8fe5fa5f2 Add Markdown rendering support for AI chat messages
- Implement `markdown` helper method in ApplicationHelper using Redcarpet
- Update message view to render AI messages with Markdown formatting
- Add comprehensive Markdown rendering options (tables, code blocks, links)
- Enhance AI Financial Assistant prompt to encourage Markdown usage
- Remove commented Markdown CSS in Tailwind application stylesheet
2025-02-28 13:17:54 -05:00
Josh Pigford
4b0ac4ec8b Refactor AI sidebar and chat layout with improved structure and comments
- Remove inline AI chat from application layout
- Enhance AI sidebar with more semantic HTML structure
- Add descriptive comments to clarify different sections of chat view
- Improve flex layout and scrolling behavior in chat messages container
- Optimize message rendering with more explicit class names and structure
2025-02-28 13:08:40 -05:00
Josh Pigford
9c87deb508 Enhance AI Financial Assistant with Advanced Querying and Debugging Capabilities
- Implement comprehensive AI financial query system with function-based interactions
- Add detailed debug logging for AI responses and function calls
- Extend BalanceSheet and IncomeStatement models with AI-friendly methods
- Create robust error handling and fallback mechanisms for AI queries
- Update chat and message views to support debug mode and enhanced rendering
- Add AI query routes and initial test coverage for financial assistant
2025-02-28 12:52:10 -05:00
Josh Pigford
538c5924b4 Add OpenAI gem and AI-friendly data representations
- Add `ruby-openai` gem for AI integration
- Implement `to_ai_readable_hash` methods in BalanceSheet and IncomeStatement
- Include Promptable module in both models
- Add savings rate calculation method in IncomeStatement
- Prepare financial models for AI-powered insights and interactions
2025-02-28 09:26:08 -05:00
Josh Pigford
e8267618c2 Update general project rules with additional guidelines
- Add rule for using `Current.family` instead of `current_family`
- Include new guidelines for testing, API routes, and solution approach
- Expand project-specific rules for more consistent development practices
2025-02-27 21:43:30 -05:00
Josh Pigford
209fa73e54 Add frontmatter to project structure documentation
- Create initial frontmatter for structure.mdc file
- Include description and configuration options
- Prepare for potential dynamic documentation rendering
2025-02-27 21:09:29 -05:00
Josh Pigford
a7ec1cdefe Add chat clearing functionality with dynamic menu options
- Implement clear chat action in ChatsController
- Add clear chat route to support clearing messages
- Update AI sidebar with dropdown menu for chat actions
- Preserve system message when clearing chat
- Enhance chat interaction with new menu options
2025-02-27 18:11:45 -05:00
Josh Pigford
dbde017128 Refactor chat form and AI greeting with flexible partials
- Extract message form to a reusable partial with dynamic context support
- Create flexible AI greeting partial for consistent welcome messages
- Simplify chat and sidebar views by leveraging new partials
- Add support for different form scenarios (chat, new chat, sidebar)
- Improve code modularity and reduce duplication
2025-02-27 17:36:48 -05:00
Josh Pigford
c0a3ff86a2 Update sidebar controller to handle right panel width dynamically
- Add conditional width class for right sidebar panel
- Ensure consistent sidebar toggle behavior for both left and right panels
- Use specific width class for right panel (w-[375px])
2025-02-27 17:19:07 -05:00
Josh Pigford
fbe90b79a0 Extract AI avatar to a shared partial for consistent styling
- Refactor AI avatar rendering across chat views
- Replace hardcoded avatar markup with a reusable partial
- Simplify avatar display in chats and messages views
2025-02-26 14:48:34 -06:00
Josh Pigford
6b412c14cb Improve chat scroll behavior and message styling
- Refactor chat scroll functionality with Stimulus controller
- Optimize message scrolling in chat views
- Update message styling for better visual hierarchy
- Enhance chat container layout with flex and auto-scroll
- Simplify message rendering across different chat views
2025-02-26 14:46:05 -06:00
Josh Pigford
a48e9595b2 Refactor AI sidebar with enhanced chat menu and interactions
- Update sidebar layout with dynamic width and improved responsiveness
- Add new chat menu Stimulus controller for toggling between chat and chat list views
- Improve chat list display with recent chats and empty state
- Extract AI avatar to a partial for reusability
- Enhance message display and interaction styling
- Add more contextual buttons and interaction hints
2025-02-26 14:28:44 -06:00
Josh Pigford
f3c1876c8c Implement AI chat functionality with sidebar and messaging system
- Add chat and messages controllers
- Create chat and message views
- Implement chat-related routes
- Add message broadcasting and user interactions
- Update application layout to support chat sidebar
- Enhance user model with initials method
2025-02-26 12:52:12 -06:00
Josh Pigford
979d116c23 Add chat and message models with associations 2025-02-26 11:24:19 -06:00
Josh Pigford
92a91d2fe6 AI sidebar 2025-02-25 20:33:54 -06:00