@base44-preview/sdk 0.8.53-pr.329.cce6621 → 0.8.53-pr.330.92cae72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,8 +5,10 @@ export interface AiGatewayConnection {
|
|
|
5
5
|
/** Base URL of the selected gateway provider. */
|
|
6
6
|
baseURL: string;
|
|
7
7
|
/**
|
|
8
|
-
* Bearer token that authenticates the request
|
|
9
|
-
*
|
|
8
|
+
* Bearer token that authenticates the request: the service-role token from
|
|
9
|
+
* `base44.asServiceRole.aiGateway`, or the signed-in user's token from
|
|
10
|
+
* `base44.aiGateway`. The user token is an empty string when no one is signed
|
|
11
|
+
* in, and the gateway rejects that call.
|
|
10
12
|
*/
|
|
11
13
|
token: string;
|
|
12
14
|
/**
|
|
@@ -92,7 +94,20 @@ export interface AiGatewayModuleConfig {
|
|
|
92
94
|
* The mode determines which token `connection()` returns:
|
|
93
95
|
*
|
|
94
96
|
* - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token.
|
|
95
|
-
* - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead.
|
|
97
|
+
* - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead.
|
|
98
|
+
*
|
|
99
|
+
* Use service role from a backend function, as every example here does. The
|
|
100
|
+
* gateway accepts a user token only on apps shared privately or with your
|
|
101
|
+
* workspace. It rejects anonymous calls, and user-token calls on public apps,
|
|
102
|
+
* with a `403` and the error code `ai_gateway_requires_service_role`, so a
|
|
103
|
+
* visitor can't spend your app's credits by calling the gateway from the
|
|
104
|
+
* browser. A user-token call therefore works while you're building and starts
|
|
105
|
+
* failing the moment you share the app publicly. Service role also works when
|
|
106
|
+
* there's no signed-in user at all, such as from a scheduled automation.
|
|
107
|
+
*
|
|
108
|
+
* To control who triggers a billed request, check the caller with
|
|
109
|
+
* `base44.auth.me()` in your backend function before calling the gateway, and
|
|
110
|
+
* call that function from your page with `base44.functions.invoke()`.
|
|
96
111
|
*
|
|
97
112
|
* ## Billing and limits
|
|
98
113
|
*
|
|
@@ -19,7 +19,7 @@ export type IntegrationEndpointFunction = (data: Record<string, any>) => Promise
|
|
|
19
19
|
* ```typescript
|
|
20
20
|
* await base44.integrations.Core.InvokeLLM({
|
|
21
21
|
* prompt: 'Explain quantum computing',
|
|
22
|
-
* model: '
|
|
22
|
+
* model: 'gemini_3_8_flash'
|
|
23
23
|
* });
|
|
24
24
|
* ```
|
|
25
25
|
*
|
|
@@ -43,9 +43,9 @@ export interface InvokeLLMParams {
|
|
|
43
43
|
prompt: string;
|
|
44
44
|
/** Optionally specify a model to override the app-level model setting for this specific call.
|
|
45
45
|
*
|
|
46
|
-
* Options: `"
|
|
46
|
+
* Options: `"gemini_3_8_flash"`, `"gpt_6_luna"`, `"claude-sonnet-5"`, `"claude_opus_5_5"`, `"gpt_6_sol"`, `"gpt_6_astra"`, `"claude_fable_5_1"`, `"glm_5_2"`, `"gemini_3_1_pro"`, `"gpt_5_4"`, `"claude_sonnet_4_6"`, `"claude_opus_4_6"`, `"claude_opus_4_7"`, `"claude_opus_4_8"`, `"claude_opus_5"`, `"gpt_5_6_terra"`, `"gpt_5_6_sol"`, `"gpt_5_6_luna"`
|
|
47
47
|
*/
|
|
48
|
-
model?: '
|
|
48
|
+
model?: 'gemini_3_8_flash' | 'gpt_6_luna' | 'claude-sonnet-5' | 'claude_opus_5_5' | 'gpt_6_sol' | 'gpt_6_astra' | 'claude_fable_5_1' | 'glm_5_2' | 'gemini_3_1_pro' | 'gpt_5_4' | 'claude_sonnet_4_6' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude_opus_5' | 'gpt_5_6_terra' | 'gpt_5_6_sol' | 'gpt_5_6_luna';
|
|
49
49
|
/** If set to `true`, the LLM will use Google Search, Maps, and News to gather real-time context before answering.
|
|
50
50
|
* @default false
|
|
51
51
|
*/
|