@gullabs/google 0.6.1 → 0.8.0
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 +14 -11
- package/dist/index.cjs +2252 -36
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +334 -9
- package/dist/index.d.ts +334 -9
- package/dist/index.js +2245 -38
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -12,28 +12,31 @@ pnpm add @gullabs/google @gullabs/core @google/genai
|
|
|
12
12
|
|
|
13
13
|
## Key exports
|
|
14
14
|
|
|
15
|
-
| Export
|
|
16
|
-
|
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
15
|
+
| Export | What it is |
|
|
16
|
+
| -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
|
|
17
|
+
| `googleProvider(opts?)` | `ProviderPlugin` factory — bundles the adapter, model descriptors, and pricing source |
|
|
18
|
+
| `geminiAdapter(opts?)` | Creates the `ProviderAdapter` for Gemini |
|
|
19
|
+
| `GeminiAdapterOptions` | `{ client?: GeminiClientLike }` — inject a pre-built or fake client |
|
|
20
|
+
| `GeminiClientLike` | Structural interface the adapter depends on (satisfied by real SDK and fakes) |
|
|
21
|
+
| `buildGoogleClient(auth)` | Builds the real `@google/genai` client from `AuthMaterial` |
|
|
22
|
+
| `isGeminiCapacityError(err)` | Detects Gemini Flex shared-capacity errors for built-in fallback |
|
|
23
|
+
| `geminiModelDescriptors`, `gemmaModelDescriptors`, `defaultGeminiRegistry` | Built-in model descriptors + pre-built registry |
|
|
24
|
+
| `geminiPricingSource()`, `GEMINI_PRICING`, `TIER_FACTOR` | Built-in Gemini pricing snapshot and tier-factor map |
|
|
22
25
|
|
|
23
26
|
## Quick example
|
|
24
27
|
|
|
25
28
|
```ts
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
29
|
+
import { createClient, composeProviders } from '@gullabs/core'
|
|
30
|
+
import { googleProvider } from '@gullabs/google'
|
|
28
31
|
|
|
29
32
|
const client = createClient({
|
|
30
|
-
|
|
31
|
-
pricing: geminiPricingSource(),
|
|
33
|
+
...composeProviders([googleProvider()]),
|
|
32
34
|
})
|
|
33
35
|
|
|
34
36
|
// Auth is required per call — the library never reads environment variables.
|
|
35
37
|
const result = await client.generate(
|
|
36
38
|
{
|
|
39
|
+
provider: 'google',
|
|
37
40
|
model: 'gemini-2.5-flash',
|
|
38
41
|
messages: [{ role: 'user', parts: [{ kind: 'text', text: 'Hello' }] }],
|
|
39
42
|
},
|