fix local vector store bug

This commit is contained in:
binary-husky
2023-12-06 22:45:14 +08:00
parent 8a6e96c369
commit 7bac8f4bd3
3 changed files with 49 additions and 51 deletions

View File

@@ -49,18 +49,18 @@ class VoidTerminal():
pass
vt = VoidTerminal()
vt.get_conf = (get_conf)
vt.set_conf = (set_conf)
vt.set_multi_conf = (set_multi_conf)
vt.get_plugin_handle = (get_plugin_handle)
vt.get_plugin_default_kwargs = (get_plugin_default_kwargs)
vt.get_chat_handle = (get_chat_handle)
vt.get_chat_default_kwargs = (get_chat_default_kwargs)
vt.get_conf = silence_stdout_fn(get_conf)
vt.set_conf = silence_stdout_fn(set_conf)
vt.set_multi_conf = silence_stdout_fn(set_multi_conf)
vt.get_plugin_handle = silence_stdout_fn(get_plugin_handle)
vt.get_plugin_default_kwargs = silence_stdout_fn(get_plugin_default_kwargs)
vt.get_chat_handle = silence_stdout_fn(get_chat_handle)
vt.get_chat_default_kwargs = silence_stdout_fn(get_chat_default_kwargs)
vt.chat_to_markdown_str = (chat_to_markdown_str)
proxies, WEB_PORT, LLM_MODEL, CONCURRENT_COUNT, AUTHENTICATION, CHATBOT_HEIGHT, LAYOUT, API_KEY = \
vt.get_conf('proxies', 'WEB_PORT', 'LLM_MODEL', 'CONCURRENT_COUNT', 'AUTHENTICATION', 'CHATBOT_HEIGHT', 'LAYOUT', 'API_KEY')
def plugin_test(main_input, plugin, advanced_arg=None):
def plugin_test(main_input, plugin, advanced_arg=None, debug=True):
from rich.live import Live
from rich.markdown import Markdown
@@ -72,7 +72,10 @@ def plugin_test(main_input, plugin, advanced_arg=None):
plugin_kwargs['main_input'] = main_input
if advanced_arg is not None:
plugin_kwargs['plugin_kwargs'] = advanced_arg
my_working_plugin = silence_stdout(plugin)(**plugin_kwargs)
if debug:
my_working_plugin = (plugin)(**plugin_kwargs)
else:
my_working_plugin = silence_stdout(plugin)(**plugin_kwargs)
with Live(Markdown(""), auto_refresh=False, vertical_overflow="visible") as live:
for cookies, chat, hist, msg in my_working_plugin: