Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions agents/impl_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,20 @@ def foo(self) -> str:
'and make sure the problems are addressed so that all tests pass.'
)

def str_to_str(self, request: ImplGenerationRequest) -> str:
"""Returns the test implementation code."""
async def generate_async(self, request: ImplGenerationRequest) -> str:
"""Returns the implementation code asynchronously."""
if request.prior_attempts:
prompt = self._make_improvement_prompt(request.interface_str, request.test_str, request.prior_attempts)
else:
prompt = self._make_initial_prompt(request.interface_str, request.test_str)

result = asyncio.run(self._impl_creator_agent.run(prompt))
result = await self._impl_creator_agent.run(prompt)
return utils.extract_code(result.output)

def str_to_str(self, request: ImplGenerationRequest) -> str:
"""Returns the implementation code."""
return asyncio.run(self.generate_async(request))

def str_to_file(self, request: ImplGenerationRequest, output_path: str) -> str:
impl_str = self.str_to_str(request)
with open(output_path, 'w') as output_file:
Expand Down
14 changes: 9 additions & 5 deletions agents/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ def _make_improvement_prompt(
f'{utils.wrap_code_in_markdown(python_interface)}'
)

def str_to_str(
self, request: TestGenerationRequest
) -> str:
"""Returns the test implementation code."""
async def generate_async(self, request: TestGenerationRequest) -> str:
"""Returns the test implementation code asynchronously."""
if request.prior_attempts:
prompt = self._make_improvement_prompt(interface_str=request.interface_str, prior_attempts=request.prior_attempts)
else:
prompt = self._make_initial_prompt(interface_str=request.interface_str)
result = asyncio.run(self._test_creator_agent.run(prompt))
result = await self._test_creator_agent.run(prompt)
return utils.extract_code(result.output)

def str_to_str(
self, request: TestGenerationRequest
) -> str:
"""Returns the test implementation code."""
return asyncio.run(self.generate_async(request))

def str_to_file(self, request: TestGenerationRequest, output_path: str) -> str:
test_str = self.str_to_str(request)
with open(output_path, 'w') as output_file:
Expand Down
24 changes: 24 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading