Skip to main content

Модуль работы с 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())

Metadata

Release files for autofaq-api 0.0.17

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for autofaq-api 0.0.17
File Size Uploaded
autofaq_api-0.0.17.tar.gz 37.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for autofaq-api 0.0.17
File Interpreter ABI Platform
autofaq_api-0.0.17-py3-none-any.whl Python 3 none any Details

Total release size: 77.5 kB

Release files / autofaq_api-0.0.17.tar.gz

Download URL autofaq_api-0.0.17.tar.gz
Size 37.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b8bd5516ab55b09a5fd4c86d1ffa4439ed76b2c5cc6b179079a996d9fccec1d2
BLAKE2b-256 checksum
How to use checksums
58ab7aa38c5d9ef9e2ff653080ce5b3de73f1dd6bee382fff233050742e93a35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release files / autofaq_api-0.0.17-py3-none-any.whl

Download URL autofaq_api-0.0.17-py3-none-any.whl
Size 39.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03b6b65cae4aeeaa2528d936cde23d48b53f1f7e14149f685e1877dbaf77a0b7
BLAKE2b-256 checksum
How to use checksums
2c3d5dce1ac92f25008c3b40dcc852e13dfffef3de6d6666aca6b79a130fa88e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.7

Release history Release notifications | RSS feed

This release

0.0.17 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page