|
|
|
@@ -20,9 +20,12 @@ ENV_ACCESS_TOKEN = "GPTTRACE_ACCESS_TOKEN" |
|
|
|
PROMPTS_DIR = Path("./prompts") |
|
|
|
|
|
|
|
|
|
|
|
def pretty_print(input, lexer=MarkdownLexer): |
|
|
|
def pretty_print(input, lexer=MarkdownLexer, *args, **kwargs): |
|
|
|
tokens = list(pygments.lex(input, lexer=lexer())) |
|
|
|
print_formatted_text(PygmentsTokens(tokens)) |
|
|
|
print_formatted_text(PygmentsTokens(tokens), *args, **kwargs) |
|
|
|
|
|
|
|
|
|
|
|
# print = pretty_print |
|
|
|
|
|
|
|
|
|
|
|
def main(): |
|
|
|
@@ -48,6 +51,9 @@ def main(): |
|
|
|
group.add_argument( |
|
|
|
"--train", help="Train ChatGPT with conversions we provided", action="store_true") |
|
|
|
|
|
|
|
parser.add_argument("-v", "--verbose", |
|
|
|
help="Show more details", action="store_true") |
|
|
|
|
|
|
|
parser.add_argument( |
|
|
|
"-u", |
|
|
|
"--uuid", |
|
|
|
@@ -120,7 +126,6 @@ No explanation required, no instruction required, don't tell me how to compile a |
|
|
|
What I want is a eBPF program for: {text}.""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def construct_running_prompt(text: str) -> str: |
|
|
|
return f"""You are now a translater from human language to {os.uname()[0]} shell bpftrace command. |
|
|
|
No explanation required. |
|
|
|
|