-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pyyaml | ||
pydantic | ||
pydantic | ||
typer>=0.9.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters