43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""
|
|
这是什么?
|
|
这个文件用于函数插件的单元测试
|
|
运行方法 python crazy_functions/crazy_functions_test.py
|
|
"""
|
|
|
|
def validate_path():
|
|
import os, sys
|
|
dir_name = os.path.dirname(__file__)
|
|
root_dir_assume = os.path.abspath(os.path.dirname(__file__) + '/..')
|
|
os.chdir(root_dir_assume)
|
|
sys.path.append(root_dir_assume)
|
|
|
|
validate_path() # validate path so you can run from base directory
|
|
|
|
from toolbox import get_conf, ChatBotWithCookies
|
|
proxies, WEB_PORT, LLM_MODEL, CONCURRENT_COUNT, AUTHENTICATION, CHATBOT_HEIGHT, LAYOUT, API_KEY = \
|
|
get_conf('proxies', 'WEB_PORT', 'LLM_MODEL', 'CONCURRENT_COUNT', 'AUTHENTICATION', 'CHATBOT_HEIGHT', 'LAYOUT', 'API_KEY')
|
|
|
|
llm_kwargs = {
|
|
'api_key': API_KEY,
|
|
'llm_model': LLM_MODEL,
|
|
'top_p':1.0,
|
|
'max_length': None,
|
|
'temperature':1.0,
|
|
}
|
|
plugin_kwargs = { }
|
|
chatbot = ChatBotWithCookies(llm_kwargs)
|
|
history = []
|
|
system_prompt = "Serve me as a writing and programming assistant."
|
|
web_port = 1024
|
|
|
|
|
|
def test_总结word文档():
|
|
from crazy_functions.总结word文档 import 总结word文档
|
|
txt = "F:/AMD"
|
|
for _ in 总结word文档(txt, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt, web_port):
|
|
pass
|
|
|
|
test_总结word文档()
|
|
|
|
input("程序完成,回车退出。")
|
|
print("退出。") |