Skip to main content

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


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)

Uploaded Source

Built Distribution

qa_engine-0.0.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page