diff --git a/askchat/__init__.py b/askchat/__init__.py index 580ab93..3393e07 100644 --- a/askchat/__init__.py +++ b/askchat/__init__.py @@ -2,7 +2,7 @@ __author__ = """Rex Wang""" __email__ = '1073853456@qq.com' -__version__ = '1.1.3' +__version__ = '1.1.4' import asyncio from pathlib import Path diff --git a/askchat/cli.py b/askchat/cli.py index c6b343a..6518119 100644 --- a/askchat/cli.py +++ b/askchat/cli.py @@ -203,7 +203,19 @@ def main( message, model, base_url, api_base, api_key, use_env click.echo("Please specify message!") return chat.user(message_text) - # Add chat response + # additinal options + if option: + option = dict(option) + ints = ['max_tokens', 'n', 'top_logprobs', 'seed'] + floats = ['temperature', 'presence_penalty', 'frequency_penalty', 'top_p'] + for key, value in option.items(): + if key in ints: + option[key] = int(value) + elif key in floats: + option[key] = float(value) + else: + option = {} + # Add chat responses chat.assistant(asyncio.run(show_resp(chat, **dict(option)))) chat.save(LAST_CHAT_FILE, mode='w') diff --git a/setup.py b/setup.py index 260b13c..4d1b785 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages -VERSION = '1.1.3' +VERSION = '1.1.4' with open('README.md') as readme_file: readme = readme_file.read()