Skip to content

Instantly share code, notes, and snippets.

@DopamineDriven
Created December 25, 2025 05:06
Show Gist options
  • Select an option

  • Save DopamineDriven/7a826cae206bc28c2c620d1eee0dea9e to your computer and use it in GitHub Desktop.

Select an option

Save DopamineDriven/7a826cae206bc28c2c620d1eee0dea9e to your computer and use it in GitHub Desktop.
Patch for @google/genai SDK (v1.34.0) — removes `unknown` from union types to fix TypeScript inference in the beta Interactions API
diff --git a/dist/node/node.d.ts b/dist/node/node.d.ts
index bc7365e795551b19fe390a25421e2611de75b168..5090f992b2deece3e098c311e06eee49cbda7db9 100644
--- a/dist/node/node.d.ts
+++ b/dist/node/node.d.ts
@@ -1821,7 +1821,7 @@ declare namespace ContentDelta {
}
namespace FunctionResultDelta {
interface Items {
- items?: Array<string | InteractionsAPI.ImageContent | unknown>;
+ items?: Array<string | InteractionsAPI.ImageContent>;
}
}
interface CodeExecutionCallDelta {
@@ -1914,7 +1914,7 @@ declare namespace ContentDelta {
}
namespace MCPServerToolResultDelta {
interface Items {
- items?: Array<string | InteractionsAPI.ImageContent | unknown>;
+ items?: Array<string | InteractionsAPI.ImageContent>;
}
}
interface FileSearchResultDelta {
@@ -3864,7 +3864,7 @@ declare interface FunctionResultContent {
/**
* The result of the tool call.
*/
- result: FunctionResultContent.Items | unknown | string;
+ result: FunctionResultContent.Items | string;
type: 'function_result';
/**
* Whether the tool call resulted in an error.
@@ -3878,7 +3878,7 @@ declare interface FunctionResultContent {
declare namespace FunctionResultContent {
interface Items {
- items?: Array<string | InteractionsAPI.ImageContent | unknown>;
+ items?: Array<string | InteractionsAPI.ImageContent>;
}
}
@@ -5407,7 +5407,7 @@ export declare class HttpResponse {
*/
responseInternal: Response;
constructor(response: Response);
- json(): Promise<unknown>;
+ json<T = unknown>(): Promise<T>;
}
/** An image. */
@@ -6994,7 +6994,7 @@ declare interface MCPServerToolResultContent {
/**
* The result of the tool call.
*/
- result: MCPServerToolResultContent.Items | unknown | string;
+ result: MCPServerToolResultContent.Items | string;
type: 'mcp_server_tool_result';
/**
* Name of the tool which is called for this specific tool call.
@@ -7008,7 +7008,7 @@ declare interface MCPServerToolResultContent {
declare namespace MCPServerToolResultContent {
interface Items {
- items?: Array<string | InteractionsAPI.ImageContent | unknown>;
+ items?: Array<string | InteractionsAPI.ImageContent>;
}
}
@@ -7076,7 +7076,7 @@ export declare enum MediaResolution {
* This type contains `RequestInit` options that may be available on the current runtime,
* including per-platform extensions like `dispatcher`, `agent`, `client`, etc.
*/
-declare type MergedRequestInit = RequestInits &
+declare type MergedRequestInit = RequestInits &
/** We don't include these in the types as they'll be overridden for every request. */
Partial<Record<'body' | 'headers' | 'method' | 'signal', never>>;
@@ -8557,7 +8557,7 @@ export declare interface Schema {
type?: Type;
}
-export declare type SchemaUnion = Schema | unknown;
+export declare type SchemaUnion = Schema;
/** An image mask representing a brush scribble. */
export declare interface ScribbleImage {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment