Skip to content

feat: add tailor.aigateway.get types for AI Gateway URL resolution#189

Merged
dragon3 merged 1 commit into
mainfrom
feat/tailor-aigateway-get
Jun 25, 2026
Merged

feat: add tailor.aigateway.get types for AI Gateway URL resolution#189
dragon3 merged 1 commit into
mainfrom
feat/tailor-aigateway-get

Conversation

@dragon3

@dragon3 dragon3 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds type declarations for the tailor.aigateway.get(name) built-in, which resolves a named AI Gateway in the function's own workspace and returns its URL (verified to exist at call time).

declare namespace tailor.aigateway {
  interface AIGateway {
    url: string;
  }
  function get(name: string): Promise<AIGateway>;
}

Usage:

const gw = await tailor.aigateway.get("my-aigateway");
const res = await fetch(`${gw.url}/v1/chat/completions`, { method: "POST", /* ... */ });

The return value is an AIGateway object (not a bare string) so future fields can be added without breaking callers. Mirrors the tailor.<namespace>.<method> shape used by tailor.secretmanager / tailor.idp.

A changeset is included (minor bump for @tailor-platform/function-types).

@dragon3 dragon3 requested a review from a team as a code owner June 24, 2026 09:22
@dragon3 dragon3 self-assigned this Jun 24, 2026

@k1LoW k1LoW left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@dragon3

dragon3 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for reviewing 🙇‍♂️ I'm going to merge it 💪

@dragon3 dragon3 merged commit 2e2f241 into main Jun 25, 2026
6 checks passed
@dragon3 dragon3 deleted the feat/tailor-aigateway-get branch June 25, 2026 06:56
@github-actions github-actions Bot mentioned this pull request Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants