Repository navigation
feat(internal): invocation-only dynamic snippets + clientImport in all SDK generators - #18292
adidavid014 wants to merge 4 commits into
Conversation
… all SDKs Combines #17445, #17449, #17450, #17451, #17452, #17453, #17454, #17455, #17456 onto current main (Ruby conflict resolved against SDK-variable changes). Co-authored-by: Cade Sarkin <cade@buildwithfern.com> Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…oss endpoint candidates Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
👀 4 findings need your review
Devin reviewed all 4 findings on 3a9e77f and left them for you. Click a finding below to jump to its comment.
For your review (4)
- Go invocation contains a request declaration
- C# streaming invocation returns a loop
- Swift invocation omits Foundation import
- Python invocation aliases disagree with imports
…on import; Python alias consistency Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Docs Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on
Docs generation runs |
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Description
Linear ticket: n/a
Dynamic snippet generators can now return just the SDK call instead of a full sample. Docs guide templates need this so they can render real SDK code without the author typing imports and client setup for each language.
This revives 9 closed PRs by @cadesark as one PR on current
main: #17445 (TypeScript, which adds the shared contract), #17456 (Rust), #17449 (Python), #17450 (C#), #17451 (Java), #17452 (PHP), #17453 (Ruby), #17454 (Swift), #17455 (Go).generateInvocationSync(request)returns:snippet: the bare call, e.g.client.endpoints.httpMethods.testPut("id")imports: imports for types the call itself referencesclientName: the generated client class, e.g.AcmeClientclientImport: the import line for that client, e.g.import { AcmeClient } from "acme"(Rust:use acme_api::prelude::*;)Changes Made
browser-compatible-base):InvocationSnippetResponse, plusgenerateInvocationSyncon the abstract generators.generateInvocationSnippetSync, with an AST helper in each language that renders a node without its imports.@fern-api/ruby-astimport line conflicted. Ruby changelog moved togenerators/ruby-v2/sdk/changes/unreleased/(it had been in the legacygenerators/rubyfolder).changes/unreleased/invocation-only-dynamic-snippets.ymlper generator (feat).Testing
InvocationSnippet.test.tsin eachdynamic-snippetspackage.vitest runpasses for every dynamic-snippets package: TS 55, Rust 16, Python 73, C# 53, Java 46, PHP 48, Ruby 43, Swift 42, Go 117.pnpm turbo run compile --filter='@fern-api/*-dynamic-snippets'(34/34) andbiome checkon the changed files both pass.Link to Devin session: https://app.devin.ai/sessions/fe9c4016a14d43f2a010ca28288bd4c4
Open in Devin Desktop: https://app.devin.ai/desktop/session/fe9c4016a14d43f2a010ca28288bd4c4?variant=devin
Requested by: @adidavid014