@core-ai/google-genai 0.22.0 → 0.23.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.
Files changed (2) hide show
  1. package/dist/index.js +5 -2
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -795,8 +795,8 @@ function wrapGoogleError(error, provider = "google") {
795
795
  const statusCode = error instanceof ApiError ? error.status : getHttpStatusCode(error, ["status"]);
796
796
  const body = tryParseGoogleApiErrorBody(message);
797
797
  const effectiveHttp = statusCode ?? toNumericHttpCode(body);
798
- const options = { statusCode: effectiveHttp, cause: error };
799
798
  const status = body?.status?.toUpperCase();
799
+ const options = { statusCode: effectiveHttp, code: status, cause: error };
800
800
  const combinedText = `${body?.message ?? ""} ${message}`;
801
801
  const contextLength = getContextLengthDetails(combinedText);
802
802
  if (contextLength) {
@@ -938,7 +938,10 @@ function createGoogleGenAIChatModel(client, modelId, provider = "google") {
938
938
  );
939
939
  return createChatStream(
940
940
  async () => transformStream(await callGenerateContentStreamApi(request)),
941
- { signal: options.signal }
941
+ {
942
+ signal: options.signal,
943
+ mapError: (error) => wrapGoogleError(error, provider)
944
+ }
942
945
  );
943
946
  }
944
947
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@core-ai/google-genai",
3
- "version": "0.22.0",
3
+ "version": "0.23.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.22.0",
48
+ "@core-ai/core-ai": "^0.23.0",
49
49
  "@google/genai": "^1.42.0"
50
50
  },
51
51
  "peerDependencies": {