@oya-ai/browser 1.0.85 → 1.0.86
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.
- package/README.md +20 -1
- package/dist/index.cjs +4 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +4 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -179,12 +179,31 @@ const modelKey = process.env.GEMINI_API_KEY;
|
|
|
179
179
|
if (!modelKey) throw new Error("Set GEMINI_API_KEY first.");
|
|
180
180
|
const oya = new Oya();
|
|
181
181
|
await oya.config.set({
|
|
182
|
-
llm_provider: "gemini", // "openai" | "anthropic" | "gemini"
|
|
182
|
+
llm_provider: "gemini", // "openai" | "anthropic" | "gemini" | "vertex"
|
|
183
183
|
openai_api_key: modelKey, // Shared field name for every supported provider.
|
|
184
184
|
// chat_model: process.env.OYA_CHAT_MODEL, // Optional provider model override.
|
|
185
185
|
});
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
+
### Gemini Enterprise (ex-Vertex AI)
|
|
189
|
+
|
|
190
|
+
`llm_provider: "vertex"` targets express mode, whose API keys work against a global endpoint with no GCP project or location:
|
|
191
|
+
|
|
192
|
+
```js
|
|
193
|
+
await oya.config.set({ llm_provider: "vertex", openai_api_key: process.env.VERTEX_EXPRESS_KEY });
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
For an enterprise project instead, point at its OpenAI-compatible endpoint. That path authenticates with a Google OAuth access token rather than an API key, and the token expires after about an hour, so it suits a one-off run rather than a long-lived deployment:
|
|
197
|
+
|
|
198
|
+
```js
|
|
199
|
+
await oya.config.set({
|
|
200
|
+
llm_provider: "vertex",
|
|
201
|
+
openai_base_url: "https://us-central1-aiplatform.googleapis.com/v1/projects/PROJECT/locations/us-central1/endpoints/openapi",
|
|
202
|
+
openai_api_key: accessToken, // gcloud auth print-access-token
|
|
203
|
+
chat_model: "google/gemini-2.5-flash", // this endpoint prefixes model ids
|
|
204
|
+
});
|
|
205
|
+
```
|
|
206
|
+
|
|
188
207
|
Omit `chat_model` to use the configured provider's default. `oya.config.get()` reads configuration. To return to the shared model configuration:
|
|
189
208
|
|
|
190
209
|
```js
|
package/dist/index.cjs
CHANGED
|
@@ -506,7 +506,10 @@ var Oya = class {
|
|
|
506
506
|
*
|
|
507
507
|
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
508
508
|
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
509
|
-
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides
|
|
509
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini' | 'vertex'; `chat_model` overrides
|
|
510
|
+
* its default model. 'vertex' is Gemini Enterprise (ex-Vertex AI) in express mode, which
|
|
511
|
+
* needs no GCP project; for a project-scoped endpoint, set `openai_base_url` to
|
|
512
|
+
* `.../endpoints/openapi` and pass an OAuth access token as `openai_api_key`.
|
|
510
513
|
*/
|
|
511
514
|
config = {
|
|
512
515
|
get: () => this.http.request("GET", "/api/config"),
|
package/dist/index.d.cts
CHANGED
|
@@ -699,7 +699,10 @@ declare class Oya {
|
|
|
699
699
|
*
|
|
700
700
|
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
701
701
|
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
702
|
-
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides
|
|
702
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini' | 'vertex'; `chat_model` overrides
|
|
703
|
+
* its default model. 'vertex' is Gemini Enterprise (ex-Vertex AI) in express mode, which
|
|
704
|
+
* needs no GCP project; for a project-scoped endpoint, set `openai_base_url` to
|
|
705
|
+
* `.../endpoints/openapi` and pass an OAuth access token as `openai_api_key`.
|
|
703
706
|
*/
|
|
704
707
|
readonly config: {
|
|
705
708
|
get: <T = Record<string, unknown>>() => Promise<T>;
|
package/dist/index.d.ts
CHANGED
|
@@ -699,7 +699,10 @@ declare class Oya {
|
|
|
699
699
|
*
|
|
700
700
|
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
701
701
|
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
702
|
-
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides
|
|
702
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini' | 'vertex'; `chat_model` overrides
|
|
703
|
+
* its default model. 'vertex' is Gemini Enterprise (ex-Vertex AI) in express mode, which
|
|
704
|
+
* needs no GCP project; for a project-scoped endpoint, set `openai_base_url` to
|
|
705
|
+
* `.../endpoints/openapi` and pass an OAuth access token as `openai_api_key`.
|
|
703
706
|
*/
|
|
704
707
|
readonly config: {
|
|
705
708
|
get: <T = Record<string, unknown>>() => Promise<T>;
|
package/dist/index.js
CHANGED
|
@@ -476,7 +476,10 @@ var Oya = class {
|
|
|
476
476
|
*
|
|
477
477
|
* Bring your own LLM key (it pays for its own tokens, so no hourly chat quota applies):
|
|
478
478
|
* await oya.config.set({ llm_provider: 'gemini', openai_api_key: process.env.GEMINI_API_KEY });
|
|
479
|
-
* `llm_provider` is 'openai' | 'anthropic' | 'gemini'; `chat_model` overrides
|
|
479
|
+
* `llm_provider` is 'openai' | 'anthropic' | 'gemini' | 'vertex'; `chat_model` overrides
|
|
480
|
+
* its default model. 'vertex' is Gemini Enterprise (ex-Vertex AI) in express mode, which
|
|
481
|
+
* needs no GCP project; for a project-scoped endpoint, set `openai_base_url` to
|
|
482
|
+
* `.../endpoints/openapi` and pass an OAuth access token as `openai_api_key`.
|
|
480
483
|
*/
|
|
481
484
|
config = {
|
|
482
485
|
get: () => this.http.request("GET", "/api/config"),
|
package/package.json
CHANGED