feat: add chat_tui example for FastGPT with Textual interface

- Introduced a new example script `chat_tui.py` that provides a full-screen Textual interface for interacting with FastGPT.
- Implemented streaming chat updates, workflow logging, and modal handling for interactive nodes.
- Enhanced FastGPT client with new streaming capabilities and structured event types for better interaction handling.
- Normalized base URL handling in the client to prevent duplicate `/api` paths.
- Added tests for streaming event parsing and interaction handling.
This commit is contained in:
Xin Wang
2026-03-10 15:34:27 +08:00
parent eab8e15cd6
commit ef2614a70a
14 changed files with 1562 additions and 28 deletions

View File

@@ -1,4 +1,4 @@
"""FastGPT Python SDK
"""FastGPT Python SDK
A Python client library for interacting with FastGPT's OpenAPI.
"""
@@ -17,6 +17,8 @@ from fastgpt_client.exceptions import (
StreamParseError,
ValidationError,
)
from fastgpt_client.streaming import aiter_stream_events, iter_stream_events
from fastgpt_client.stream_types import FastGPTInteractiveEvent, FastGPTStreamEvent
__all__ = [
# Synchronous clients
@@ -34,6 +36,11 @@ __all__ = [
"RateLimitError",
"ValidationError",
"StreamParseError",
# Streaming helpers
"iter_stream_events",
"aiter_stream_events",
"FastGPTStreamEvent",
"FastGPTInteractiveEvent",
]
__version__ = "0.1.0"