Commit d521b79d authored by Yaowentong's avatar Yaowentong

ai对话机器人修复

parent 3fc3b1a8
......@@ -17,6 +17,7 @@ def _streaming_request(url, model,messages,type, batch_size=50):
"type":type
}
}
headers = {
'Authorization': API_KEY,
'Content-Type': 'application/json'
......@@ -222,7 +223,7 @@ def get_bot_with_history_rag_stream(messages,type = "auto", batch_size=DEFAULT_B
# 图像识别
def get_image_to_text_stream(content,type = "auto", batch_size=DEFAULT_BATCH_SIZE):
def get_image_to_text_stream(content,type = "disabled", batch_size=DEFAULT_BATCH_SIZE):
messages = [{"content": content, "role": "user"}]
return _streaming_request(
url=CHAT_COMPLETIONS_URL,
......@@ -263,6 +264,4 @@ def get_ai_chat_history_stream_comment(messages, type = "disabled", batch_size=D
)
if __name__ == '__main__':
print(get_ai_chat_history_stream_comment("文案改写"))
......@@ -642,3 +642,5 @@ def extract_user_contents(dialogues):
if item['role'] == 'user':
user_contents.append(item['content'])
return user_contents
......@@ -54,7 +54,6 @@ def is_valid_xiaohongshu_link(url: str) -> bool:
def get_xhs_info(video_url):
url = ""
if is_valid_xiaohongshu_link(video_url):
print(video_url)
url = f"http://172.16.18.10:8875/api/v1/xhs?share_url={quote_plus(video_url)}"
payload = {}
headers = {}
......@@ -120,7 +119,7 @@ if __name__ == '__main__':
# # url= "https://v.kuaishou.com/KFy0JkVY"
# # "29 【要当可爱的水手啦~~~ - 夹克本人 | 小红书 - 你的生活兴趣社区】 😆 tx3lJkm14vxxx1A 😆 https://www.xiaohongshu.com/discovery/item/6894c614000000000403dcad?source=webshare&xhsshare=pc_web&xsec_token=CBmYaPr2HJVyffdsKGD_zkN5gOTLXgasc3dPOzNRGjKhs=&xsec_source=pc_share"
# # #
url= "https://v.douyin.com/MXCfDjwnbBs/ "
result = get_dy_ocr_info(url)
url= "https://www.xiaohongshu.com/discovery/item/69d6aae5000000002102da3e?source=webshare&xhsshare=pc_web&xsec_token=CBxnnqlpIrloQXUm5cqwsVQpcNWp7RDwb9XCFKqq_d510=&xsec_source=pc_share "
result = get_xhs_info(url)
print(result)
# # print(len(result))
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment