RoboWaiter/robowaiter/llm_client/ask_llm.py

27 lines
655 B
Python
Raw Normal View History

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
########################################
# 该文件实现了与大模型的简单通信
########################################
# 忽略https的安全性警告
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
2023-11-09 21:52:13 +08:00
root_path = get_root_path()
# load test questions
def ask_llm(question):
2023-11-09 21:52:13 +08:00
ans = single_round(question)
return ans
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
'''
print(ask_llm(question))