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:
@@ -153,29 +153,29 @@ def delete_chat_item():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# print("=== Simple Chat ===")
|
||||
# try:
|
||||
# simple_chat()
|
||||
# except Exception as e:
|
||||
# print(f"Error: {e}")
|
||||
print("=== Simple Chat ===")
|
||||
try:
|
||||
simple_chat()
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
# print("\n=== Streaming Chat ===")
|
||||
# try:
|
||||
# streaming_chat()
|
||||
# except Exception as e:
|
||||
# print(f"Error: {e}")
|
||||
print("\n=== Streaming Chat ===")
|
||||
try:
|
||||
streaming_chat()
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
# print("\n=== Chat with Context ===")
|
||||
# try:
|
||||
# chat_with_context()
|
||||
# except Exception as e:
|
||||
# print(f"Error: {e}")
|
||||
print("\n=== Chat with Context ===")
|
||||
try:
|
||||
chat_with_context()
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
# print("\n=== Get Histories ===")
|
||||
# try:
|
||||
# get_histories()
|
||||
# except Exception as e:
|
||||
# print(f"Error: {e}")
|
||||
print("\n=== Get Histories ===")
|
||||
try:
|
||||
get_histories()
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
print("\n=== Delete Chat Item ===")
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user