mirror of
https://github.com/aljazceru/dev-gpt.git
synced 2025-12-24 09:04:19 +01:00
🧪 test: level 1
This commit is contained in:
@@ -37,9 +37,9 @@ class TaskSpecification:
|
||||
test: Optional[Text]
|
||||
|
||||
class Generator:
|
||||
def __init__(self, task_description, test_description, path, model='gpt-4'):
|
||||
self.gpt_session = gpt.GPTSession(task_description, test_description, model=model)
|
||||
self.microservice_specification = TaskSpecification(task=task_description, test=test_description)
|
||||
def __init__(self, task_description, path, model='gpt-4'):
|
||||
self.gpt_session = gpt.GPTSession(task_description, model=model)
|
||||
self.microservice_specification = TaskSpecification(task=task_description)
|
||||
self.microservice_root_path = path
|
||||
|
||||
def extract_content_from_result(self, plain_text, file_name, match_single_block=False, can_contain_code_block=True):
|
||||
|
||||
@@ -1,7 +1,30 @@
|
||||
import os
|
||||
from src.options.generate.generator import Generator
|
||||
|
||||
def test_generator(tmpdir):
|
||||
# The cognitive difficulty level is determined by the number of Requirements the microservice has.
|
||||
|
||||
def test_generation_level_0(tmpdir):
|
||||
"""
|
||||
Requirements:
|
||||
pip packages: ❌
|
||||
environment: ❌
|
||||
GPT-3.5-turbo: ❌
|
||||
APIs: ❌
|
||||
Databases: ❌
|
||||
"""
|
||||
os.environ['VERBOSE'] = 'true'
|
||||
generator = Generator("The microservice is very simple, it does not take anything as input and only outputs the word 'test'", "my test", str(tmpdir) + 'microservice', 'gpt-3.5-turbo')
|
||||
generator = Generator("The microservice is very simple, it does not take anything as input and only outputs the word 'test'", str(tmpdir) + 'microservice', 'gpt-3.5-turbo')
|
||||
generator.generate()
|
||||
|
||||
def test_generation_level_1(tmpdir):
|
||||
"""
|
||||
Requirements:
|
||||
pip packages: ✅
|
||||
environment: ❌
|
||||
GPT-3.5-turbo: ❌
|
||||
APIs: ❌
|
||||
Databases: ❌
|
||||
"""
|
||||
os.environ['VERBOSE'] = 'true'
|
||||
generator = Generator("The input is a PDF like https://www.africau.edu/images/default/sample.pdf and the output the parsed text", str(tmpdir) + 'microservice', 'gpt-3.5-turbo')
|
||||
generator.generate()
|
||||
Reference in New Issue
Block a user