feat: add HTTP Server and Python HTTP Client (T2 & T4)#109
Merged
MaojiaSheng merged 9 commits intomainfrom Feb 9, 2026
Merged
Conversation
…cumentation
- Implement FastAPI-based HTTP server (openviking/server/) with REST API
- Add client abstraction layer (LocalClient, HTTPClient, BaseClient)
- Add CLI entry point (python -m openviking serve)
- Fix bugs: session.session_id, link/unlink param names, hmac.compare_digest
- Restructure docs: remove numbered prefixes, add guides/, rewrite API reference
with both Python SDK and HTTP API (curl) examples (en/zh)
- Add quickstart-server, deployment, authentication, monitoring guides
- Update examples and design docs to reflect implementation
MaojiaSheng
approved these changes
Feb 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
实现 Server/Client 架构,为 OpenViking 提供 HTTP Server 服务和 Python SDK HTTP 模式。
对应 Issue #48 中的:
Related Issue
Ref #48 (T2: HTTP Server Implementation, T4: Python SDK HTTP Mode)
Type of Change
Changes Made
Server (T2)
openviking/server/模块,基于 FastAPI 实现 HTTP API Serverapp.py- FastAPI 应用创建与中间件配置(CORS、错误处理、请求日志)auth.py- API Key 认证(支持X-API-KeyHeader 和BearerToken)bootstrap.py- Server 启动引导(uvicorn)config.py- Server 配置管理(配置文件 / 环境变量 / CLI 参数)routers/- 10 个路由模块:resources, filesystem, search, sessions, content, relations, observer, pack, system, debugopenviking/__main__.py,支持python -m openviking serveCLI 启动Client (T4)
openviking/client/模块,抽象 Client 层base.py- Client 抽象基类,定义统一接口local.py- 本地模式 Client(封装原有 Service 层调用)http.py- HTTP 模式 Client(通过 httpx 访问远程 Server)session.py- Session 管理AsyncOpenViking新增url/api_key参数,根据参数自动选择 LocalClient 或 HTTPClient文档
getting-started/03-quickstart-server.mdServer 快速开始guides/下部署、认证、监控指南configuration/目录迁移至guides/并扩展内容示例
examples/server_client/server.py- Server 启动示例client_sync.py- 同步客户端示例client_async.py- 异步客户端示例测试
tests/server/共 11 个测试文件,覆盖全部 Server API 路由、认证、错误场景、健康检查tests/integration/test_http_integration.py端到端 HTTP 集成测试tests/server/test_http_client_sdk.pyHTTP Client SDK 测试Testing
Checklist
Additional Notes
1933,支持通过--port、配置文件或环境变量修改/health端点始终免认证path=改为url=