Skip to content

feat(ai-gateway): add TypeSafe connection provider - #288

Open
yardend-wix wants to merge 1 commit into
mainfrom
feat/typesafe-gateway-provider
Open

yardend-wix wants to merge 1 commit into
mainfrom
feat/typesafe-gateway-provider

Conversation

@yardend-wix

Copy link
Copy Markdown
Collaborator

Summary

Allow aiGateway.connection({ provider: 'typesafe' }) to return the TypeSafe-compatible gateway base URL. Existing connection() calls keep the same OpenAI URL and authentication behavior.

Intent (for reviewers & PR Autofix)

What this PR does

Add and export an optional provider selector for the existing synchronous connection helper, shared by user and service-role clients.

Key decisions & why

  • provider selects the compatible endpoint contract; model selection remains with the external client adapter.
  • A closed runtime allowlist rejects unsupported values instead of inserting arbitrary values into a URL.
  • Preserve current token selection and backend-request host propagation without new dependencies or network calls.

What NOT to touch

The default OpenAI behavior and existing client factories are intentionally unchanged. This helper does not hold provider credentials or implement evaluation itself.

Tradeoffs / follow-ups

TypeSafe calls require the separately implemented backend endpoint. The builder guide must pin a release containing this change before exposure; this PR does not publish a stable SDK release.

Testing

  • 303 unit tests passed, including provider selection, invalid values, both token modes, and backend-request host propagation.
  • Public type tests, build, lint, generated-reference checks, and diff checks passed.
  • No dependency, lockfile, or package-version changes.

@github-actions

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.48-pr.288.6247e7c

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.48-pr.288.6247e7c"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.48-pr.288.6247e7c"
  }
}

Preview published to npm registry — try new features instantly!

@yardend-wix
yardend-wix marked this pull request as ready for review September 21, 2026 20:25
@github-actions github-actions Bot added the docs-draft PR has auto-drafted documentation suggestions label Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-draft PR has auto-drafted documentation suggestions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant