13 Commits

Author SHA1 Message Date
Akhileshrangani4
0d0eed34b2 fix: apply code- discard button 2024-12-01 22:15:16 -05:00
Akhileshrangani4
0ae89341d2 feat: file path above each code snippet 2024-12-01 14:29:23 -05:00
Akhileshrangani4
6612692d98 feat: introduce apply button functionality (v0.1)
### Summary
- Added a new "Apply" button to code snippets provided by the AI assistant.
- The button is designed to seamlessly merge the AI-generated snippet into the relevant file in the editor.

### Current Issues
1. **Sticky Accept/Decline Buttons:** These activate for every snippet instead of being limited to the relevant snippet.
2. **Discard Button:** Currently non-functional.
3. **Highlight Inconsistencies:** The green-red code highlights for old and new code are inconsistent.

### To Do
- Implement a toast notification when the "Apply" button is pressed on an irrelevant tab to prevent code application errors.

### Workflow Implemented
1. The "Apply" button is added alongside "Copy" and "Reply" for AI-generated code snippets.
2. Upon clicking "Apply," the code snippet and relevant file content (active file) are sent to a secondary model (GPT-4O).
3. The system prompt for GPT-4O instructs it to merge the snippet with the file content:
   - Ensure the original file functionality remains intact.
   - Integrate the code snippet seamlessly.
4. The output from GPT-4O is injected directly into the code editor.
5. Changes are visually highlighted:
   - Green for new code.
   - Red for removed code.
6. Highlights remain until the user explicitly accepts or discards the changes.
2024-11-30 21:52:17 -05:00
Akhileshrangani4
534b148b86 feat: add dynamic file structure context in AI chat
- Improved file structure formatting with tree-like visualization
- Added filtering for ignored files and folders
- Added scripts section to template context
- Fixed folder hierarchy display with proper indentation
- Maintains sorting with folders first, then files alphabetically
- Now uses actual project files instead of template structure

Example output:
├── app/
│   ├── api/
│   └── page.tsx
├── components/
└── package.json
2024-11-30 15:53:30 -05:00
Akhileshrangani4
ba7a1dcc2c chore: formatting the code of recent changes 2024-11-29 13:05:35 -05:00
Akhileshrangani4
426af545bd feat: integrate template awareness into AI assistant
- Add template configurations with file structures and conventions
- Update AI route handler to include template context in system messages
- Pass template type through AIChat component
- Add template-specific run commands
- Enhance AI responses with project structure knowledge
- Move hardcoded run commands from navbar/run.tsx to templates/index.ts

This improves the AI's understanding of different project templates (React, Next.js, Streamlit, Vanilla JS) and enables more contextual assistance based on the project type.
2024-11-25 15:51:28 -05:00
Akhileshrangani4
34994a8c69 refactor(api): remove AI worker, add ai api route, add usage tiers
- Remove separate AI worker service
- Added generation limits:
  FREE: 1000/month (For the beta version)
  PRO: 500/month
  ENTERPRISE: 1000/month
- Integrate AI functionality into main API routes
- Added monthly generations reset and usage tier upgrade API routes
- Upgrade tier page to be added along with profile page section
2024-11-25 15:47:57 -05:00
Akhileshrangani4
b796f46dc2 fix: comment out live collaboration features 2024-11-17 22:08:26 -05:00
Ishaan Dey
6376493ae7 dynamic worker routes based on env 2024-05-26 18:37:36 -07:00
Ishaan Dey
c5762d430c update dockerfile env logic & deploy database cf worker 2024-05-05 22:33:24 -07:00
Ishaan Dey
09ead6073b ui + shared user improvements 2024-05-05 14:33:09 -07:00
Ishaan Dey
a18bcf9c14 mostly done liveblocks integration 2024-05-03 14:27:45 -07:00
Ishaan Dey
0f1654e3dd start liveblocks integration 2024-05-03 13:53:21 -07:00