@core-ai/google-genai 0.23.0 → 0.25.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.js +26 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
getProviderMetadata,
|
|
10
10
|
validateInputModalities,
|
|
11
|
+
validateToolSchemaStrictness,
|
|
11
12
|
zodSchemaToJsonSchema
|
|
12
13
|
} from "@core-ai/core-ai";
|
|
13
14
|
|
|
14
15
|
// src/model-capabilities.ts
|
|
15
16
|
import {
|
|
16
|
-
stripModelDateSuffix
|
|
17
|
+
stripModelDateSuffix,
|
|
18
|
+
UNSUPPORTED_TOOL_SCHEMA_STRICTNESS
|
|
17
19
|
} from "@core-ai/core-ai";
|
|
18
20
|
var ALL_EFFORTS = [
|
|
19
21
|
"minimal",
|
|
@@ -35,7 +37,10 @@ function createCapabilities(config) {
|
|
|
35
37
|
supportedToolChoices: ["auto", "none", "required", "tool"],
|
|
36
38
|
thinkingParam: config.thinkingParam
|
|
37
39
|
},
|
|
38
|
-
modalities: GOOGLE_INPUT_MODALITIES
|
|
40
|
+
modalities: GOOGLE_INPUT_MODALITIES,
|
|
41
|
+
tools: {
|
|
42
|
+
strictSchemas: UNSUPPORTED_TOOL_SCHEMA_STRICTNESS
|
|
43
|
+
}
|
|
39
44
|
};
|
|
40
45
|
}
|
|
41
46
|
var DEFAULT_CAPABILITIES = createCapabilities({
|
|
@@ -51,7 +56,14 @@ var THINKING_LEVEL_CAPABILITIES = createCapabilities({
|
|
|
51
56
|
mode: "always-on"
|
|
52
57
|
});
|
|
53
58
|
var MODEL_CAPABILITIES = {
|
|
59
|
+
"gemini-3.8-flash": THINKING_LEVEL_CAPABILITIES,
|
|
60
|
+
"gemini-3.7-flash": THINKING_LEVEL_CAPABILITIES,
|
|
61
|
+
"gemini-3.6-flash": THINKING_LEVEL_CAPABILITIES,
|
|
62
|
+
"gemini-3.5-flash": THINKING_LEVEL_CAPABILITIES,
|
|
63
|
+
"gemini-3.5-flash-lite": THINKING_LEVEL_CAPABILITIES,
|
|
54
64
|
"gemini-3.1-pro": THINKING_LEVEL_CAPABILITIES,
|
|
65
|
+
"gemini-3.1-pro-preview": THINKING_LEVEL_CAPABILITIES,
|
|
66
|
+
"gemini-3.1-flash-lite": THINKING_LEVEL_CAPABILITIES,
|
|
55
67
|
"gemini-3.1-flash-lite-preview": THINKING_LEVEL_CAPABILITIES,
|
|
56
68
|
"gemini-3-pro": THINKING_LEVEL_CAPABILITIES,
|
|
57
69
|
"gemini-2.5-pro": REQUIRED_THINKING_BUDGET_CAPABILITIES,
|
|
@@ -386,6 +398,14 @@ function createGenerateRequest(modelId, options, provider = DEFAULT_PROVIDER_ID,
|
|
|
386
398
|
modelId,
|
|
387
399
|
providerId: provider
|
|
388
400
|
});
|
|
401
|
+
if (options.tools) {
|
|
402
|
+
validateToolSchemaStrictness({
|
|
403
|
+
tools: options.tools,
|
|
404
|
+
capabilities,
|
|
405
|
+
providerId: provider,
|
|
406
|
+
modelId
|
|
407
|
+
});
|
|
408
|
+
}
|
|
389
409
|
const convertedMessages = convertMessages(options.messages);
|
|
390
410
|
const requestConfig = {
|
|
391
411
|
...convertedMessages.systemInstruction ? { systemInstruction: convertedMessages.systemInstruction } : {},
|
|
@@ -777,6 +797,7 @@ import {
|
|
|
777
797
|
ContextLengthExceededError,
|
|
778
798
|
ModelOverloadedError,
|
|
779
799
|
ProviderError,
|
|
800
|
+
ProviderQuotaExceededError,
|
|
780
801
|
RateLimitError,
|
|
781
802
|
ServiceUnavailableError,
|
|
782
803
|
getErrorMessage,
|
|
@@ -805,6 +826,9 @@ function wrapGoogleError(error, provider = "google") {
|
|
|
805
826
|
...contextLength
|
|
806
827
|
});
|
|
807
828
|
}
|
|
829
|
+
if (effectiveHttp === 402) {
|
|
830
|
+
return new ProviderQuotaExceededError(message, provider, options);
|
|
831
|
+
}
|
|
808
832
|
if (indicatesGoogleOverload(combinedText, effectiveHttp)) {
|
|
809
833
|
return new ModelOverloadedError(message, provider, options);
|
|
810
834
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@core-ai/google-genai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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.
|
|
48
|
+
"@core-ai/core-ai": "^0.25.0",
|
|
49
49
|
"@google/genai": "^1.42.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|