@base44-preview/sdk 0.8.53-pr.329.cce6621 → 0.8.53-pr.330.ac96a75
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,9 @@ 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 gateway expects the service-role token.
|
|
10
11
|
*/
|
|
11
12
|
token: string;
|
|
12
13
|
/**
|
|
@@ -91,8 +92,20 @@ export interface AiGatewayModuleConfig {
|
|
|
91
92
|
*
|
|
92
93
|
* The mode determines which token `connection()` returns:
|
|
93
94
|
*
|
|
94
|
-
* - **
|
|
95
|
-
* - **
|
|
95
|
+
* - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the app's service-role token.
|
|
96
|
+
* - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token. The gateway accepts it only on apps shared privately or with your workspace.
|
|
97
|
+
*
|
|
98
|
+
* Call the gateway server-side with the app's service role, as every example
|
|
99
|
+
* here does. Calls from the browser or with a user's token are rejected with a
|
|
100
|
+
* `403`, the error code `ai_gateway_requires_service_role`, and the message
|
|
101
|
+
* "AI gateway requests must be made server-side using the app's service role.
|
|
102
|
+
* Calls from the browser or with a user's token are not allowed." Service role
|
|
103
|
+
* also works when there's no signed-in user at all, such as from a scheduled
|
|
104
|
+
* automation.
|
|
105
|
+
*
|
|
106
|
+
* In a backend function, for example, you can check the caller with
|
|
107
|
+
* `base44.auth.me()` before calling the gateway, and call the function from
|
|
108
|
+
* your page with `base44.functions.invoke()`.
|
|
96
109
|
*
|
|
97
110
|
* ## Billing and limits
|
|
98
111
|
*
|
|
@@ -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
|
*/
|