Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
samholt committed Apr 16, 2024
1 parent a187f94 commit ed25d03
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 11 deletions.
43 changes: 34 additions & 9 deletions l2mac/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
import sys
from typing import Optional
from typing_extensions import Annotated
import typer

app = typer.Typer(help="Generate based on the prompt with LLM-automatic Computer")

@app.command()
def run_l2mac(prompt_task: Annotated[str, typer.Argument(help="Your input prompt to generate for such as 'Create a playable snake game in PyGame'")],
domain: Annotated[str, typer.Option(help="Domain to generate, existing options are 'codebase', 'book'.")] = "codebase",
run_tests: Annotated[bool, typer.Option(help="Whether to run self-generated unit-tests when generating code.")] = False,
project_name: Annotated[Optional[str], typer.Option(help="Unique project name, such as 'snakegame'.")] = None,
steps: Annotated[int, typer.Option(help="Number of internal steps to use when creating the prompt program internally.")] = 10,
prompt_program: Annotated[Optional[str], typer.Option(help="Path to the prompt program to use, or the prompt program as a string in a list format.")] = None,
prompts_file_path: Annotated[Optional[str], typer.Option(help="Overrides the existing prompts to be used. Useful when creating a new prompt set for a new task.")] = None,
tools_enabled: Annotated[Optional[str], typer.Option(help="List of functions that the agents can use.")] = None,
debugging_level: Annotated[str, typer.Option(help="Whether to print full context-windows out.")] = "Medium",
init_config: Annotated[bool, typer.Option(help="Initialize the configuration file for L2MAC.")] = False):
"""
Generate based on the prompt with LLM-automatic Computer
"""
# Implementation of functionality goes here.
# For now, just printing received options for demonstration.
print(f"Prompt Task: {prompt_task}")
print(f"Domain: {domain}")
print(f"Run Tests: {run_tests}")
print(f"Project Name: {project_name}")
print(f"Steps: {steps}")
print(f"Prompt Program: {prompt_program}")
print(f"Prompts File Path: {prompts_file_path}")
print(f"Tools Enabled: {tools_enabled}")
print(f"Debugging Level: {debugging_level}")
print(f"Init Config: {init_config}")
return None

def l2mac():
if len(sys.argv) > 1:
input_text = sys.argv[1]
print(f"Processing input: {input_text}")
# Your functionality here, e.g., process the input text
else:
print("Please provide an input.")

if __name__ == '__main__':
l2mac()
app()
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pyyaml
pydantic
pydantic
typer>=0.9.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages=find_packages(),
entry_points={
'console_scripts': [
'l2mac = l2mac.main:main'
'l2mac = l2mac.main:app'
]
}
)

0 comments on commit ed25d03

Please sign in to comment.