mirror of
https://github.com/OMGeeky/gpt-pilot.git
synced 2026-02-23 15:49:50 +01:00
rejecting responses that are not JSON.
Need to fix prompts for GPT-4
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
class MockQuestionary:
|
||||
def __init__(self, answers=None):
|
||||
def __init__(self, answers=None, initial_state='project_description'):
|
||||
if answers is None:
|
||||
answers = []
|
||||
self.answers = iter(answers)
|
||||
self.state = 'project_description'
|
||||
self.state = initial_state
|
||||
|
||||
class Style:
|
||||
def __init__(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def text(self, question: str, style=None):
|
||||
print('AI: ' + question)
|
||||
@@ -13,6 +17,9 @@ class MockQuestionary:
|
||||
self.state = 'DONE'
|
||||
return self
|
||||
|
||||
def ask(self):
|
||||
return self.unsafe_ask()
|
||||
|
||||
def unsafe_ask(self):
|
||||
if self.state == 'user_stories':
|
||||
answer = ''
|
||||
|
||||
11
pilot/test/test_utils.py
Normal file
11
pilot/test/test_utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from unittest.mock import Mock
|
||||
|
||||
|
||||
def mock_terminal_size():
|
||||
mock_size = Mock()
|
||||
mock_size.columns = 80 # or whatever width you want
|
||||
return mock_size
|
||||
|
||||
def assert_non_empty_string(value):
|
||||
assert isinstance(value, str)
|
||||
assert len(value) > 0
|
||||
Reference in New Issue
Block a user