Pythagora-io / gpt-pilot

The first real AI developer
Other
29.65k stars 2.95k forks source link

[Bug]: json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 30 (char 29) #477

Open idsus opened 8 months ago

idsus commented 8 months ago

Version

VisualStudio Code extension

Operating System

Windows 11

What happened?

When trying to use the extension I am getting this error (down below). Also, when running the main.py in the project I am getting the common dotenv not found error.

Describe your app in as much detail as possible.
---------- GPT PILOT EXITING WITH ERROR ----------

Traceback (most recent call last):

File "c:\AppsProjects\gpt-pilot\pilot\main.py", line 78, in <module> project.start()

File "c:\AppsProjects\gpt-pilot\pilot\helpers\Project.py", line 90, in start self.project_manager.get_project_description()

File "c:\AppsProjects\gpt-pilot\pilot\helpers\agents\ProductOwner.py", line 53, in get_project_description self.project.main_prompt = ask_for_main_app_definition(self.project) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "c:\AppsProjects\gpt-pilot\pilot\prompts\prompts.py", line 40, in ask_for_main_app_definition description = styled_text( ^^^^^^^^^^^^

File "c:\AppsProjects\gpt-pilot\pilot\utils\questionary.py", line 32, in styled_text response = print(question, type='user_input_request') ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "c:\AppsProjects\gpt-pilot\pilot\utils\custom_print.py", line 24, in print_to_external_process return ipc_client_instance.listen() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "c:\AppsProjects\gpt-pilot\pilot\helpers\ipc.py", line 32, in listen message = json.loads(data) ^^^^^^^^^^^^^^^^

File "C:\Users\suh\AppData\Local\Programs\Python\Python312\Lib\json_init_.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\suh\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "C:\Users\suh\AppData\Local\Programs\Python\Python312\Lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) ^^^^^^^^^^^^^^^^^^^^^^

json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 30 (char 29)

--------------------------------------------------
senko commented 8 months ago

Did you copy/paste the initial prompt (project description)? If so, could you check (in any editor) how long it is, in bytes? We have a bug where the initial description can be cut short and result in this error so I'd like to check if that's the case here.

Regarding the dotenv error, if the VSCode extension runs but the command-line don't, this just means you haven't activated your python virtualn environment before starting GPT Pilot (VSCode extension does this automatically). This needs to be done every time you open a terminal, something like this:

  1. Open your terminal
  2. Navigate to the GPT Pilot directory
  3. There should be a pilot-env subdirectory in it (this is the Python virtual environment created by VSCode installation and the one it uses)
  4. Run \pilot-env\Scripts\activate
  5. Go to the pilot subdirectory: cd pilot
  6. Start GPT Pilot: python main.py
idsus commented 8 months ago

My prompt is about 7373 bytes long, I guess it's too long. And thank you for the dotenv error fix. I'm kind of scared to try it out as it risks money as I think my prompt is a little too complex for it to handle.

I edited it to shorten it with ChatGPT now:

LearnMedia is an innovative MERN stack-based platform that revolutionizes the educational ecosystem by blending social media and digital learning. Key features include:

Integrated Educational Content Hub: Combining aspects of Instagram, YouTube, and Zoom, it offers multimedia-rich resources like instructional videos, live tutoring, and interactive media.

Scholarly Publishing and Ebooks with Discussion Forum: Mirrors scholarly journals with a Reddit-style forum, encouraging debates and idea exchanges.

Real-time Collaborative Workspace: Inspired by Google Docs and Slack, it facilitates document editing, project management, and team communication.

Interactive Multiplayer Whiteboard and Mind Mapping: Integrates elements of Miro, Jamboard, and MindMeister for brainstorming and visual learning.

Advanced Code Collaboration Space: Like Replit IDE and Github, tailored for coding projects with an IDE environment and version control.

Community Engagement and Professional Networking: Blends LinkedIn and Facebook Groups dynamics for academic collaborations and professional connections.

Blogging, Insight Sharing, and Podcasting Platform: Parallel to Medium and Spotify, it supports multimedia formats for personal narratives and educational storytelling.

Interactive Learning Tools and Pathway Helper: Influenced by Quizlet and Duolingo, it includes quizzes, flashcards, and a personalized learning pathway assistant.

Virtual Classroom and Event Hosting: Echoes Zoom and Eventbrite, offering tools for webinars, workshops, and lectures.

Gamification and Reward System: Draws from Kahoot! and LinkedIn Learning to motivate users through rewards and achievements.

Admin Panel for Platform Management: A custom-developed panel for user management, content moderation, and analytics.

Profile Portfolio Page: Combines elements of Behance and LinkedIn, allowing users to showcase educational and professional achievements.