Skip to main content

Этот модуль умеет работать с 3-мя API AutoFaq: External API, CRUD API, QUERY API. Как синхронно так и асинхронно

Project description

Модуль работы с AutoFAQ API

Общие сведения

Установка

pip install autofaq-api

Данный модуль умеет работать со всеми 3-мя API AutoFAD:

  • External API
  • CRUD API
  • QUERY API

Методы для каждого из классов валидируются через модуль Pydantic. Каждый метод подробно расписан и задокументирован в docstring. В модуле поддерживаются как синхронные запросы так и асинхронные, каждый синхронный метод начинается с sync_, а асинхронный с sync_:

import asyncio
from autofaq_api import AutoFaqCrud

af_client = AutoFaqCrud('https://chat.autofaq.ai', 'user_token')
result = af_conn.sync_get_services()
print(result)

async def main():
    result = await af_conn.async_get_services()
    print(result)

asyncio.run(main())

...

import asyncio
from autofaq_api import AutoFaqExternal

af_client = AutoFaqExternal('https://chat.autofaq.ai', 'user_login', 'password', 'service_id')
result = af_conn.sync_channel_get_file(channel_id, file_id)
print(result)

async def main():
    result = await af_conn.async_channel_get_file(channel_id, file_id)
    print(result)

asyncio.run(main())

...

import asyncio
from autofaq_api import AutoFaqQuery

af_conn = AutoFaqQuery('https://chat.autofaq.ai')
result = af_conn.sync_kb_query(service_id, service_token, query)
print(result)

async def main():
    result = await af_conn.async_kb_query(service_id, service_token, query)
    print(result)

asyncio.run(main())

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

autofaq_api-0.0.17.tar.gz (37.6 kB view details)

Uploaded Source

Built Distribution

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

autofaq_api-0.0.17-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file autofaq_api-0.0.17.tar.gz.

File metadata

  • Download URL: autofaq_api-0.0.17.tar.gz
  • Upload date:
  • Size: 37.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for autofaq_api-0.0.17.tar.gz
Algorithm Hash digest
SHA256 b8bd5516ab55b09a5fd4c86d1ffa4439ed76b2c5cc6b179079a996d9fccec1d2
MD5 2185df90d8729e38b5dd762c6ee1416e
BLAKE2b-256 58ab7aa38c5d9ef9e2ff653080ce5b3de73f1dd6bee382fff233050742e93a35

See more details on using hashes here.

File details

Details for the file autofaq_api-0.0.17-py3-none-any.whl.

File metadata

  • Download URL: autofaq_api-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for autofaq_api-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 03b6b65cae4aeeaa2528d936cde23d48b53f1f7e14149f685e1877dbaf77a0b7
MD5 f2d8a9c3873e0a311de1707e54d84baa
BLAKE2b-256 2c3d5dce1ac92f25008c3b40dcc852e13dfffef3de6d6666aca6b79a130fa88e

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