Skip to content

Commit

Permalink
Show error for --continue mode, remove deleted code
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jul 10, 2023
1 parent 0e49f98 commit 845d0f0
Showing 1 changed file with 3 additions and 36 deletions.
39 changes: 3 additions & 36 deletions llm/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def read_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:
Expand Down Expand Up @@ -254,42 +257,6 @@ def read_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():
Expand Down

0 comments on commit 845d0f0

Please sign in to comment.