@base44-preview/sdk 0.8.52-pr.305.7dff8f5 → 0.8.52-pr.305.d6c90ab
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.
|
@@ -42,7 +42,7 @@ export interface AiGatewayModuleConfig {
|
|
|
42
42
|
/**
|
|
43
43
|
* AI Gateway module for calling Base44's managed AI models from your own code.
|
|
44
44
|
*
|
|
45
|
-
* `connection()`
|
|
45
|
+
* Call `connection()` to get a `baseURL`, `token`, and `headers` that
|
|
46
46
|
* authenticate as your Base44 app. An OpenAI-compatible client is any library, such as the `openai`
|
|
47
47
|
* SDK or the Vercel AI SDK, that has the same request and response format
|
|
48
48
|
* as OpenAI's API and lets you point it at a custom `baseURL`
|
|
@@ -51,9 +51,9 @@ export interface AiGatewayModuleConfig {
|
|
|
51
51
|
* against the provider directly, no separate account, API key, or billing
|
|
52
52
|
* setup with the underlying model provider required.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
54
|
+
* The optional `provider` picks the API you connect to:
|
|
55
55
|
*
|
|
56
|
-
* - `openai
|
|
56
|
+
* - `openai`, the default: OpenAI-compatible chat completions, image, and video endpoints.
|
|
57
57
|
* - `typesafe`: structured evaluations with the `jev` model.
|
|
58
58
|
*
|
|
59
59
|
* Call `connection()` from a backend function rather than the browser. This
|
|
@@ -71,7 +71,7 @@ export interface AiGatewayModuleConfig {
|
|
|
71
71
|
*
|
|
72
72
|
* The gateway also serves OpenAI's image endpoints, `/images/generations`
|
|
73
73
|
* and `/images/edits`, so you can generate images and edit them using
|
|
74
|
-
* reference images. Image requests use their own set of models
|
|
74
|
+
* reference images. Image requests use their own set of models. Pass
|
|
75
75
|
* `'automatic'` to let Base44 choose one, or pin a model such as
|
|
76
76
|
* `'gemini_3_1_flash_image'` or `'gpt_image_2'`. For request options, the
|
|
77
77
|
* full model list, and limits, see [Generate images with the AI Gateway](/developers/references/sdk/getting-started/ai-gateway-images).
|
|
@@ -80,7 +80,7 @@ export interface AiGatewayModuleConfig {
|
|
|
80
80
|
*
|
|
81
81
|
* The gateway also serves OpenAI's video endpoints, `/videos`, so you can
|
|
82
82
|
* generate video from a prompt, from a still image, or from existing media.
|
|
83
|
-
* Video generation is asynchronous
|
|
83
|
+
* Video generation is asynchronous. `POST /videos` returns a job, and you poll
|
|
84
84
|
* `GET /videos/{id}` until its status is `completed` or `failed`, which can
|
|
85
85
|
* take minutes. Video models are their own set, and there's no `automatic`
|
|
86
86
|
* option, so pin a model such as `'veo_3_1_fast'` or `'seedance_2'`. For
|
|
@@ -91,11 +91,12 @@ export interface AiGatewayModuleConfig {
|
|
|
91
91
|
*
|
|
92
92
|
* The `typesafe` provider runs the `jev` evaluation model through
|
|
93
93
|
* `@ai-sdk/typesafe-ai` and `experimental_evaluate` from the `ai` package,
|
|
94
|
-
* version 7.0.105 or later. Pass `evaluationModel("jev")
|
|
95
|
-
* other model IDs, such as `"jev-latest"`. Give it some app
|
|
96
|
-
* questions, each a `choice`, `score`, or `boolean`. Choice
|
|
97
|
-
* come back with `probabilities` per option
|
|
98
|
-
* `probability` of `true`. Use it to classify, score, or
|
|
94
|
+
* version 7.0.105 or later. Pass `evaluationModel("jev")`, and note that the
|
|
95
|
+
* gateway rejects other model IDs, such as `"jev-latest"`. Give it some app
|
|
96
|
+
* state and a set of questions, each a `choice`, `score`, or `boolean`. Choice
|
|
97
|
+
* and score answers come back with `probabilities` per option, and boolean
|
|
98
|
+
* answers with a single `probability` of `true`. Use it to classify, score, or
|
|
99
|
+
* route records, then
|
|
99
100
|
* apply your own thresholds and actions in code.
|
|
100
101
|
*
|
|
101
102
|
* ## Authentication Modes
|
|
@@ -103,7 +104,7 @@ export interface AiGatewayModuleConfig {
|
|
|
103
104
|
* The mode determines which token `connection()` returns:
|
|
104
105
|
*
|
|
105
106
|
* - **User authentication** (`base44.aiGateway`): Returns the signed-in app user's token.
|
|
106
|
-
* - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead. Use it from backend functions
|
|
107
|
+
* - **Service role authentication** (`base44.asServiceRole.aiGateway`): Returns the service-role token instead. Use it from backend functions, because apps that restrict Core integrations, the default for new apps, reject user-token gateway calls on public apps. It also works when there's no signed-in user, such as from a scheduled automation.
|
|
107
108
|
*
|
|
108
109
|
* ## Billing and limits
|
|
109
110
|
*
|