Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tailor-aigateway-get.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tailor-platform/function-types": minor
---

Add `tailor.aigateway.get(name)` types for resolving an AI Gateway URL in the caller's workspace.
21 changes: 21 additions & 0 deletions packages/types/tailor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@ declare namespace tailor.authconnection {
function getConnectionToken(connectionName: string): Promise<any>;
}

declare namespace tailor.aigateway {
/**
* AIGateway describes a resolved AI Gateway in the caller's workspace.
*/
interface AIGateway {
/**
* Base URL of the AI Gateway, e.g.
* `https://my-aigateway-<workspace_hash>.ai.erp.dev`. Requests to this URL
* are automatically authenticated for the calling workspace.
*/
url: string;
}

/**
* get resolves a named AI Gateway in the caller's own workspace and returns
* it. The gateway's existence is verified at call time, so resolving a name
* that does not exist rejects rather than failing later inside `fetch`.
*/
function get(name: string): Promise<AIGateway>;
}

declare namespace tailor.iconv {
/**
* Convert string from one encoding to another
Expand Down