Skip to content

Commit fa05120

Browse files
authored
Merge pull request #17 from digitalex/feat-react-frontend
feat: Add React frontend and FastAPI backend. Jules is nailing it
2 parents 1242845 + daaf912 commit fa05120

29 files changed

Lines changed: 25310 additions & 8 deletions

agents/impl_generator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,20 @@ def foo(self) -> str:
7373
'and make sure the problems are addressed so that all tests pass.'
7474
)
7575

76-
def str_to_str(self, request: ImplGenerationRequest) -> str:
77-
"""Returns the test implementation code."""
76+
async def generate_async(self, request: ImplGenerationRequest) -> str:
77+
"""Returns the implementation code asynchronously."""
7878
if request.prior_attempts:
7979
prompt = self._make_improvement_prompt(request.interface_str, request.test_str, request.prior_attempts)
8080
else:
8181
prompt = self._make_initial_prompt(request.interface_str, request.test_str)
8282

83-
result = asyncio.run(self._impl_creator_agent.run(prompt))
83+
result = await self._impl_creator_agent.run(prompt)
8484
return utils.extract_code(result.output)
8585

86+
def str_to_str(self, request: ImplGenerationRequest) -> str:
87+
"""Returns the implementation code."""
88+
return asyncio.run(self.generate_async(request))
89+
8690
def str_to_file(self, request: ImplGenerationRequest, output_path: str) -> str:
8791
impl_str = self.str_to_str(request)
8892
with open(output_path, 'w') as output_file:

agents/test_generator.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,17 +66,21 @@ def _make_improvement_prompt(
6666
f'{utils.wrap_code_in_markdown(python_interface)}'
6767
)
6868

69-
def str_to_str(
70-
self, request: TestGenerationRequest
71-
) -> str:
72-
"""Returns the test implementation code."""
69+
async def generate_async(self, request: TestGenerationRequest) -> str:
70+
"""Returns the test implementation code asynchronously."""
7371
if request.prior_attempts:
7472
prompt = self._make_improvement_prompt(interface_str=request.interface_str, prior_attempts=request.prior_attempts)
7573
else:
7674
prompt = self._make_initial_prompt(interface_str=request.interface_str)
77-
result = asyncio.run(self._test_creator_agent.run(prompt))
75+
result = await self._test_creator_agent.run(prompt)
7876
return utils.extract_code(result.output)
7977

78+
def str_to_str(
79+
self, request: TestGenerationRequest
80+
) -> str:
81+
"""Returns the test implementation code."""
82+
return asyncio.run(self.generate_async(request))
83+
8084
def str_to_file(self, request: TestGenerationRequest, output_path: str) -> str:
8185
test_str = self.str_to_str(request)
8286
with open(output_path, 'w') as output_file:

frontend/.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

0 commit comments

Comments
 (0)