2023-10-25 10:34:24 +08:00
|
|
|
|
|
|
|
import requests
|
|
|
|
import urllib3
|
2023-11-09 21:52:13 +08:00
|
|
|
from robowaiter.utils import get_root_path
|
|
|
|
from robowaiter.llm_client.single_round import single_round
|
2023-10-25 10:34:24 +08:00
|
|
|
########################################
|
|
|
|
# 该文件实现了与大模型的简单通信
|
|
|
|
########################################
|
|
|
|
|
|
|
|
# 忽略https的安全性警告
|
|
|
|
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
|
|
|
|
2023-11-09 21:52:13 +08:00
|
|
|
root_path = get_root_path()
|
|
|
|
# load test questions
|
|
|
|
|
|
|
|
|
2023-10-25 10:34:24 +08:00
|
|
|
def ask_llm(question):
|
2023-11-09 21:52:13 +08:00
|
|
|
ans = single_round(question)
|
|
|
|
return ans
|
2023-10-25 10:34:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2023-11-08 11:28:50 +08:00
|
|
|
question = '''
|
2023-11-09 16:07:02 +08:00
|
|
|
python中如何通过类名字符串的方式来代替isinstance的作用
|
2023-11-08 11:28:50 +08:00
|
|
|
'''
|
2023-10-25 10:34:24 +08:00
|
|
|
|
|
|
|
print(ask_llm(question))
|