@core-ai/google-genai 0.11.1 → 0.13.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/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { GoogleGenAI } from '@google/genai';
2
- import { ChatModel, EmbeddingModel, ImageModel } from '@core-ai/core-ai';
2
+ import { ChatModel, EmbeddingModel, ImageModel, ModelCapabilities } from '@core-ai/core-ai';
3
3
  import { z } from 'zod';
4
4
 
5
5
  type GoogleGenAIProviderOptions = {
@@ -19,6 +19,14 @@ type GoogleReasoningMetadata = {
19
19
  thoughtSignature?: string;
20
20
  };
21
21
 
22
+ type GoogleModelCapabilities = {
23
+ reasoning: ModelCapabilities['reasoning'] & {
24
+ thinkingParam: 'thinkingLevel' | 'thinkingBudget';
25
+ canDisableThinking: boolean;
26
+ };
27
+ };
28
+ declare function getGoogleModelCapabilities(modelId: string): GoogleModelCapabilities;
29
+
22
30
  declare const googleGenerateProviderOptionsSchema: z.ZodObject<{
23
31
  stopSequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
32
  frequencyPenalty: z.ZodOptional<z.ZodNumber>;
@@ -82,4 +90,4 @@ declare const googleProviderOptionsSchema: z.ZodObject<{
82
90
  }, z.core.$strict>;
83
91
  type GoogleProviderOptions = GoogleGenerateProviderOptions;
84
92
 
85
- export { type GoogleEmbedProviderOptions, type GoogleGenAIProvider, type GoogleGenAIProviderOptions, type GoogleGenerateProviderOptions, type GoogleImageProviderOptions, type GoogleProviderOptions as GoogleModelProviderOptions, type GoogleReasoningMetadata, createGoogleGenAI, googleEmbedProviderOptionsSchema, googleGenerateProviderOptionsSchema, googleImageProviderOptionsSchema, googleProviderOptionsSchema };
93
+ export { type GoogleEmbedProviderOptions, type GoogleGenAIProvider, type GoogleGenAIProviderOptions, type GoogleGenerateProviderOptions, type GoogleImageProviderOptions, type GoogleModelCapabilities, type GoogleProviderOptions as GoogleModelProviderOptions, type GoogleReasoningMetadata, createGoogleGenAI, getGoogleModelCapabilities, googleEmbedProviderOptionsSchema, googleGenerateProviderOptionsSchema, googleImageProviderOptionsSchema, googleProviderOptionsSchema };
package/dist/index.js CHANGED
@@ -20,49 +20,43 @@ import { getProviderMetadata, zodSchemaToJsonSchema } from "@core-ai/core-ai";
20
20
  import {
21
21
  stripModelDateSuffix
22
22
  } from "@core-ai/core-ai";
23
- var DEFAULT_CAPABILITIES = {
24
- reasoning: {
25
- thinkingParam: "thinkingBudget",
26
- canDisableThinking: true
27
- }
28
- };
29
- var MODEL_CAPABILITIES = {
30
- "gemini-3.1-pro": {
31
- reasoning: {
32
- thinkingParam: "thinkingLevel",
33
- canDisableThinking: false
34
- }
35
- },
36
- "gemini-3.1-flash-lite-preview": {
37
- reasoning: {
38
- thinkingParam: "thinkingLevel",
39
- canDisableThinking: false
40
- }
41
- },
42
- "gemini-3-pro": {
43
- reasoning: {
44
- thinkingParam: "thinkingLevel",
45
- canDisableThinking: false
46
- }
47
- },
48
- "gemini-2.5-pro": {
49
- reasoning: {
50
- thinkingParam: "thinkingBudget",
51
- canDisableThinking: false
52
- }
53
- },
54
- "gemini-2.5-flash": {
55
- reasoning: {
56
- thinkingParam: "thinkingBudget",
57
- canDisableThinking: true
58
- }
59
- },
60
- "gemini-2.5-flash-lite": {
23
+ var ALL_EFFORTS = [
24
+ "minimal",
25
+ "low",
26
+ "medium",
27
+ "high",
28
+ "max"
29
+ ];
30
+ function createCapabilities(config) {
31
+ return {
61
32
  reasoning: {
62
- thinkingParam: "thinkingBudget",
63
- canDisableThinking: true
33
+ supported: true,
34
+ supportedEfforts: ALL_EFFORTS,
35
+ restrictsSamplingParams: false,
36
+ thinkingParam: config.thinkingParam,
37
+ canDisableThinking: config.canDisableThinking
64
38
  }
65
- }
39
+ };
40
+ }
41
+ var DEFAULT_CAPABILITIES = createCapabilities({
42
+ thinkingParam: "thinkingBudget",
43
+ canDisableThinking: true
44
+ });
45
+ var REQUIRED_THINKING_BUDGET_CAPABILITIES = createCapabilities({
46
+ thinkingParam: "thinkingBudget",
47
+ canDisableThinking: false
48
+ });
49
+ var THINKING_LEVEL_CAPABILITIES = createCapabilities({
50
+ thinkingParam: "thinkingLevel",
51
+ canDisableThinking: false
52
+ });
53
+ var MODEL_CAPABILITIES = {
54
+ "gemini-3.1-pro": THINKING_LEVEL_CAPABILITIES,
55
+ "gemini-3.1-flash-lite-preview": THINKING_LEVEL_CAPABILITIES,
56
+ "gemini-3-pro": THINKING_LEVEL_CAPABILITIES,
57
+ "gemini-2.5-pro": REQUIRED_THINKING_BUDGET_CAPABILITIES,
58
+ "gemini-2.5-flash": DEFAULT_CAPABILITIES,
59
+ "gemini-2.5-flash-lite": DEFAULT_CAPABILITIES
66
60
  };
67
61
  var GOOGLE_THINKING_LEVEL_MAP = {
68
62
  minimal: "LOW",
@@ -715,6 +709,7 @@ function createGoogleGenAIChatModel(client, modelId) {
715
709
  return {
716
710
  provider,
717
711
  modelId,
712
+ capabilities: getGoogleModelCapabilities(modelId),
718
713
  generate: generateChat,
719
714
  stream: streamChat,
720
715
  async generateObject(options) {
@@ -1075,6 +1070,7 @@ function createGoogleGenAI(options = {}) {
1075
1070
  }
1076
1071
  export {
1077
1072
  createGoogleGenAI,
1073
+ getGoogleModelCapabilities,
1078
1074
  googleEmbedProviderOptionsSchema,
1079
1075
  googleGenerateProviderOptionsSchema,
1080
1076
  googleImageProviderOptionsSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@core-ai/google-genai",
3
- "version": "0.11.1",
3
+ "version": "0.13.0",
4
4
  "description": "Google GenAI provider package for @core-ai/core-ai",
5
5
  "license": "MIT",
6
6
  "author": "Omnifact (https://omnifact.ai)",
@@ -45,7 +45,7 @@
45
45
  "test:watch": "vitest"
46
46
  },
47
47
  "dependencies": {
48
- "@core-ai/core-ai": "^0.11.1",
48
+ "@core-ai/core-ai": "^0.13.0",
49
49
  "@google/genai": "^1.42.0"
50
50
  },
51
51
  "peerDependencies": {