Skip to content

Commit

Permalink
Merge pull request #23 from bniladridas/update-ai-assistance
Browse files Browse the repository at this point in the history
Update AI assistance feature and model
  • Loading branch information
bniladridas authored Feb 24, 2025
2 parents 18e6b8b + c0e85b4 commit 8c6c512
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 34 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,11 @@
## [1.1.0] - 2025-03-01
### Added
- Dependabot configuration to manage dependencies and check for updates in `package.json` and `package-lock.json` files.

## [1.2.0] - 2025-04-01
### Added
- New AI assistance feature powered by Google Generative AI.

## [1.3.0] - 2025-05-01
### Added
- Updated the model to gemini-2.0-flash-thinking-exp-01-21.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
![AI Beta Image](images/ai-beta-image-file.png)

## Summary
Beta AI Editor allows AI-powered code generation and editing but has potential security concerns related to API key exposure and unauthorized data access.
Beta AI Editor allows AI-powered code generation and editing but has potential security concerns related to API key exposure and unauthorized data access. The latest update introduces AI assistance powered by Google Generative AI, enhancing the coding experience with intelligent suggestions and code generation capabilities.

## Details
Beta AI Editor integrates Google Generative AI, providing intelligent code suggestions. However, improper API key handling and insufficient request validation may lead to data exposure. The application does not enforce strict origin policies, potentially allowing unauthorized requests to access AI-generated content.
Expand Down Expand Up @@ -66,5 +66,18 @@ We have integrated Dependabot to help manage our dependencies and keep them up-t
- **Security Alerts**: Dependabot alerts you to security vulnerabilities in your dependencies and provides fixes.
- **Improved Code Quality**: By keeping dependencies up-to-date, you ensure that your project benefits from the latest features, bug fixes, and performance improvements.

## AI Assistance Feature
### How to Use the AI Assistance Feature
1. **Select Language**: Choose your preferred programming language from the dropdown menu.
2. **Enter Prompt**: Describe the code you want to generate in the input field.
3. **Generate Code**: Click the "Generate" button or press Enter to create the code.
4. **Edit Code**: Modify the generated code in the editor as needed.
5. **Save, Clear, Download**: Use the buttons to save, clear, or download your code.

### Benefits of AI Assistance
- **Intelligent Suggestions**: Receive real-time code suggestions to enhance productivity.
- **Code Generation**: Generate code snippets based on your descriptions.
- **Improved Workflow**: Streamline your coding process with AI-powered tools.

## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.
13 changes: 13 additions & 0 deletions docs/user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,19 @@ This guide provides an overview of how to use the Beta AI Editor effectively, em
2. **Curation**: Use the selection menus to choose elements from the AI suggestions.
3. **Save Your Work**: Make sure to save your changes regularly.

## AI Assistance Feature
### How to Use the AI Assistance Feature
1. **Select Language**: Choose your preferred programming language from the dropdown menu.
2. **Enter Prompt**: Describe the code you want to generate in the input field.
3. **Generate Code**: Click the "Generate" button or press Enter to create the code.
4. **Edit Code**: Modify the generated code in the editor as needed.
5. **Save, Clear, Download**: Use the buttons to save, clear, or download your code.

### Benefits of AI Assistance
- **Intelligent Suggestions**: Receive real-time code suggestions to enhance productivity.
- **Code Generation**: Generate code snippets based on your descriptions.
- **Improved Workflow**: Streamline your coding process with AI-powered tools.

## Data Privacy
We take your data privacy seriously. Here is how we handle your data:
- **Data Collection**: We collect personal information such as your name, email address, and usage data.
Expand Down
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<meta property="og:image" content="https://betaai-editor.vercel.app/images/ai-beta-image-file.png" />
<meta property="og:url" content="https://betaai-editor.vercel.app" />
<meta property="og:type" content="website" />
<meta name="description" content="Beta AI Editor now includes AI assistance powered by Google Generative AI. Enhance your coding experience with intelligent code suggestions and code generation capabilities." />
<title>Beta AI Editor</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" rel="stylesheet"/>
Expand Down
52 changes: 24 additions & 28 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"lucide-react": "^0.344.0",
"openai": "^4.85.1",
"react": "^18.3.1",
"react-dom": "^19.0.0"
"react-dom": "^18.3.1"
},
"devDependencies": {
"@eslint/js": "^9.9.1",
"@types/react": "^18.3.18",
"@types/react-dom": "^19.0.4",
"@types/react": "^19.0.10",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.3.4",
"autoprefixer": "^10.4.18",
"eslint": "^9.20.1",
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function App() {
setError('');

try {
const model = genAI.getGenerativeModel({ model: 'gemini-pro' });
const model = genAI.getGenerativeModel({ model: 'gemini-2.0-flash-thinking-exp-01-21' });
const promptText = `Generate ${selectedLanguage} code for: ${prompt}. Only provide the code, no explanations.`;

const result = await model.generateContent(promptText);
Expand Down Expand Up @@ -233,4 +233,4 @@ function App() {
);
}

export default App;
export default App;

0 comments on commit 8c6c512

Please sign in to comment.