Skip to content

Commit

Permalink
fix regenerate method
Browse files Browse the repository at this point in the history
  • Loading branch information
RexWzh committed Nov 23, 2024
1 parent 7b8c9d8 commit 85d0080
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion askchat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__author__ = """Rex Wang"""
__email__ = '[email protected]'
__version__ = '1.2.2'
__version__ = '1.2.3'

import asyncio
from pathlib import Path
Expand Down
6 changes: 4 additions & 2 deletions askchat/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ def main( message, model, base_url, api_base, api_key, use_env
chattool.load_envs() # update the environment variables in chattool
# print chat messages
if p:
fname = message_text if message_text else '_last_chat'
fname = f"{CONFIG_PATH}/{fname}.json"
fname = f"{CONFIG_PATH}/{message_text}.json" if message_text else LAST_CHAT_FILE
try:
Chat().load(fname).print_log()
except FileNotFoundError:
Expand All @@ -189,6 +188,9 @@ def main( message, model, base_url, api_base, api_key, use_env
click.echo("You should have at least two messages in the conversation")
return
chat.pop()
if message_text: # user message
chat.pop()
chat.user(message_text)
elif c: # continue the last conversation
if not message_text:
click.echo("Please specify message!")
Expand Down

0 comments on commit 85d0080

Please sign in to comment.