MCPcopy Index your code
hub / github.com/PaddlePaddle/FastDeploy / cmd

Method cmd

fastdeploy/entrypoints/cli/openai.py:184–200  ·  view source on GitHub ↗
(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 3

_interactive_cliFunction · 0.85
printFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected