module/file.py:function_name本指南帮助你快速开始使用 Gateway。
# 直接导入 Core 层模块
from gateway.core.conversations import ConversationManager
# 创建管理器
manager = ConversationManager()
# 查询对话列表
conversations = manager.list_conversations()
# 获取消息历史
messages = manager.get_messages(conversation_id)
# 发送消息
manager.send_message(conversation_id, text="Hello!")
pip install gateway-client
# 使用 Client SDK
from gateway.client.python import GatewayClient
# 创建客户端
client = GatewayClient("http://gateway-host:8000")
# 查询对话列表
conversations = client.list_conversations()
# 获取消息历史
messages = client.get_messages(conversation_id)
# 发送消息
client.send_message(conversation_id, text="Hello!")