Add async client support

- Add AsyncFastGPTClient, AsyncChatClient, AsyncAppClient classes
- Implement async/await patterns with httpx.AsyncClient
- Add async context manager support (async with, async for)
- Add async retry logic with exponential backoff
- Add 29 async unit tests covering all async client methods
- Update __init__.py to export async clients

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Xin Wang
2026-01-06 16:36:13 +08:00
parent b322ef1d7a
commit fab0d39a35
3 changed files with 1179 additions and 0 deletions

View File

@@ -3,6 +3,11 @@
A Python client library for interacting with FastGPT's OpenAPI.
"""
from fastgpt_client.async_client import (
AsyncAppClient,
AsyncChatClient,
AsyncFastGPTClient,
)
from fastgpt_client.client import AppClient, ChatClient, FastGPTClient
from fastgpt_client.exceptions import (
APIError,
@@ -18,6 +23,10 @@ __all__ = [
"FastGPTClient",
"ChatClient",
"AppClient",
# Asynchronous clients
"AsyncFastGPTClient",
"AsyncChatClient",
"AsyncAppClient",
# Exceptions
"FastGPTError",
"APIError",