feat: Stainless SDK layer — type-safe Python + TypeScript clients from OpenAPI spec#95
Draft
feat: Stainless SDK layer — type-safe Python + TypeScript clients from OpenAPI spec#95
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Integrate Stainless SDK for type-safe API client generation
feat: Stainless SDK layer — type-safe Python + TypeScript clients from OpenAPI spec
Mar 20, 2026
This was referenced Mar 20, 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.
EventRelay's pipeline called external APIs via raw
aiohttp/requestswith no typed contracts and had no OpenAPI spec, blocking productization as a consumable platform API.Changes
OpenAPI spec export
scripts/export_openapi.py— imports the FastAPI app and writesopenapi/eventrelay.openapi.json(supports--format yaml)openapi/eventrelay.openapi.json— generated from the live app: 40 paths, 28 component schemas, OpenAPI 3.1.0Stainless configuration
.stainless.yml— declareseventrelay-sdk(PyPI) and@eventrelay/sdk(npm) targets; maps paths to 6 resource classes (videos,events,agents,transcript,chat,health); configures retry, auth scheme, server environmentsPython SDK (
sdk/python/)EventRelayClient(sync) andAsyncEventRelayClient(async viahttpx) with retry on{429,500,502,503,504}, configurable timeout, and context manager supporttypes.pykept in sync with backend schemaseventrelay-sdkviasdk/python/pyproject.tomlTypeScript SDK (
sdk/typescript/)EventRelayClient— fetch-based, fully async, strict TypeScript interfaces mirroring Pydantic models@eventrelay/sdkviasdk/typescript/package.jsonTests
tests/test_sdk_python.py— 34 tests (types, sync/async clients, retry behavior, error propagation) usinghttpx.MockTransport; no live server requiredOriginal prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.