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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file qa_engine-0.0.1.tar.gz.

File metadata

  • Download URL: qa_engine-0.0.1.tar.gz
  • Upload date:
  • Size: 386.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for qa_engine-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8a1034345e29cbb2f9f70839fa0ab324307511a56156e8be047a16a16fbfeeb3
MD5 88665189868b1229397c5dfd49e5e5b4
BLAKE2b-256 192ddf84d2f1f44b5941404830998506537f1cfa3e1eb31929857a7c605cc186

See more details on using hashes here.

File details

Details for the file qa_engine-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: qa_engine-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.12

File hashes

Hashes for qa_engine-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 79d8a3ed574420a636be1625adf698113b8b83aed7fb179a72fa1da7a8673ad9
MD5 41a2e935b5bbc601c9799e559b780f72
BLAKE2b-256 ea31895d394180724f9f33877933cfeaa0c545dc105383586e8bd321da758299

See more details on using hashes here.

Supported by

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