-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Fix: Necessary corrections for the updated improve
function
#1027
Conversation
What's next step to merge :) |
Hi, @AntonOsika I may need some time to reproduce and solve bugs. But this PR can currently be closed until all the work is done and then raised again. |
Hi @similato87 , one request, gpt-engineer/gpt_engineer/core/diff.py Line 121 in 301a920
You can checkout ideas on how to break this function into smaller pieces from this book's chapter on |
Hi @vgvishesh, thank you for recommending the refactoring of validate_and_correct(). We're actively working on that, along with enhancing the |
Found another bug while testing the existing Improve flow on main branch: input_diff:
Getting below error here:
|
Thanks for providing it. Can I trouble you to provide the full chat file as well? It should be in your_project_path/.gpteng/memory/improve.txt. |
sure, here is the full chat response that I received from openAI: To implement a toggle button for switching between dark and light modes, we need to follow these steps:
Here are the diffs for the changes: --- src/App.tsx
+++ src/App.tsx
@@ -1,5 +1,9 @@
import React from 'react';
+import { useState, useEffect } from 'react';
import QRCode from 'qrcode.react';
import { profiles } from './components/SocialLinks';
import { SocialLinks } from './components/SocialLinks';
+import './styles.css';
+const THEME_LIGHT = 'light';
+const THEME_DARK = 'dark';
@@ -6,7 +10,23 @@
const App: React.FC = () => {
+ const [theme, setTheme] = useState(THEME_LIGHT);
+
+ useEffect(() => {
+ document.body.className = theme;
+ }, [theme]);
+
+ const toggleTheme = () => {
+ setTheme(theme === THEME_LIGHT ? THEME_DARK : THEME_LIGHT);
+ };
+
return (
+ <button className="theme-toggle" onClick={toggleTheme}>
+ {theme === THEME_LIGHT ? 'Dark Mode' : 'Light Mode'}
+ </button>
<div className="profile-card-container">
<div className="profile-card">
<h1 className="profile-title">My Social Profiles QR Code</h1>
@@ -18,4 +38,4 @@
};
export default App; --- src/styles.css
+++ src/styles.css
@@ -1,9 +1,11 @@
+.theme-toggle {
+ position: absolute;
+ top: 10px;
+ right: 10px;
+ padding: 10px;
+ cursor: pointer;
+}
+
.profile-card-container {
display: flex;
flex-direction: column;
@@ -8,3 +10,15 @@
justify-content: center;
min-height: 100vh;
padding: 20px;
- background-color: #296E01; /* Metallic green color */
+ background-color: var(--background-color);
+}
+
+body.light {
+ --background-color: #296E01; /* Metallic green color */
+ /* Other light theme styles can be added here */
+}
+
+body.dark {
+ --background-color: #121212; /* Dark color for dark mode */
+ /* Other dark theme styles can be added here */
+} These changes yield a fully functional program according to the instructions. |
Hey man @similato87 , seems like I am dead stuck bec of
I got the below console logs:
|
Hi @vgvishesh , thank you for providing more details. I have implemented an empty check for such cases. Given the potential for various kinds of invalid inputs from LLMs, we plan to develop a more effective feedback system for addressing errors in the |
PR Fix for Issue #1026
This PR addresses and resolves the issues described in #1026. It implements the necessary corrections in the updated
improve
function, ensuring enhanced stability and functionality.Next Steps: