OMbot QA Engine
Project description
QA engine
OMBot项目的QA引擎,提供项目问答功能
使用方法
1. 触发闲聊模式
from qa_engine import QAEngine
from ombot_utils.schemas import ChatRecords
if __name__ == '__main__':
qa = QAEngine()
records = {
"bot_id": "2",
"session_id": "string",
"callback": "string",
"messages": [
{
"role": "user",
"message_type": "image",
"src_type": "url",
"content": "https://minio/hzlh/omintel/cess/c25f30559b974c728e5dbe1d4177aa5a.jpg",
"objects": []
},
{
"role": "user",
"message_type": "text",
"src_type": "text",
"content": "你好,请问你是谁?",
"objects": []
}
]
}
records = ChatRecords(**records)
qa.run(bot_id="2", chat_records=records)
1. 触发专业模式
from qa_engine import QAEngine
from ombot_utils.schemas import ChatRecords
if __name__ == '__main__':
qa = QAEngine()
records = {
"bot_id": "2",
"session_id": "string",
"callback": "string",
"messages": [
{
"role": "user",
"message_type": "image",
"src_type": "url",
"content": "https://minio/hzlh/omintel/cess/c25f30559b974c728e5dbe1d4177aa5a.jpg",
"objects": []
},
{
"role": "user",
"message_type": "text",
"src_type": "text",
"content": "视频中有人摔倒吗?",
"objects": []
}
]
}
records = ChatRecords(**records)
qa.run(bot_id="2", chat_records=records)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qa_engine-0.0.1.tar.gz
(386.5 kB
view hashes)
Built Distribution
Close
Hashes for qa_engine-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79d8a3ed574420a636be1625adf698113b8b83aed7fb179a72fa1da7a8673ad9 |
|
MD5 | 41a2e935b5bbc601c9799e559b780f72 |
|
BLAKE2b-256 | ea31895d394180724f9f33877933cfeaa0c545dc105383586e8bd321da758299 |