mirror of
https://github.com/Hopiu/llm.git
synced 2026-05-15 17:23:09 +00:00
Show error for --continue mode, remove deleted code
This commit is contained in:
parent
02a930dd8e
commit
6cdbc7a270
1 changed files with 3 additions and 36 deletions
39
llm/cli.py
39
llm/cli.py
|
|
@ -178,6 +178,9 @@ def prompt(
|
|||
model_id = template_obj.model
|
||||
|
||||
history_model = None
|
||||
|
||||
if _continue or chat_id:
|
||||
raise click.ClickException("--continue mode is not yet implemented")
|
||||
# TODO: Re-introduce --continue mode
|
||||
# messages = []
|
||||
# if _continue:
|
||||
|
|
@ -254,42 +257,6 @@ def prompt(
|
|||
|
||||
# TODO: Figure out OpenAI exception handling
|
||||
|
||||
return
|
||||
# Original code:
|
||||
# try:
|
||||
# debug = {}
|
||||
# if no_stream:
|
||||
# start = time.time()
|
||||
# response = openai.ChatCompletion.create(
|
||||
# model=model,
|
||||
# messages=messages,
|
||||
# )
|
||||
# debug["model"] = response.model
|
||||
# debug["usage"] = response.usage
|
||||
# content = response.choices[0].message.content
|
||||
# log(no_log, system, prompt, content, model, chat_id, debug, start)
|
||||
# print(content)
|
||||
# else:
|
||||
# start = time.time()
|
||||
# response = []
|
||||
# for chunk in openai.ChatCompletion.create(
|
||||
# model=model,
|
||||
# messages=messages,
|
||||
# stream=True,
|
||||
# ):
|
||||
# debug["model"] = chunk.model
|
||||
# content = chunk["choices"][0].get("delta", {}).get("content")
|
||||
# if content is not None:
|
||||
# response.append(content)
|
||||
# print(content, end="")
|
||||
# sys.stdout.flush()
|
||||
# print("")
|
||||
# log(no_log, system, prompt, "".join(response), model, chat_id, debug, start)
|
||||
# except openai.error.AuthenticationError as ex:
|
||||
# raise click.ClickException("{}: {}".format(ex.error.type, ex.error.code))
|
||||
# except openai.error.OpenAIError as ex:
|
||||
# raise click.ClickException(str(ex))
|
||||
|
||||
|
||||
@cli.command()
|
||||
def init_db():
|
||||
|
|
|
|||
Loading…
Reference in a new issue