You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.1 KiB

# 腾讯 AI Lab 的中文词向量
https://dsideal.obs.cn-north-1.myhuaweicloud.com/HuangHai/Tencent_AILab_ChineseEmbedding/Tencent_AILab_ChineseEmbedding.tar.gz
# 显示已安装包的版本号
pip show gensim
pip show jieba
pip show pymilvus
if '生成图片' in prompt or '生图' in prompt:
success, key = generate_image(prompt)
if success:
image_url = f"{OSS_PREFIX}{key}"
image_width, image_height = getImgWidthHeight(image_url)
# 记录聊天数据到 MySQL
await save_chat_to_mysql(app.state.mysql_pool, person_id, prompt,
key, '', 0, input_type=2, output_type=4,
input_image_type=0, image_width=image_width, image_height=image_height)
# 返回数据
return {
"success": True,
"url": None,
"duration": 0, # 返回大模型的回复时长
"response": key, # 返回大模型的回复
}