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.14.tar.gz (37.5 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.14-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: autofaq_api-0.0.14.tar.gz
  • Upload date:
  • Size: 37.5 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.14.tar.gz
Algorithm Hash digest
SHA256 ad0ffbf0982e604cbb8bd13c86b0e898b91f0700674f0ab04901ca313a4e553c
MD5 61adc431e56215a0846c54ee446a98f3
BLAKE2b-256 afecb8462175da140d9a15f3166dca6b569483e5208195d37e7835799f8cfcd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: autofaq_api-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 39.8 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.14-py3-none-any.whl
Algorithm Hash digest
SHA256 ef475d7155d9fd21113c673e8b282fc45c156c75767a66307b76dc5e0e722a67
MD5 d1c28a1a619e0723f67824f28fe27581
BLAKE2b-256 80c221ba91bc23b23fa8bac83ba4d8e9d4a1f358f85aab927681f13cf83c08ea

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