@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 CHANGED
@@ -12,28 +12,31 @@ pnpm add @gullabs/google @gullabs/core @google/genai
12
12
 
13
13
  ## Key exports
14
14
 
15
- | Export | What it is |
16
- | ---------------------------- | ----------------------------------------------------------------------------- |
17
- | `geminiAdapter(opts?)` | Creates the `ProviderAdapter` for Gemini |
18
- | `GeminiAdapterOptions` | `{ client?: GeminiClientLike }` — inject a pre-built or fake client |
19
- | `GeminiClientLike` | Structural interface the adapter depends on (satisfied by real SDK and fakes) |
20
- | `buildGoogleClient(auth)` | Builds the real `@google/genai` client from `AuthMaterial` |
21
- | `isGeminiCapacityError(err)` | Detects Gemini Flex shared-capacity errors for built-in fallback |
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 { geminiAdapter } from '@gullabs/google'
27
- import { createClient, geminiPricingSource } from '@gullabs/core'
29
+ import { createClient, composeProviders } from '@gullabs/core'
30
+ import { googleProvider } from '@gullabs/google'
28
31
 
29
32
  const client = createClient({
30
- adapters: [geminiAdapter()],
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
  },