(args: argparse.Namespace)
| 182 | |
| 183 | @staticmethod |
| 184 | def cmd(args: argparse.Namespace) -> None: |
| 185 | model_name, client = _interactive_cli(args) |
| 186 | |
| 187 | if args.quick: |
| 188 | completion = client.completions.create(model=model_name, prompt=args.quick) |
| 189 | print(completion.choices[0].text) |
| 190 | return |
| 191 | |
| 192 | print("Please enter prompt to complete:") |
| 193 | while True: |
| 194 | try: |
| 195 | input_prompt = input("> ") |
| 196 | except EOFError: |
| 197 | break |
| 198 | completion = client.completions.create(model=model_name, prompt=input_prompt) |
| 199 | output = completion.choices[0].text |
| 200 | print(output) |
| 201 | |
| 202 | @staticmethod |
| 203 | def add_cli_args(parser: FlexibleArgumentParser) -> FlexibleArgumentParser: |
nothing calls this directly
no test coverage detected