@langchain/google 0.2.12 → 0.2.14

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 (118) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/chat_models/api_types/generate_content.d.cts +0 -2
  3. package/dist/chat_models/api_types/generate_content.d.ts +0 -2
  4. package/dist/chat_models/api_types/interactions.d.cts +1423 -0
  5. package/dist/chat_models/api_types/interactions.d.ts +1423 -0
  6. package/dist/chat_models/base.cjs +12 -11
  7. package/dist/chat_models/base.cjs.map +1 -1
  8. package/dist/chat_models/base.d.cts +3 -5
  9. package/dist/chat_models/base.d.ts +3 -5
  10. package/dist/chat_models/base.js +12 -11
  11. package/dist/chat_models/base.js.map +1 -1
  12. package/dist/chat_models/handlers/base.cjs +1 -2
  13. package/dist/chat_models/handlers/base.d.cts +0 -2
  14. package/dist/chat_models/handlers/base.d.ts +0 -2
  15. package/dist/chat_models/handlers/base.js +1 -2
  16. package/dist/chat_models/handlers/generate_content.cjs +7 -7
  17. package/dist/chat_models/handlers/generate_content.cjs.map +1 -1
  18. package/dist/chat_models/handlers/generate_content.d.cts +0 -2
  19. package/dist/chat_models/handlers/generate_content.d.ts +0 -2
  20. package/dist/chat_models/handlers/generate_content.js +7 -7
  21. package/dist/chat_models/handlers/generate_content.js.map +1 -1
  22. package/dist/chat_models/handlers/index.cjs +2 -0
  23. package/dist/chat_models/handlers/index.d.cts +2 -1
  24. package/dist/chat_models/handlers/index.d.ts +2 -1
  25. package/dist/chat_models/handlers/index.js +2 -1
  26. package/dist/chat_models/handlers/interactions.cjs +303 -0
  27. package/dist/chat_models/handlers/interactions.cjs.map +1 -0
  28. package/dist/chat_models/handlers/interactions.d.cts +33 -0
  29. package/dist/chat_models/handlers/interactions.d.ts +33 -0
  30. package/dist/chat_models/handlers/interactions.js +303 -0
  31. package/dist/chat_models/handlers/interactions.js.map +1 -0
  32. package/dist/chat_models/index.cjs +5 -4
  33. package/dist/chat_models/index.cjs.map +1 -1
  34. package/dist/chat_models/index.d.cts +4 -5
  35. package/dist/chat_models/index.d.ts +4 -5
  36. package/dist/chat_models/index.js +5 -5
  37. package/dist/chat_models/index.js.map +1 -1
  38. package/dist/chat_models/node.cjs +3 -4
  39. package/dist/chat_models/node.d.cts +1 -3
  40. package/dist/chat_models/node.d.ts +1 -3
  41. package/dist/chat_models/node.js +3 -4
  42. package/dist/chat_models/profiles.cjs +1 -2
  43. package/dist/chat_models/profiles.js +1 -2
  44. package/dist/chat_models/types.cjs +1 -2
  45. package/dist/chat_models/types.cjs.map +1 -1
  46. package/dist/chat_models/types.d.cts +524 -23
  47. package/dist/chat_models/types.d.ts +524 -23
  48. package/dist/chat_models/types.js +1 -2
  49. package/dist/chat_models/types.js.map +1 -1
  50. package/dist/clients/index.cjs +3 -4
  51. package/dist/clients/index.d.cts +0 -2
  52. package/dist/clients/index.d.ts +0 -2
  53. package/dist/clients/index.js +3 -4
  54. package/dist/clients/node.cjs +4 -5
  55. package/dist/clients/node.d.cts +0 -2
  56. package/dist/clients/node.d.ts +0 -2
  57. package/dist/clients/node.js +4 -5
  58. package/dist/const.cjs +1 -2
  59. package/dist/const.js +1 -2
  60. package/dist/converters/generate_content/messages.cjs +2 -2
  61. package/dist/converters/generate_content/messages.cjs.map +1 -1
  62. package/dist/converters/generate_content/messages.js +2 -2
  63. package/dist/converters/generate_content/messages.js.map +1 -1
  64. package/dist/converters/generate_content/params.cjs +1 -2
  65. package/dist/converters/generate_content/params.js +1 -2
  66. package/dist/converters/generate_content/stream_events.cjs +9 -3
  67. package/dist/converters/generate_content/stream_events.cjs.map +1 -1
  68. package/dist/converters/generate_content/stream_events.js +9 -3
  69. package/dist/converters/generate_content/stream_events.js.map +1 -1
  70. package/dist/converters/generate_content/tools.cjs +1 -2
  71. package/dist/converters/generate_content/tools.js +1 -2
  72. package/dist/converters/interactions/messages.cjs +766 -0
  73. package/dist/converters/interactions/messages.cjs.map +1 -0
  74. package/dist/converters/interactions/messages.js +759 -0
  75. package/dist/converters/interactions/messages.js.map +1 -0
  76. package/dist/converters/interactions/params.cjs +244 -0
  77. package/dist/converters/interactions/params.cjs.map +1 -0
  78. package/dist/converters/interactions/params.js +237 -0
  79. package/dist/converters/interactions/params.js.map +1 -0
  80. package/dist/converters/interactions/stream_events.cjs +769 -0
  81. package/dist/converters/interactions/stream_events.cjs.map +1 -0
  82. package/dist/converters/interactions/stream_events.js +768 -0
  83. package/dist/converters/interactions/stream_events.js.map +1 -0
  84. package/dist/converters/interactions/tools.cjs +229 -0
  85. package/dist/converters/interactions/tools.cjs.map +1 -0
  86. package/dist/converters/interactions/tools.js +228 -0
  87. package/dist/converters/interactions/tools.js.map +1 -0
  88. package/dist/converters/shared/params.cjs +1 -2
  89. package/dist/converters/shared/params.js +1 -2
  90. package/dist/index.cjs +2 -0
  91. package/dist/index.d.cts +3 -2
  92. package/dist/index.d.ts +3 -2
  93. package/dist/index.js +2 -1
  94. package/dist/node.cjs +1 -1
  95. package/dist/node.d.cts +1 -1
  96. package/dist/node.d.ts +1 -1
  97. package/dist/node.js +1 -1
  98. package/dist/utils/errors.cjs +22 -4
  99. package/dist/utils/errors.cjs.map +1 -1
  100. package/dist/utils/errors.js +22 -6
  101. package/dist/utils/errors.js.map +1 -1
  102. package/dist/utils/gcp-auth.cjs +3 -4
  103. package/dist/utils/gcp-auth.d.cts +0 -2
  104. package/dist/utils/gcp-auth.d.ts +0 -2
  105. package/dist/utils/gcp-auth.js +3 -4
  106. package/dist/utils/handler.cjs +1 -2
  107. package/dist/utils/handler.d.cts +0 -2
  108. package/dist/utils/handler.d.ts +0 -2
  109. package/dist/utils/handler.js +1 -2
  110. package/dist/utils/metadata.cjs +1 -2
  111. package/dist/utils/metadata.js +1 -2
  112. package/dist/utils/misc.cjs +1 -2
  113. package/dist/utils/misc.d.cts +0 -2
  114. package/dist/utils/misc.d.ts +0 -2
  115. package/dist/utils/misc.js +1 -2
  116. package/dist/utils/stream.cjs +1 -2
  117. package/dist/utils/stream.js +1 -2
  118. package/package.json +11 -9
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../src/chat_models/types.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-namespace */\n\nimport type { InteropZodType } from \"@langchain/core/utils/types\";\nimport type { SerializableSchema } from \"@langchain/core/utils/standard_schema\";\nimport type {\n BaseChatModelParams,\n BaseChatModelCallOptions,\n BindToolsInput,\n} from \"@langchain/core/language_models/chat_models\";\nimport type { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport type { ApiClient } from \"../clients/index.js\";\nimport type { GenContent as GenContentNamespace } from \"./api_types/generate_content.js\";\nimport type { LowercaseLiteral, Prettify } from \"../utils/misc.js\";\nimport type { GoogleChatApiHandler } from \"./handlers/base.js\";\n\nexport interface BaseChatGoogleFields {\n /**\n * The temperature is used for sampling during response generation, which\n * occurs when topP and topK are applied. Temperature controls the degree of\n * randomness in token selection. Lower temperatures are good for prompts that\n * require a less open-ended or creative response, while higher temperatures\n * can lead to more diverse or creative results.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n temperature?: number;\n\n /**\n * Top-P changes how the model selects tokens for output. Tokens are selected\n * from the most probable to least probable until the sum of their\n * probabilities equals the top-P value.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n topP?: number;\n\n /**\n * Top-K changes how the model selects tokens for output. A top-K of 1 means\n * the selected token is the most probable among all tokens in the model's\n * vocabulary (also called greedy decoding), while a top-K of 3 means that the\n * next token is selected from among the 3 most probable tokens (using\n * temperature).\n */\n topK?: number;\n\n /**\n * Maximum number of tokens that can be generated in the response. A token is\n * approximately four characters. 100 tokens correspond to roughly 60-80 words.\n * Specify a lower value for shorter responses and a higher value for\n * potentially longer responses.\n */\n maxOutputTokens?: number;\n\n /**\n * Positive values penalize tokens that already appear in the generated text,\n * increasing the probability of generating more diverse content.\n */\n presencePenalty?: number;\n\n /**\n * Positive values penalize tokens that repeatedly appear in the generated\n * text, decreasing the probability of repeating content.\n */\n frequencyPenalty?: number;\n\n /**\n * Specifies a list of strings that tells the model to stop generating text if\n * one of the strings is encountered in the response. If a string appears\n * multiple times in the response, then the response truncates where it's\n * first encountered. The strings are case-sensitive.\n */\n stopSequences?: string[];\n\n /**\n * When seed is fixed to a specific value, the model makes a best effort to\n * provide the same response for repeated requests. Deterministic output isn't\n * guaranteed. Also, changing the model or parameter settings, such as the\n * temperature, can cause variations in the response even when you use the\n * same seed value. By default, a random seed value is used.\n */\n seed?: number;\n\n /**\n * A list of tools the model may use to generate the next response.\n * Can be LangChain tools, OpenAI tools, or Gemini function declarations.\n */\n tools?: BindToolsInput[];\n\n /**\n * OpenAI-compatible alias for media input detail level.\n *\n * This is mapped to `generationConfig.mediaResolution`:\n * - `\"auto\"` => default Gemini behavior (`mediaResolution` omitted)\n * - `\"low\"` => `\"MEDIA_RESOLUTION_LOW\"`\n * - `\"high\"` => `\"MEDIA_RESOLUTION_HIGH\"`\n *\n * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.\n */\n detail?: \"auto\" | \"low\" | \"high\";\n\n /**\n * The number of reasoning tokens that the model should generate.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n maxReasoningTokens?: number;\n\n /**\n * An alias for `maxReasoningTokens` for compatibility.\n */\n thinkingBudget?: number;\n\n /**\n * An alias for `maxReasoningTokens` under Gemini 2.5 or\n * the primary thinking/reasoning setting for Gemini 3.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n reasoningEffort?: Gemini.Shared.ThinkingLevel;\n\n /**\n * An alias for `reasoningEffort` for compatibility.\n */\n thinkingLevel?: Gemini.Shared.ThinkingLevel;\n\n /**\n * Custom / additional headers to include with every request to the API.\n * When set on both constructor params and per-invocation call options,\n * per-invocation headers take precidence for matching keys.\n */\n customHeaders?: Record<string, string>;\n\n /**\n * Per request settings for blocking unsafe content\n */\n safetySettings?: Prettify<Gemini.Shared.SafetySetting>[];\n\n /**\n * Media resolution for input media processing.\n *\n * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like\n * string value in the Gemini API.\n */\n mediaResolution?: Gemini.Shared.MediaResolution;\n}\n\nexport interface GenerateContentSpecificFields {\n /**\n * The schema that the generated response should match.\n * Can be a Zod schema or a JSON Schema object.\n * When set, the response will be structured according to this schema\n * and `responseMimeType` will automatically be set to \"application/json\".\n */\n responseSchema?:\n | InteropZodType\n | SerializableSchema\n | Record<string, unknown>;\n\n /**\n * Desired MIME type of the generated candidate content.\n */\n responseMimeType?: string;\n\n /**\n * The requested modalities of the response.\n * Represents the set of modalities that the model can return.\n * An empty list is equivalent to requesting only text.\n */\n responseModalities?: Prettify<GenContentNamespace.GenerativeLanguageModality>[];\n\n /**\n * If true, returns the log probabilities of the tokens that were chosen by\n * the model at each step. By default, this parameter is set to false.\n */\n responseLogprobs?: boolean;\n\n /**\n * Returns the log probabilities of the top candidate tokens at each generation\n * step. The model's chosen token might not be the same as the top candidate\n * token at each step. Specify the number of candidates to return by using an\n * integer value in the range of 1-20.\n */\n logprobs?: number;\n\n /**\n * Configuration for the model's thinking process\n */\n thinkingConfig?: Prettify<GenContentNamespace.ThinkingConfig>;\n\n /**\n * If true, enables enhanced civic answers feature.\n */\n enableEnhancedCivicAnswers?: boolean;\n\n /**\n * Speech generation configuration.\n * You can use either Google's definition of the speech configuration,\n * or a simplified version we've defined (which can be as simple\n * as the name of a pre-defined voice).\n */\n speechConfig?:\n | Prettify<GenContentNamespace.SpeechConfig>\n | SimplifiedSpeechConfig;\n\n /**\n * Configuration for image generation.\n */\n imageConfig?: Prettify<GenContentNamespace.ImageConfig>;\n\n /**\n * Inference service tiers.\n * \"priority\" offers highest reliability for higher rates.\n * \"flex\" offers a discount for preemptable processing.\n * Other values are treated as the standard service tier.\n */\n serviceTier?: GenContentNamespace.ServiceTier;\n}\n\nexport interface GenerateContentFields\n extends BaseChatGoogleFields, GenerateContentSpecificFields {}\n\nexport interface ChatGoogleFields\n extends BaseChatGoogleFields, Partial<GenerateContentSpecificFields> {}\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\nexport interface BaseChatGoogleParams\n extends BaseChatModelParams, ChatGoogleFields {\n model: string;\n apiClient?: ApiClient;\n endpoint?: string;\n location?: string;\n apiVersion?: string;\n platformType?: GooglePlatformType;\n vertexai?: boolean;\n streaming?: boolean;\n streamUsage?: boolean;\n apiHandler?: GoogleChatApiHandlerConfig;\n}\n\nexport interface BaseChatGoogleCallOptions\n extends BaseChatModelCallOptions, ChatGoogleFields {\n streamUsage?: boolean;\n}\n\nexport interface GoogleChatApiHandlerParams\n extends BaseChatModelParams, BaseChatGoogleFields {\n apiClient: ApiClient;\n caller: AsyncCaller;\n model: string;\n platform: GooglePlatformType;\n endpoint: string;\n location: string;\n apiVersion: string;\n isVertexExpress: boolean;\n publisher: string;\n streaming: boolean;\n streamUsage: boolean;\n customHeaders?: Record<string, string>;\n}\n\nexport interface GenerateContentApiHandlerParams\n extends GoogleChatApiHandlerParams, GenerateContentSpecificFields {}\n\nexport type GoogleChatApiHandlerFactory = (\n params: GoogleChatApiHandlerParams\n) => GoogleChatApiHandler;\n\nexport type GoogleChatApiHandlerConfig =\n | \"generateContent\"\n | GoogleChatApiHandlerFactory;\n\nexport type GenerateContentInvocationParams = Partial<\n Omit<GenContentNamespace.GenerateContentRequest, \"contents\">\n> & {\n serviceTier?: GenContentNamespace.ServiceTier;\n};\n\n// These are service tiers that we specifically need to send.\n// Other values will be ignored, resulting in the default\n// or \"standard\" setting.\nexport const settableServiceTier: GenContentNamespace.ServiceTier[] = [\n \"flex\",\n \"priority\",\n];\n\n// 1. Augment GenContent so internal references in generated types resolve\ndeclare module \"./api_types/generate_content.js\" {\n export namespace GenContent {\n // Gemini parts are contained as one intersecting type\n // in the spec, so we need to pick out the specific parts we need.\n export namespace Part {\n export type CodeExecutionResult = Pick<\n GenContentNamespace.Part,\n \"codeExecutionResult\"\n >;\n export type ExecutableCode = Pick<\n GenContentNamespace.Part,\n \"executableCode\"\n >;\n export type FileData = Pick<\n GenContentNamespace.Part,\n \"fileData\" | \"videoMetadata\"\n >;\n export type FunctionCall = Required<\n Pick<GenContentNamespace.Part, \"functionCall\">\n > &\n Pick<GenContentNamespace.Part, \"thoughtSignature\">;\n export type FunctionResponse = Pick<\n GenContentNamespace.Part,\n \"functionResponse\"\n >;\n export type InlineData = Pick<\n GenContentNamespace.Part,\n \"inlineData\" | \"videoMetadata\"\n >;\n export type MediaResolution = Pick<\n GenContentNamespace.Part,\n \"mediaResolution\"\n >;\n export type PartMetadata = Pick<GenContentNamespace.Part, \"partMetadata\">;\n export type Text = Pick<GenContentNamespace.Part, \"text\">;\n export type Thought = Pick<GenContentNamespace.Part, \"thought\">;\n export type ThoughtSignature = Pick<\n GenContentNamespace.Part,\n \"thoughtSignature\"\n >;\n }\n\n export namespace PrebuiltVoiceConfig {\n /**\n * The name of a prebuilt voice that can be used for speech synthesis.\n *\n * Extracted as a non-nullable type from the PrebuiltVoiceConfig[\"voiceName\"] property.\n */\n export type VoiceName = NonNullable<\n GenContentNamespace.PrebuiltVoiceConfig[\"voiceName\"]\n >;\n }\n\n export namespace SpeakerVoiceConfig {\n /**\n * The speaker identifier for a custom or multi-speaker TTS configuration.\n *\n * Extracted as a non-nullable type from the SpeakerVoiceConfig[\"speaker\"] property.\n */\n export type Speaker = NonNullable<\n GenContentNamespace.SpeakerVoiceConfig[\"speaker\"]\n >;\n }\n\n export namespace SpeechConfig {\n /**\n * The BCP-47 language code for speech synthesis (e.g., \"en-US\").\n *\n * Extracted as a non-nullable type from the SpeechConfig[\"languageCode\"] property.\n */\n export type LanguageCode = NonNullable<\n GenContentNamespace.SpeechConfig[\"languageCode\"]\n >;\n }\n\n /**\n * The level of \"thinking\" or reasoning configured for the model.\n *\n * Extends ThinkingConfig[\"thinkingLevel\"] to also accept\n * lowercase variants (e.g. \"high\" in addition to \"HIGH\").\n */\n export type ThinkingLevel =\n | GenContentNamespace.ThinkingConfig[\"thinkingLevel\"]\n | LowercaseLiteral<GenContentNamespace.ThinkingConfig[\"thinkingLevel\"]>;\n\n /**\n * The role of a content message. The spec types this as `string`, but\n * the API only accepts these specific values.\n */\n export type Role = \"user\" | \"model\" | \"function\";\n\n /**\n * Alias for the unwieldy generated grounding support type name.\n */\n export type GroundingSupport =\n GenContentNamespace.GoogleAiGenerativelanguageV1betaGroundingSupport;\n\n /**\n * Alias for the unwieldy generated segment type name.\n */\n export type Segment =\n GenContentNamespace.GoogleAiGenerativelanguageV1betaSegment;\n\n export namespace Tools {\n /**\n * The mode for function calling configuration, extracted from the\n * FunctionCallingConfig interface.\n */\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfig[\"mode\"];\n }\n\n /**\n * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).\n * Not in the current OpenAPI spec but still returned by the API.\n */\n export interface UrlRetrievalMetadata {\n urlRetrievalContexts?: Array<GenContentNamespace.UrlMetadata>;\n }\n\n // Augment Candidate with legacy field the API still returns.\n export interface Candidate {\n /** @deprecated Use urlContextMetadata instead. */\n readonly urlRetrievalMetadata?: UrlRetrievalMetadata;\n }\n }\n}\n\n// 2. Expose the Gemini composite namespace\nexport declare namespace Gemini {\n export namespace Shared {\n export type HarmCategory = GenContentNamespace.HarmCategory;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type MediaResolution =\n GenContentNamespace.GenerationConfig[\"mediaResolution\"];\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n }\n\n export namespace GenContent {\n export type Content = GenContentNamespace.Content;\n export type Candidate = GenContentNamespace.Candidate;\n export type GenerateContentRequest =\n GenContentNamespace.GenerateContentRequest;\n export type GenerateContentResponse =\n GenContentNamespace.GenerateContentResponse;\n export type GenerationConfig = GenContentNamespace.GenerationConfig;\n export type SafetyRating = GenContentNamespace.SafetyRating;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type PromptFeedback = GenContentNamespace.PromptFeedback;\n export type Tool = GenContentNamespace.Tool;\n export type ThinkingConfig = GenContentNamespace.ThinkingConfig;\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n export type SpeechConfig = GenContentNamespace.SpeechConfig;\n export namespace SpeechConfig {\n export type LanguageCode = GenContentNamespace.SpeechConfig.LanguageCode;\n }\n export type PrebuiltVoiceConfig = GenContentNamespace.PrebuiltVoiceConfig;\n export namespace PrebuiltVoiceConfig {\n export type VoiceName = GenContentNamespace.PrebuiltVoiceConfig.VoiceName;\n }\n export type SpeakerVoiceConfig = GenContentNamespace.SpeakerVoiceConfig;\n export namespace SpeakerVoiceConfig {\n export type Speaker = GenContentNamespace.SpeakerVoiceConfig.Speaker;\n }\n export type ServiceTier = GenContentNamespace.ServiceTier;\n export type Role = GenContentNamespace.Role;\n export type GroundingSupport = GenContentNamespace.GroundingSupport;\n export type GroundingMetadata = GenContentNamespace.GroundingMetadata;\n export type CitationMetadata = GenContentNamespace.CitationMetadata;\n export type UsageMetadata = GenContentNamespace.UsageMetadata;\n export type ModalityTokenCount = GenContentNamespace.ModalityTokenCount;\n export type Part = GenContentNamespace.Part;\n export namespace Part {\n export type CodeExecutionResult =\n GenContentNamespace.Part.CodeExecutionResult;\n export type ExecutableCode = GenContentNamespace.Part.ExecutableCode;\n export type FileData = GenContentNamespace.Part.FileData;\n export type FunctionCall = GenContentNamespace.Part.FunctionCall;\n export type FunctionResponse = GenContentNamespace.Part.FunctionResponse;\n export type InlineData = GenContentNamespace.Part.InlineData;\n export type MediaResolution = GenContentNamespace.Part.MediaResolution;\n export type PartMetadata = GenContentNamespace.Part.PartMetadata;\n export type Text = GenContentNamespace.Part.Text;\n export type Thought = GenContentNamespace.Part.Thought;\n export type ThoughtSignature = GenContentNamespace.Part.ThoughtSignature;\n }\n export namespace Tools {\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfigMode;\n export type FunctionDeclaration =\n GenContentNamespace.Tools.FunctionDeclaration;\n export type GoogleSearch = GenContentNamespace.Tools.GoogleSearch;\n export type CodeExecution = GenContentNamespace.Tools.CodeExecution;\n export type UrlContext = GenContentNamespace.Tools.UrlContext;\n export type GoogleMaps = GenContentNamespace.Tools.GoogleMaps;\n export type FileSearch = GenContentNamespace.Tools.FileSearch;\n export type ComputerUse = GenContentNamespace.Tools.ComputerUse;\n export type FunctionCallingConfig =\n GenContentNamespace.Tools.FunctionCallingConfig;\n export type RetrievalConfig = GenContentNamespace.Tools.RetrievalConfig;\n export type ToolConfig = GenContentNamespace.Tools.ToolConfig;\n export type Schema = GenContentNamespace.Tools.Schema;\n export type LatLng = GenContentNamespace.Tools.LatLng;\n export type Interval = GenContentNamespace.Tools.Interval;\n export type SearchTypes = GenContentNamespace.Tools.SearchTypes;\n export type Type = GenContentNamespace.Tools.Type;\n export type WebSearch = GenContentNamespace.Tools.WebSearch;\n export type ImageSearch = GenContentNamespace.Tools.ImageSearch;\n }\n }\n\n // Type aliases for generateContent wire types during Phase 1 transition\n export type Content = GenContentNamespace.Content;\n export type Candidate = GenContentNamespace.Candidate;\n export type GenerateContentRequest =\n GenContentNamespace.GenerateContentRequest;\n export type GenerateContentResponse =\n GenContentNamespace.GenerateContentResponse;\n export type GenerationConfig = GenContentNamespace.GenerationConfig;\n export type SafetyRating = GenContentNamespace.SafetyRating;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type PromptFeedback = GenContentNamespace.PromptFeedback;\n export type Tool = GenContentNamespace.Tool;\n export type ThinkingConfig = GenContentNamespace.ThinkingConfig;\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n export type SpeechConfig = GenContentNamespace.SpeechConfig;\n export namespace SpeechConfig {\n export type LanguageCode = GenContentNamespace.SpeechConfig.LanguageCode;\n }\n export type PrebuiltVoiceConfig = GenContentNamespace.PrebuiltVoiceConfig;\n export namespace PrebuiltVoiceConfig {\n export type VoiceName = GenContentNamespace.PrebuiltVoiceConfig.VoiceName;\n }\n export type SpeakerVoiceConfig = GenContentNamespace.SpeakerVoiceConfig;\n export namespace SpeakerVoiceConfig {\n export type Speaker = GenContentNamespace.SpeakerVoiceConfig.Speaker;\n }\n export type ServiceTier = GenContentNamespace.ServiceTier;\n export type Role = GenContentNamespace.Role;\n export type GroundingSupport = GenContentNamespace.GroundingSupport;\n export type GroundingMetadata = GenContentNamespace.GroundingMetadata;\n export type CitationMetadata = GenContentNamespace.CitationMetadata;\n export type UsageMetadata = GenContentNamespace.UsageMetadata;\n export type ModalityTokenCount = GenContentNamespace.ModalityTokenCount;\n\n export type Part = GenContentNamespace.Part;\n export namespace Part {\n export type CodeExecutionResult =\n GenContentNamespace.Part.CodeExecutionResult;\n export type ExecutableCode = GenContentNamespace.Part.ExecutableCode;\n export type FileData = GenContentNamespace.Part.FileData;\n export type FunctionCall = GenContentNamespace.Part.FunctionCall;\n export type FunctionResponse = GenContentNamespace.Part.FunctionResponse;\n export type InlineData = GenContentNamespace.Part.InlineData;\n export type MediaResolution = GenContentNamespace.Part.MediaResolution;\n export type PartMetadata = GenContentNamespace.Part.PartMetadata;\n export type Text = GenContentNamespace.Part.Text;\n export type Thought = GenContentNamespace.Part.Thought;\n export type ThoughtSignature = GenContentNamespace.Part.ThoughtSignature;\n }\n\n export namespace Tools {\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfigMode;\n export type FunctionDeclaration =\n GenContentNamespace.Tools.FunctionDeclaration;\n export type GoogleSearch = GenContentNamespace.Tools.GoogleSearch;\n export type CodeExecution = GenContentNamespace.Tools.CodeExecution;\n export type UrlContext = GenContentNamespace.Tools.UrlContext;\n export type GoogleMaps = GenContentNamespace.Tools.GoogleMaps;\n export type FileSearch = GenContentNamespace.Tools.FileSearch;\n export type ComputerUse = GenContentNamespace.Tools.ComputerUse;\n export type FunctionCallingConfig =\n GenContentNamespace.Tools.FunctionCallingConfig;\n export type RetrievalConfig = GenContentNamespace.Tools.RetrievalConfig;\n export type ToolConfig = GenContentNamespace.Tools.ToolConfig;\n export type Schema = GenContentNamespace.Tools.Schema;\n export type LatLng = GenContentNamespace.Tools.LatLng;\n export type Interval = GenContentNamespace.Tools.Interval;\n export type SearchTypes = GenContentNamespace.Tools.SearchTypes;\n export type Type = GenContentNamespace.Tools.Type;\n export type WebSearch = GenContentNamespace.Tools.WebSearch;\n export type ImageSearch = GenContentNamespace.Tools.ImageSearch;\n }\n}\n\nexport type { GenContentNamespace as GenContent };\n\n/**\n * Simplified speaker/name pair for multi-speaker config.\n * - `speaker` derived from SpeakerVoiceConfig[\"speaker\"]\n * - `name` is the prebuilt voice name\n */\nexport interface SpeechSpeakerName {\n speaker: Gemini.GenContent.SpeakerVoiceConfig.Speaker;\n name: Gemini.GenContent.PrebuiltVoiceConfig.VoiceName;\n}\n\n/** A voice can be a prebuilt voice name, a speaker/name pair, or an array of pairs */\nexport type SpeechVoice =\n | Gemini.GenContent.PrebuiltVoiceConfig.VoiceName\n | SpeechSpeakerName\n | SpeechSpeakerName[];\n\n/** Voice with language code (derived from SpeechConfig's languageCode) */\nexport interface SpeechVoiceLanguage {\n voice: SpeechVoice;\n languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;\n}\n\n/** Voices with language code */\nexport interface SpeechVoicesLanguage {\n voices: SpeechVoice;\n languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;\n}\n\n/** Simplified language config (with voice or voices) */\nexport type SimplifiedSpeechLanguageConfig =\n | SpeechVoiceLanguage\n | SpeechVoicesLanguage;\n\n/** Top-level simplified config: just a voice, or voice+language */\nexport type SimplifiedSpeechConfig =\n | SpeechVoice\n | SimplifiedSpeechLanguageConfig;\n"],"mappings":";AAyRA,MAAa,sBAAyD,CACpE,QACA,UACF"}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../src/chat_models/types.ts"],"sourcesContent":["/* oxlint-disable @typescript-eslint/no-namespace */\n\nimport type { InteropZodType } from \"@langchain/core/utils/types\";\nimport type { SerializableSchema } from \"@langchain/core/utils/standard_schema\";\nimport type {\n BaseChatModelParams,\n BaseChatModelCallOptions,\n BindToolsInput,\n} from \"@langchain/core/language_models/chat_models\";\nimport type { AsyncCaller } from \"@langchain/core/utils/async_caller\";\nimport type { ApiClient } from \"../clients/index.js\";\nimport type { GenContent as GenContentNamespace } from \"./api_types/generate_content.js\";\nimport type { Interactions as InteractionsNamespace } from \"./api_types/interactions.js\";\nimport type { LowercaseLiteral, Prettify } from \"../utils/misc.js\";\nimport type { GoogleChatApiHandler } from \"./handlers/base.js\";\n\nexport interface BaseChatGoogleFields {\n /**\n * The temperature is used for sampling during response generation, which\n * occurs when topP and topK are applied. Temperature controls the degree of\n * randomness in token selection. Lower temperatures are good for prompts that\n * require a less open-ended or creative response, while higher temperatures\n * can lead to more diverse or creative results.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n temperature?: number;\n\n /**\n * Top-P changes how the model selects tokens for output. Tokens are selected\n * from the most probable to least probable until the sum of their\n * probabilities equals the top-P value.\n *\n * Specify a lower value for less random responses and a higher value for more\n * random responses.\n */\n topP?: number;\n\n /**\n * Top-K changes how the model selects tokens for output. A top-K of 1 means\n * the selected token is the most probable among all tokens in the model's\n * vocabulary (also called greedy decoding), while a top-K of 3 means that the\n * next token is selected from among the 3 most probable tokens (using\n * temperature).\n */\n topK?: number;\n\n /**\n * Maximum number of tokens that can be generated in the response. A token is\n * approximately four characters. 100 tokens correspond to roughly 60-80 words.\n * Specify a lower value for shorter responses and a higher value for\n * potentially longer responses.\n */\n maxOutputTokens?: number;\n\n /**\n * Positive values penalize tokens that already appear in the generated text,\n * increasing the probability of generating more diverse content.\n */\n presencePenalty?: number;\n\n /**\n * Positive values penalize tokens that repeatedly appear in the generated\n * text, decreasing the probability of repeating content.\n */\n frequencyPenalty?: number;\n\n /**\n * Specifies a list of strings that tells the model to stop generating text if\n * one of the strings is encountered in the response. If a string appears\n * multiple times in the response, then the response truncates where it's\n * first encountered. The strings are case-sensitive.\n */\n stopSequences?: string[];\n\n /**\n * When seed is fixed to a specific value, the model makes a best effort to\n * provide the same response for repeated requests. Deterministic output isn't\n * guaranteed. Also, changing the model or parameter settings, such as the\n * temperature, can cause variations in the response even when you use the\n * same seed value. By default, a random seed value is used.\n */\n seed?: number;\n\n /**\n * A list of tools the model may use to generate the next response.\n * Can be LangChain tools, OpenAI tools, or Gemini function declarations.\n */\n tools?: BindToolsInput[];\n\n /**\n * OpenAI-compatible alias for media input detail level.\n *\n * This is mapped to `generationConfig.mediaResolution`:\n * - `\"auto\"` => default Gemini behavior (`mediaResolution` omitted)\n * - `\"low\"` => `\"MEDIA_RESOLUTION_LOW\"`\n * - `\"high\"` => `\"MEDIA_RESOLUTION_HIGH\"`\n *\n * If both `mediaResolution` and `detail` are provided, `mediaResolution` wins.\n */\n detail?: \"auto\" | \"low\" | \"high\";\n\n /**\n * The number of reasoning tokens that the model should generate.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n maxReasoningTokens?: number;\n\n /**\n * An alias for `maxReasoningTokens` for compatibility.\n */\n thinkingBudget?: number;\n\n /**\n * An alias for `maxReasoningTokens` under Gemini 2.5 or\n * the primary thinking/reasoning setting for Gemini 3.\n * If explicitly set, then the reasoning blocks will be returned.\n */\n reasoningEffort?: Gemini.Shared.ThinkingLevel;\n\n /**\n * An alias for `reasoningEffort` for compatibility.\n */\n thinkingLevel?: Gemini.Shared.ThinkingLevel;\n\n /**\n * Custom / additional headers to include with every request to the API.\n * When set on both constructor params and per-invocation call options,\n * per-invocation headers take precidence for matching keys.\n */\n customHeaders?: Record<string, string>;\n\n /**\n * Per request settings for blocking unsafe content\n */\n safetySettings?: Prettify<Gemini.Shared.SafetySetting>[];\n\n /**\n * Media resolution for input media processing.\n *\n * This maps to `generationConfig.mediaResolution`, which is a scalar enum-like\n * string value in the Gemini API.\n */\n mediaResolution?: Gemini.Shared.MediaResolution;\n\n /**\n * The schema that the generated response should match.\n * Can be a Zod schema or a JSON Schema object.\n * When set, the response will be structured according to this schema\n * and `responseMimeType` will automatically be set to \"application/json\".\n */\n responseSchema?:\n | InteropZodType\n | SerializableSchema\n | Record<string, unknown>;\n\n /**\n * Desired MIME type of the generated candidate content.\n */\n responseMimeType?: string;\n\n /**\n * The requested modalities of the response.\n * Represents the set of modalities that the model can return.\n * An empty list is equivalent to requesting only text.\n */\n responseModalities?: Prettify<GenContentNamespace.GenerativeLanguageModality>[];\n\n /**\n * Configuration for the model's thinking process\n */\n thinkingConfig?: Prettify<GenContentNamespace.ThinkingConfig>;\n\n /**\n * Speech generation configuration.\n * You can use either Google's definition of the speech configuration,\n * or a simplified version we've defined (which can be as simple\n * as the name of a pre-defined voice).\n */\n speechConfig?:\n | Prettify<GenContentNamespace.SpeechConfig>\n | SimplifiedSpeechConfig;\n\n /**\n * Configuration for image generation.\n */\n imageConfig?: Prettify<GenContentNamespace.ImageConfig>;\n\n /**\n * Inference service tiers.\n * \"priority\" offers highest reliability for higher rates.\n * \"flex\" offers a discount for preemptable processing.\n * Other values are treated as the standard service tier.\n */\n serviceTier?: GenContentNamespace.ServiceTier;\n}\n\nexport interface GenerateContentSpecificFields {\n /**\n * If true, returns the log probabilities of the tokens that were chosen by\n * the model at each step. By default, this parameter is set to false.\n */\n responseLogprobs?: boolean;\n\n /**\n * Returns the log probabilities of the top candidate tokens at each generation\n * step. The model's chosen token might not be the same as the top candidate\n * token at each step. Specify the number of candidates to return by using an\n * integer value in the range of 1-20.\n */\n logprobs?: number;\n\n /**\n * If true, enables enhanced civic answers feature.\n */\n enableEnhancedCivicAnswers?: boolean;\n}\n\nexport interface InteractionsSpecificFields {\n /**\n * Native Interactions API `response_format` configuration (JSON Schema or media response format).\n * Note: `responseSchema`, `responseModalities`, `responseMimeType`, and `imageConfig` are also\n * automatically translated into `response_format` when using the Interactions API.\n */\n responseFormat?: Gemini.Interactions.CreateInteractionParameters[\"response_format\"];\n\n /**\n * The ID of a previous interaction to continue a stateful server-side conversation.\n */\n previousInteractionId?: string;\n\n /**\n * Whether to store the interaction on the server.\n */\n store?: boolean;\n\n /**\n * Whether to execute the interaction in the background (primarily for agents).\n */\n background?: boolean;\n\n /**\n * The name of the agent to use for the interaction (mutually exclusive with `model` in the raw API,\n * or used when invoking an agent endpoint).\n */\n agent?: string;\n\n /**\n * Configuration parameters for the specified agent.\n */\n agentConfig?: Gemini.Interactions.AgentConfig;\n\n /**\n * Optional webhook configuration for receiving asynchronous interaction events.\n */\n webhookConfig?: Gemini.Interactions.WebhookConfig;\n}\n\nexport interface GenerateContentFields\n extends BaseChatGoogleFields, GenerateContentSpecificFields {}\n\nexport interface InteractionsFields\n extends BaseChatGoogleFields, InteractionsSpecificFields {}\n\nexport interface ChatGoogleFields\n extends\n BaseChatGoogleFields,\n Partial<GenerateContentSpecificFields>,\n Partial<InteractionsSpecificFields> {}\n\nexport type GooglePlatformType = \"gai\" | \"gcp\";\n\nexport interface BaseChatGoogleParams\n extends BaseChatModelParams, ChatGoogleFields {\n model: string;\n apiClient?: ApiClient;\n endpoint?: string;\n location?: string;\n apiVersion?: string;\n platformType?: GooglePlatformType;\n vertexai?: boolean;\n streaming?: boolean;\n streamUsage?: boolean;\n apiHandler?: GoogleChatApiHandlerConfig;\n}\n\nexport interface BaseChatGoogleCallOptions\n extends BaseChatModelCallOptions, ChatGoogleFields {\n streamUsage?: boolean;\n}\n\nexport interface GoogleChatApiHandlerParams\n extends BaseChatModelParams, BaseChatGoogleFields {\n apiClient: ApiClient;\n caller: AsyncCaller;\n model: string;\n platform: GooglePlatformType;\n endpoint: string;\n location: string;\n apiVersion: string;\n isVertexExpress: boolean;\n publisher: string;\n streaming: boolean;\n streamUsage: boolean;\n customHeaders?: Record<string, string>;\n}\n\nexport interface GenerateContentApiHandlerParams\n extends GoogleChatApiHandlerParams, GenerateContentSpecificFields {}\n\nexport interface InteractionsApiHandlerParams\n extends GoogleChatApiHandlerParams, InteractionsSpecificFields {}\n\nexport type GoogleChatApiHandlerFactory = (\n params: GoogleChatApiHandlerParams\n) => GoogleChatApiHandler;\n\nexport type GoogleChatApiHandlerConfig =\n | \"generateContent\"\n | \"interactions\"\n | GoogleChatApiHandlerFactory;\n\nexport type GenerateContentInvocationParams = Partial<\n Omit<GenContentNamespace.GenerateContentRequest, \"contents\">\n> & {\n serviceTier?: GenContentNamespace.ServiceTier;\n};\n\nexport type InteractionsInvocationParams = Partial<\n Omit<Gemini.Interactions.CreateInteractionParameters, \"input\">\n>;\n\n// These are service tiers that we specifically need to send.\n// Other values will be ignored, resulting in the default\n// or \"standard\" setting.\nexport const settableServiceTier: GenContentNamespace.ServiceTier[] = [\n \"flex\",\n \"priority\",\n];\n\n// 1. Augment GenContent so internal references in generated types resolve\ndeclare module \"./api_types/generate_content.js\" {\n export namespace GenContent {\n // Gemini parts are contained as one intersecting type\n // in the spec, so we need to pick out the specific parts we need.\n export namespace Part {\n export type CodeExecutionResult = Pick<\n GenContentNamespace.Part,\n \"codeExecutionResult\"\n >;\n export type ExecutableCode = Pick<\n GenContentNamespace.Part,\n \"executableCode\"\n >;\n export type FileData = Pick<\n GenContentNamespace.Part,\n \"fileData\" | \"videoMetadata\"\n >;\n export type FunctionCall = Required<\n Pick<GenContentNamespace.Part, \"functionCall\">\n > &\n Pick<GenContentNamespace.Part, \"thoughtSignature\">;\n export type FunctionResponse = Pick<\n GenContentNamespace.Part,\n \"functionResponse\"\n >;\n export type InlineData = Pick<\n GenContentNamespace.Part,\n \"inlineData\" | \"videoMetadata\"\n >;\n export type MediaResolution = Pick<\n GenContentNamespace.Part,\n \"mediaResolution\"\n >;\n export type PartMetadata = Pick<GenContentNamespace.Part, \"partMetadata\">;\n export type Text = Pick<GenContentNamespace.Part, \"text\">;\n export type Thought = Pick<GenContentNamespace.Part, \"thought\">;\n export type ThoughtSignature = Pick<\n GenContentNamespace.Part,\n \"thoughtSignature\"\n >;\n }\n\n export namespace PrebuiltVoiceConfig {\n /**\n * The name of a prebuilt voice that can be used for speech synthesis.\n *\n * Extracted as a non-nullable type from the PrebuiltVoiceConfig[\"voiceName\"] property.\n */\n export type VoiceName = NonNullable<\n GenContentNamespace.PrebuiltVoiceConfig[\"voiceName\"]\n >;\n }\n\n export namespace SpeakerVoiceConfig {\n /**\n * The speaker identifier for a custom or multi-speaker TTS configuration.\n *\n * Extracted as a non-nullable type from the SpeakerVoiceConfig[\"speaker\"] property.\n */\n export type Speaker = NonNullable<\n GenContentNamespace.SpeakerVoiceConfig[\"speaker\"]\n >;\n }\n\n export namespace SpeechConfig {\n /**\n * The BCP-47 language code for speech synthesis (e.g., \"en-US\").\n *\n * Extracted as a non-nullable type from the SpeechConfig[\"languageCode\"] property.\n */\n export type LanguageCode = NonNullable<\n GenContentNamespace.SpeechConfig[\"languageCode\"]\n >;\n }\n\n /**\n * The level of \"thinking\" or reasoning configured for the model.\n *\n * Extends ThinkingConfig[\"thinkingLevel\"] to also accept\n * lowercase variants (e.g. \"high\" in addition to \"HIGH\").\n */\n export type ThinkingLevel =\n | GenContentNamespace.ThinkingConfig[\"thinkingLevel\"]\n | LowercaseLiteral<GenContentNamespace.ThinkingConfig[\"thinkingLevel\"]>;\n\n /**\n * The role of a content message. The spec types this as `string`, but\n * the API only accepts these specific values.\n */\n export type Role = \"user\" | \"model\" | \"function\";\n\n /**\n * Alias for the unwieldy generated grounding support type name.\n */\n export type GroundingSupport =\n GenContentNamespace.GoogleAiGenerativelanguageV1betaGroundingSupport;\n\n /**\n * Alias for the unwieldy generated segment type name.\n */\n export type Segment =\n GenContentNamespace.GoogleAiGenerativelanguageV1betaSegment;\n\n export namespace Tools {\n /**\n * The mode for function calling configuration, extracted from the\n * FunctionCallingConfig interface.\n */\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfig[\"mode\"];\n }\n\n /**\n * Legacy URL retrieval metadata (predecessor of UrlContextMetadata).\n * Not in the current OpenAPI spec but still returned by the API.\n */\n export interface UrlRetrievalMetadata {\n urlRetrievalContexts?: Array<GenContentNamespace.UrlMetadata>;\n }\n\n // Augment Candidate with legacy field the API still returns.\n export interface Candidate {\n /** @deprecated Use urlContextMetadata instead. */\n readonly urlRetrievalMetadata?: UrlRetrievalMetadata;\n }\n }\n}\n\n// 2. Expose the Gemini composite namespace\nexport declare namespace Gemini {\n export namespace Shared {\n export type HarmCategory = GenContentNamespace.HarmCategory;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type MediaResolution =\n GenContentNamespace.GenerationConfig[\"mediaResolution\"];\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n }\n\n export namespace GenContent {\n export type Content = GenContentNamespace.Content;\n export type Candidate = GenContentNamespace.Candidate;\n export type GenerateContentRequest =\n GenContentNamespace.GenerateContentRequest;\n export type GenerateContentResponse =\n GenContentNamespace.GenerateContentResponse;\n export type GenerationConfig = GenContentNamespace.GenerationConfig;\n export type SafetyRating = GenContentNamespace.SafetyRating;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type PromptFeedback = GenContentNamespace.PromptFeedback;\n export type Tool = GenContentNamespace.Tool;\n export type ThinkingConfig = GenContentNamespace.ThinkingConfig;\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n export type SpeechConfig = GenContentNamespace.SpeechConfig;\n export namespace SpeechConfig {\n export type LanguageCode = GenContentNamespace.SpeechConfig.LanguageCode;\n }\n export type PrebuiltVoiceConfig = GenContentNamespace.PrebuiltVoiceConfig;\n export namespace PrebuiltVoiceConfig {\n export type VoiceName = GenContentNamespace.PrebuiltVoiceConfig.VoiceName;\n }\n export type SpeakerVoiceConfig = GenContentNamespace.SpeakerVoiceConfig;\n export namespace SpeakerVoiceConfig {\n export type Speaker = GenContentNamespace.SpeakerVoiceConfig.Speaker;\n }\n export type ServiceTier = GenContentNamespace.ServiceTier;\n export type ImageConfig = GenContentNamespace.ImageConfig;\n export type Role = GenContentNamespace.Role;\n export type GroundingSupport = GenContentNamespace.GroundingSupport;\n export type GroundingMetadata = GenContentNamespace.GroundingMetadata;\n export type CitationMetadata = GenContentNamespace.CitationMetadata;\n export type UsageMetadata = GenContentNamespace.UsageMetadata;\n export type ModalityTokenCount = GenContentNamespace.ModalityTokenCount;\n export type Part = GenContentNamespace.Part;\n export namespace Part {\n export type CodeExecutionResult =\n GenContentNamespace.Part.CodeExecutionResult;\n export type ExecutableCode = GenContentNamespace.Part.ExecutableCode;\n export type FileData = GenContentNamespace.Part.FileData;\n export type FunctionCall = GenContentNamespace.Part.FunctionCall;\n export type FunctionResponse = GenContentNamespace.Part.FunctionResponse;\n export type InlineData = GenContentNamespace.Part.InlineData;\n export type MediaResolution = GenContentNamespace.Part.MediaResolution;\n export type PartMetadata = GenContentNamespace.Part.PartMetadata;\n export type Text = GenContentNamespace.Part.Text;\n export type Thought = GenContentNamespace.Part.Thought;\n export type ThoughtSignature = GenContentNamespace.Part.ThoughtSignature;\n }\n export namespace Tools {\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfigMode;\n export type FunctionDeclaration =\n GenContentNamespace.Tools.FunctionDeclaration;\n export type GoogleSearch = GenContentNamespace.Tools.GoogleSearch;\n export type CodeExecution = GenContentNamespace.Tools.CodeExecution;\n export type UrlContext = GenContentNamespace.Tools.UrlContext;\n export type GoogleMaps = GenContentNamespace.Tools.GoogleMaps;\n export type FileSearch = GenContentNamespace.Tools.FileSearch;\n export type ComputerUse = GenContentNamespace.Tools.ComputerUse;\n export type FunctionCallingConfig =\n GenContentNamespace.Tools.FunctionCallingConfig;\n export type RetrievalConfig = GenContentNamespace.Tools.RetrievalConfig;\n export type ToolConfig = GenContentNamespace.Tools.ToolConfig;\n export type Schema = GenContentNamespace.Tools.Schema;\n export type LatLng = GenContentNamespace.Tools.LatLng;\n export type Interval = GenContentNamespace.Tools.Interval;\n export type SearchTypes = GenContentNamespace.Tools.SearchTypes;\n export type Type = GenContentNamespace.Tools.Type;\n export type WebSearch = GenContentNamespace.Tools.WebSearch;\n export type ImageSearch = GenContentNamespace.Tools.ImageSearch;\n }\n }\n\n // Type aliases for generateContent wire types during Phase 1 transition\n export type Content = GenContentNamespace.Content;\n export type Candidate = GenContentNamespace.Candidate;\n export type GenerateContentRequest =\n GenContentNamespace.GenerateContentRequest;\n export type GenerateContentResponse =\n GenContentNamespace.GenerateContentResponse;\n export type GenerationConfig = GenContentNamespace.GenerationConfig;\n export type SafetyRating = GenContentNamespace.SafetyRating;\n export type SafetySetting = GenContentNamespace.SafetySetting;\n export type PromptFeedback = GenContentNamespace.PromptFeedback;\n export type Tool = GenContentNamespace.Tool;\n export type ThinkingConfig = GenContentNamespace.ThinkingConfig;\n export type ThinkingLevel = GenContentNamespace.ThinkingLevel;\n export type SpeechConfig = GenContentNamespace.SpeechConfig;\n export namespace SpeechConfig {\n export type LanguageCode = GenContentNamespace.SpeechConfig.LanguageCode;\n }\n export type PrebuiltVoiceConfig = GenContentNamespace.PrebuiltVoiceConfig;\n export namespace PrebuiltVoiceConfig {\n export type VoiceName = GenContentNamespace.PrebuiltVoiceConfig.VoiceName;\n }\n export type SpeakerVoiceConfig = GenContentNamespace.SpeakerVoiceConfig;\n export namespace SpeakerVoiceConfig {\n export type Speaker = GenContentNamespace.SpeakerVoiceConfig.Speaker;\n }\n export type ServiceTier = GenContentNamespace.ServiceTier;\n export type ImageConfig = GenContentNamespace.ImageConfig;\n export type Role = GenContentNamespace.Role;\n export type GroundingSupport = GenContentNamespace.GroundingSupport;\n export type GroundingMetadata = GenContentNamespace.GroundingMetadata;\n export type CitationMetadata = GenContentNamespace.CitationMetadata;\n export type UsageMetadata = GenContentNamespace.UsageMetadata;\n export type ModalityTokenCount = GenContentNamespace.ModalityTokenCount;\n\n export type Part = GenContentNamespace.Part;\n export namespace Part {\n export type CodeExecutionResult =\n GenContentNamespace.Part.CodeExecutionResult;\n export type ExecutableCode = GenContentNamespace.Part.ExecutableCode;\n export type FileData = GenContentNamespace.Part.FileData;\n export type FunctionCall = GenContentNamespace.Part.FunctionCall;\n export type FunctionResponse = GenContentNamespace.Part.FunctionResponse;\n export type InlineData = GenContentNamespace.Part.InlineData;\n export type MediaResolution = GenContentNamespace.Part.MediaResolution;\n export type PartMetadata = GenContentNamespace.Part.PartMetadata;\n export type Text = GenContentNamespace.Part.Text;\n export type Thought = GenContentNamespace.Part.Thought;\n export type ThoughtSignature = GenContentNamespace.Part.ThoughtSignature;\n }\n\n export namespace Tools {\n export type FunctionCallingConfigMode =\n GenContentNamespace.Tools.FunctionCallingConfigMode;\n export type FunctionDeclaration =\n GenContentNamespace.Tools.FunctionDeclaration;\n export type GoogleSearch = GenContentNamespace.Tools.GoogleSearch;\n export type CodeExecution = GenContentNamespace.Tools.CodeExecution;\n export type UrlContext = GenContentNamespace.Tools.UrlContext;\n export type GoogleMaps = GenContentNamespace.Tools.GoogleMaps;\n export type FileSearch = GenContentNamespace.Tools.FileSearch;\n export type ComputerUse = GenContentNamespace.Tools.ComputerUse;\n export type FunctionCallingConfig =\n GenContentNamespace.Tools.FunctionCallingConfig;\n export type RetrievalConfig = GenContentNamespace.Tools.RetrievalConfig;\n export type ToolConfig = GenContentNamespace.Tools.ToolConfig;\n export type Schema = GenContentNamespace.Tools.Schema;\n export type LatLng = GenContentNamespace.Tools.LatLng;\n export type Interval = GenContentNamespace.Tools.Interval;\n export type SearchTypes = GenContentNamespace.Tools.SearchTypes;\n export type Type = GenContentNamespace.Tools.Type;\n export type WebSearch = GenContentNamespace.Tools.WebSearch;\n export type ImageSearch = GenContentNamespace.Tools.ImageSearch;\n }\n\n export namespace Interactions {\n // =========================================================================\n // Narrowed Content & MediaProcessing types\n // Note: interactions-openapi.json uses JSON Schema `\"const\"` instead of\n // `\"enum\"` for `type` discriminators, which sparktype generates as\n // `type: unknown` in `./api_types/interactions.ts`. We narrow each\n // discriminator here so TypeScript discriminated unions work without\n // modifying the sparktype-generated file.\n // =========================================================================\n\n // Narrowed from InteractionsNamespace.StaticMediaProcessing because\n // interactions-openapi.json uses `\"const\": \"static\"`, which sparktype outputs as `unknown`.\n export type StaticMediaProcessing = Omit<\n InteractionsNamespace.StaticMediaProcessing,\n \"type\"\n > & {\n type: \"static\";\n };\n\n export type MediaProcessing = StaticMediaProcessing;\n\n // Narrowed from InteractionsNamespace.UrlCitation because\n // interactions-openapi.json uses `\"const\": \"url_citation\"`, which sparktype outputs as `unknown`.\n export type UrlCitation = Omit<\n InteractionsNamespace.UrlCitation,\n \"type\"\n > & {\n type: \"url_citation\";\n };\n\n // Narrowed from InteractionsNamespace.FileCitation because\n // interactions-openapi.json uses `\"const\": \"file_citation\"`, which sparktype outputs as `unknown`.\n export type FileCitation = Omit<\n InteractionsNamespace.FileCitation,\n \"type\"\n > & {\n type: \"file_citation\";\n };\n\n // Narrowed from InteractionsNamespace.PlaceCitation because\n // interactions-openapi.json uses `\"const\": \"place_citation\"`, which sparktype outputs as `unknown`.\n export type PlaceCitation = Omit<\n InteractionsNamespace.PlaceCitation,\n \"type\"\n > & {\n type: \"place_citation\";\n };\n\n // Narrowed from InteractionsNamespace.SpeechAnnotation because\n // interactions-openapi.json uses `\"const\": \"speech_metadata\"`, which sparktype outputs as `unknown`.\n export type SpeechAnnotation = Omit<\n InteractionsNamespace.SpeechAnnotation,\n \"type\"\n > & {\n type: \"speech_metadata\";\n };\n\n // Narrowed from InteractionsNamespace.WordInfo because\n // interactions-openapi.json uses `\"const\": \"word_info\"`, which sparktype outputs as `unknown`.\n export type WordInfo = Omit<InteractionsNamespace.WordInfo, \"type\"> & {\n type: \"word_info\";\n };\n\n // Narrowed union of Annotation types with literal `type` discriminators.\n export type Annotation =\n | UrlCitation\n | FileCitation\n | PlaceCitation\n | SpeechAnnotation\n | WordInfo;\n\n // Narrowed from InteractionsNamespace.TextContent because\n // interactions-openapi.json uses `\"const\": \"text\"`, which sparktype outputs as `unknown`.\n export type TextContent = Omit<\n InteractionsNamespace.TextContent,\n \"type\" | \"annotations\"\n > & {\n type: \"text\";\n annotations?: Array<Annotation>;\n };\n\n // Narrowed from InteractionsNamespace.ImageContent because\n // interactions-openapi.json uses `\"const\": \"image\"`, which sparktype outputs as `unknown`.\n export type ImageContent = Omit<\n InteractionsNamespace.ImageContent,\n \"type\"\n > & {\n type: \"image\";\n };\n\n // Narrowed from InteractionsNamespace.AudioContent because\n // interactions-openapi.json uses `\"const\": \"audio\"`, which sparktype outputs as `unknown`.\n export type AudioContent = Omit<\n InteractionsNamespace.AudioContent,\n \"type\"\n > & {\n type: \"audio\";\n };\n\n // Narrowed from InteractionsNamespace.DocumentContent because\n // interactions-openapi.json uses `\"const\": \"document\"`, which sparktype outputs as `unknown`.\n export type DocumentContent = Omit<\n InteractionsNamespace.DocumentContent,\n \"type\"\n > & {\n type: \"document\";\n };\n\n // Narrowed from InteractionsNamespace.VideoContent because\n // interactions-openapi.json uses `\"const\": \"video\"`, which sparktype outputs as `unknown`.\n export type VideoContent = Omit<\n InteractionsNamespace.VideoContent,\n \"type\" | \"processing\"\n > & {\n type: \"video\";\n processing?: MediaProcessing | \"static\" | \"agentic\" | (string & {});\n };\n\n // Narrowed union of Content types with literal `type` discriminators.\n export type Content =\n | TextContent\n | ImageContent\n | AudioContent\n | DocumentContent\n | VideoContent;\n\n // =========================================================================\n // Narrowed Step types\n // =========================================================================\n\n // Narrowed from InteractionsNamespace.UserInputStep because\n // interactions-openapi.json uses `\"const\": \"user_input\"`, which sparktype outputs as `unknown`.\n export type UserInputStep = Omit<\n InteractionsNamespace.UserInputStep,\n \"type\" | \"content\"\n > & {\n type: \"user_input\";\n content?: Array<Content> | string;\n };\n\n // Narrowed from InteractionsNamespace.ModelOutputStep because\n // interactions-openapi.json uses `\"const\": \"model_output\"`, which sparktype outputs as `unknown`.\n export type ModelOutputStep = Omit<\n InteractionsNamespace.ModelOutputStep,\n \"type\" | \"content\"\n > & {\n type: \"model_output\";\n content?: Array<Content> | string;\n };\n\n // Narrowed from InteractionsNamespace.ThoughtStep because\n // interactions-openapi.json uses `\"const\": \"thought\"`, which sparktype outputs as `unknown`.\n export type ThoughtStep = Omit<\n InteractionsNamespace.ThoughtStep,\n \"type\" | \"summary\"\n > & {\n type: \"thought\";\n summary?: Array<Content>;\n };\n\n // Narrowed from InteractionsNamespace.FunctionCallStep because\n // interactions-openapi.json uses `\"const\": \"function_call\"`, which sparktype outputs as `unknown`.\n export type FunctionCallStep = Omit<\n InteractionsNamespace.FunctionCallStep,\n \"type\"\n > & {\n type: \"function_call\";\n };\n\n // Narrowed from InteractionsNamespace.FunctionResultStep because\n // interactions-openapi.json uses `\"const\": \"function_result\"`, which sparktype outputs as `unknown`.\n export type FunctionResultStep = Omit<\n InteractionsNamespace.FunctionResultStep,\n \"type\" | \"result\"\n > & {\n type: \"function_result\";\n result: Array<Content> | string | Record<string, unknown>;\n };\n\n // Narrowed from InteractionsNamespace.CodeExecutionCallStep because\n // interactions-openapi.json uses `\"const\": \"code_execution_call\"`, which sparktype outputs as `unknown`.\n export type CodeExecutionCallStep = Omit<\n InteractionsNamespace.CodeExecutionCallStep,\n \"type\"\n > & {\n type: \"code_execution_call\";\n };\n\n // Narrowed from InteractionsNamespace.CodeExecutionResultStep because\n // interactions-openapi.json uses `\"const\": \"code_execution_result\"`, which sparktype outputs as `unknown`.\n export type CodeExecutionResultStep = Omit<\n InteractionsNamespace.CodeExecutionResultStep,\n \"type\"\n > & {\n type: \"code_execution_result\";\n };\n\n // Narrowed from InteractionsNamespace.GoogleSearchCallStep because\n // interactions-openapi.json uses `\"const\": \"google_search_call\"`, which sparktype outputs as `unknown`.\n export type GoogleSearchCallStep = Omit<\n InteractionsNamespace.GoogleSearchCallStep,\n \"type\"\n > & {\n type: \"google_search_call\";\n };\n\n // Narrowed from InteractionsNamespace.GoogleSearchResultStep because\n // interactions-openapi.json uses `\"const\": \"google_search_result\"`, which sparktype outputs as `unknown`.\n export type GoogleSearchResultStep = Omit<\n InteractionsNamespace.GoogleSearchResultStep,\n \"type\"\n > & {\n type: \"google_search_result\";\n };\n\n // Narrowed from InteractionsNamespace.UrlContextCallStep because\n // interactions-openapi.json uses `\"const\": \"url_context_call\"`, which sparktype outputs as `unknown`.\n export type UrlContextCallStep = Omit<\n InteractionsNamespace.UrlContextCallStep,\n \"type\"\n > & {\n type: \"url_context_call\";\n };\n\n // Narrowed from InteractionsNamespace.UrlContextResultStep because\n // interactions-openapi.json uses `\"const\": \"url_context_result\"`, which sparktype outputs as `unknown`.\n export type UrlContextResultStep = Omit<\n InteractionsNamespace.UrlContextResultStep,\n \"type\"\n > & {\n type: \"url_context_result\";\n };\n\n // Narrowed from InteractionsNamespace.FileSearchCallStep because\n // interactions-openapi.json uses `\"const\": \"file_search_call\"`, which sparktype outputs as `unknown`.\n export type FileSearchCallStep = Omit<\n InteractionsNamespace.FileSearchCallStep,\n \"type\"\n > & {\n type: \"file_search_call\";\n };\n\n // Narrowed from InteractionsNamespace.FileSearchResultStep because\n // interactions-openapi.json uses `\"const\": \"file_search_result\"`, which sparktype outputs as `unknown`.\n export type FileSearchResultStep = Omit<\n InteractionsNamespace.FileSearchResultStep,\n \"type\"\n > & {\n type: \"file_search_result\";\n result?: Array<FileSearchResultItem>;\n };\n\n // Narrowed from InteractionsNamespace.GoogleMapsCallStep because\n // interactions-openapi.json uses `\"const\": \"google_maps_call\"`, which sparktype outputs as `unknown`.\n export type GoogleMapsCallStep = Omit<\n InteractionsNamespace.GoogleMapsCallStep,\n \"type\"\n > & {\n type: \"google_maps_call\";\n };\n\n // Narrowed from InteractionsNamespace.GoogleMapsResultStep because\n // interactions-openapi.json uses `\"const\": \"google_maps_result\"`, which sparktype outputs as `unknown`.\n export type GoogleMapsResultStep = Omit<\n InteractionsNamespace.GoogleMapsResultStep,\n \"type\"\n > & {\n type: \"google_maps_result\";\n };\n\n // Narrowed from InteractionsNamespace.McpServerToolCallStep because\n // interactions-openapi.json uses `\"const\": \"mcp_server_tool_call\"`, which sparktype outputs as `unknown`.\n export type McpServerToolCallStep = Omit<\n InteractionsNamespace.McpServerToolCallStep,\n \"type\"\n > & {\n type: \"mcp_server_tool_call\";\n };\n\n // Narrowed from InteractionsNamespace.McpServerToolResultStep because\n // interactions-openapi.json uses `\"const\": \"mcp_server_tool_result\"`, which sparktype outputs as `unknown`.\n export type McpServerToolResultStep = Omit<\n InteractionsNamespace.McpServerToolResultStep,\n \"type\" | \"result\"\n > & {\n type: \"mcp_server_tool_result\";\n result: Array<Content> | string | Record<string, unknown>;\n };\n\n // Narrowed from InteractionsNamespace.ProcessingCallStep because\n // interactions-openapi.json uses `\"const\": \"processing_call\"`, which sparktype outputs as `unknown`.\n export type ProcessingCallStep = Omit<\n InteractionsNamespace.ProcessingCallStep,\n \"type\"\n > & {\n type: \"processing_call\";\n };\n\n // Narrowed from InteractionsNamespace.ProcessingResultStep because\n // interactions-openapi.json uses `\"const\": \"processing_result\"`, which sparktype outputs as `unknown`.\n export type ProcessingResultStep = Omit<\n InteractionsNamespace.ProcessingResultStep,\n \"type\"\n > & {\n type: \"processing_result\";\n };\n\n // Narrowed from InteractionsNamespace.RetrievalCallStep because\n // interactions-openapi.json uses `\"const\": \"retrieval_call\"`, which sparktype outputs as `unknown`.\n export type RetrievalCallStep = Omit<\n InteractionsNamespace.RetrievalCallStep,\n \"type\"\n > & {\n type: \"retrieval_call\";\n };\n\n // Narrowed from InteractionsNamespace.RetrievalResultStep because\n // interactions-openapi.json uses `\"const\": \"retrieval_result\"`, which sparktype outputs as `unknown`.\n export type RetrievalResultStep = Omit<\n InteractionsNamespace.RetrievalResultStep,\n \"type\"\n > & {\n type: \"retrieval_result\";\n };\n\n // Narrowed union of Step types with literal `type` discriminators.\n export type Step =\n | UserInputStep\n | ModelOutputStep\n | ThoughtStep\n | FunctionCallStep\n | FunctionResultStep\n | CodeExecutionCallStep\n | CodeExecutionResultStep\n | GoogleSearchCallStep\n | GoogleSearchResultStep\n | UrlContextCallStep\n | UrlContextResultStep\n | FileSearchCallStep\n | FileSearchResultStep\n | GoogleMapsCallStep\n | GoogleMapsResultStep\n | McpServerToolCallStep\n | McpServerToolResultStep\n | ProcessingCallStep\n | ProcessingResultStep\n | RetrievalCallStep\n | RetrievalResultStep;\n\n // =========================================================================\n // Narrowed Tool types\n // =========================================================================\n\n // Narrowed from InteractionsNamespace.Tools.Function because\n // interactions-openapi.json uses `\"const\": \"function\"`, which sparktype outputs as `unknown`.\n export type Function = Omit<\n InteractionsNamespace.Tools.Function,\n \"type\"\n > & {\n type: \"function\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.GoogleSearch because\n // interactions-openapi.json uses `\"const\": \"google_search\"`, which sparktype outputs as `unknown`.\n export type GoogleSearch = Omit<\n InteractionsNamespace.Tools.GoogleSearch,\n \"type\"\n > & {\n type: \"google_search\";\n time_range_filter?: {\n start_time?: string;\n end_time?: string;\n };\n };\n\n // Narrowed from InteractionsNamespace.Tools.CodeExecution because\n // interactions-openapi.json uses `\"const\": \"code_execution\"`, which sparktype outputs as `unknown`.\n export type CodeExecution = Omit<\n InteractionsNamespace.Tools.CodeExecution,\n \"type\"\n > & {\n type: \"code_execution\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.UrlContext because\n // interactions-openapi.json uses `\"const\": \"url_context\"`, which sparktype outputs as `unknown`.\n export type UrlContext = Omit<\n InteractionsNamespace.Tools.UrlContext,\n \"type\"\n > & {\n type: \"url_context\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.ComputerUse because\n // interactions-openapi.json uses `\"const\": \"computer_use\"`, which sparktype outputs as `unknown`.\n export type ComputerUse = Omit<\n InteractionsNamespace.Tools.ComputerUse,\n \"type\"\n > & {\n type: \"computer_use\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.FileSearch because\n // interactions-openapi.json uses `\"const\": \"file_search\"`, which sparktype outputs as `unknown`.\n export type FileSearch = Omit<\n InteractionsNamespace.Tools.FileSearch,\n \"type\"\n > & {\n type: \"file_search\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.GoogleMaps because\n // interactions-openapi.json uses `\"const\": \"google_maps\"`, which sparktype outputs as `unknown`.\n export type GoogleMaps = Omit<\n InteractionsNamespace.Tools.GoogleMaps,\n \"type\"\n > & {\n type: \"google_maps\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.McpServer because\n // interactions-openapi.json uses `\"const\": \"mcp_server\"`, which sparktype outputs as `unknown`.\n export type McpServer = Omit<\n InteractionsNamespace.Tools.McpServer,\n \"type\"\n > & {\n type: \"mcp_server\";\n };\n\n // Narrowed from InteractionsNamespace.Tools.Retrieval because\n // interactions-openapi.json uses `\"const\": \"retrieval\"`, which sparktype outputs as `unknown`.\n export type Retrieval = Omit<\n InteractionsNamespace.Tools.Retrieval,\n \"type\"\n > & {\n type: \"retrieval\";\n };\n\n // Narrowed union of Tool types with literal `type` discriminators.\n export type Tool =\n | Function\n | GoogleSearch\n | CodeExecution\n | UrlContext\n | ComputerUse\n | FileSearch\n | GoogleMaps\n | McpServer\n | Retrieval;\n\n export namespace Tools {\n export type AllowedTools = InteractionsNamespace.Tools.AllowedTools;\n export type CodeExecution = Gemini.Interactions.CodeExecution;\n export type ComputerUse = Gemini.Interactions.ComputerUse;\n export type FileSearch = Gemini.Interactions.FileSearch;\n export type Function = Gemini.Interactions.Function;\n export type GoogleMaps = Gemini.Interactions.GoogleMaps;\n export type GoogleSearch = Gemini.Interactions.GoogleSearch;\n export type McpServer = Gemini.Interactions.McpServer;\n export type Retrieval = Gemini.Interactions.Retrieval;\n export type Tool = Gemini.Interactions.Tool;\n export type UrlContext = Gemini.Interactions.UrlContext;\n export type VertexAISearchConfig =\n InteractionsNamespace.Tools.VertexAISearchConfig;\n }\n\n // =========================================================================\n // Narrowed ResponseFormat types\n // =========================================================================\n\n // Narrowed from InteractionsNamespace.TextResponseFormat because\n // interactions-openapi.json uses `\"const\": \"text\"`, which sparktype outputs as `unknown`.\n export type TextResponseFormat = Omit<\n InteractionsNamespace.TextResponseFormat,\n \"type\"\n > & {\n type: \"text\";\n };\n\n // Narrowed from InteractionsNamespace.ImageResponseFormat because\n // interactions-openapi.json uses `\"const\": \"image\"`, which sparktype outputs as `unknown`.\n export type ImageResponseFormat = Omit<\n InteractionsNamespace.ImageResponseFormat,\n \"type\"\n > & {\n type: \"image\";\n };\n\n // Narrowed from InteractionsNamespace.AudioResponseFormat because\n // interactions-openapi.json uses `\"const\": \"audio\"`, which sparktype outputs as `unknown`.\n export type AudioResponseFormat = Omit<\n InteractionsNamespace.AudioResponseFormat,\n \"type\"\n > & {\n type: \"audio\";\n };\n\n // Narrowed from InteractionsNamespace.VideoResponseFormat because\n // interactions-openapi.json uses `\"const\": \"video\"`, which sparktype outputs as `unknown`.\n export type VideoResponseFormat = Omit<\n InteractionsNamespace.VideoResponseFormat,\n \"type\"\n > & {\n type: \"video\";\n mime_type?: string;\n };\n\n // Narrowed union of ResponseFormat types with literal `type` discriminators.\n export type ResponseFormat =\n | TextResponseFormat\n | ImageResponseFormat\n | AudioResponseFormat\n | VideoResponseFormat;\n\n // =========================================================================\n // Narrowed AgentConfig types\n // =========================================================================\n\n // Narrowed from InteractionsNamespace.AntigravityAgentConfig because\n // interactions-openapi.json uses `\"const\": \"antigravity\"`, which sparktype outputs as `unknown`.\n export type AntigravityAgentConfig = Omit<\n InteractionsNamespace.AntigravityAgentConfig,\n \"type\"\n > & {\n type: \"antigravity\";\n };\n\n // Narrowed from InteractionsNamespace.CodeMenderAgentConfig because\n // interactions-openapi.json uses `\"const\": \"code-mender\"`, which sparktype outputs as `unknown`.\n export type CodeMenderAgentConfig = Omit<\n InteractionsNamespace.CodeMenderAgentConfig,\n \"type\"\n > & {\n type: \"code-mender\";\n };\n\n // Narrowed from InteractionsNamespace.DeepResearchAgentConfig because\n // interactions-openapi.json uses `\"const\": \"deep-research\"`, which sparktype outputs as `unknown`.\n export type DeepResearchAgentConfig = Omit<\n InteractionsNamespace.DeepResearchAgentConfig,\n \"type\"\n > & {\n type: \"deep-research\";\n };\n\n // Narrowed from InteractionsNamespace.DynamicAgentConfig because\n // interactions-openapi.json uses `\"const\": \"dynamic\"`, which sparktype outputs as `unknown`.\n export type DynamicAgentConfig = Omit<\n InteractionsNamespace.DynamicAgentConfig,\n \"type\"\n > & {\n type: \"dynamic\";\n };\n\n // Narrowed union of AgentConfig types with literal `type` discriminators.\n export type AgentConfig =\n | AntigravityAgentConfig\n | CodeMenderAgentConfig\n | DeepResearchAgentConfig\n | DynamicAgentConfig;\n\n // =========================================================================\n // Narrowed Top-Level Request & Response Container types\n // =========================================================================\n\n // Request parameters for creating an Interaction (`POST /v1beta/interactions`).\n // Combines the writable request fields from Interaction\n // with narrowed `input`, `tools`, `response_format`, `generation_config`, and `agent_config` unions.\n export type CreateInteractionParameters = Omit<\n InteractionsNamespace.Interaction,\n | \"agent_config\"\n | \"created\"\n | \"environment_id\"\n | \"errors\"\n | \"generation_config\"\n | \"id\"\n | \"input\"\n | \"model\"\n | \"response_format\"\n | \"status\"\n | \"steps\"\n | \"tools\"\n | \"updated\"\n | \"usage\"\n > & {\n model?: InteractionsNamespace.ModelOption;\n agent?: InteractionsNamespace.AgentOption;\n agent_config?: AgentConfig;\n generation_config?: GenerationConfig;\n input: Array<Content> | Array<Step> | Content | Step | string;\n response_format?:\n | Record<string, unknown>\n | ResponseFormat\n | Array<ResponseFormat>;\n tools?: Array<Tool>;\n };\n\n // Narrowed from InteractionsNamespace.Interaction so nested\n // `steps`, `input`, `tools`, `response_format`, `generation_config`, and `agent_config` use the narrowed\n // discriminator unions above. Also includes optional legacy `outputs` and `role` fields.\n export type Interaction = Omit<\n InteractionsNamespace.Interaction,\n | \"agent_config\"\n | \"generation_config\"\n | \"input\"\n | \"model\"\n | \"response_format\"\n | \"steps\"\n | \"tools\"\n > & {\n model?: InteractionsNamespace.ModelOption;\n agent?: InteractionsNamespace.AgentOption;\n agent_config?: AgentConfig;\n generation_config?: GenerationConfig;\n input?: Array<Content> | Array<Step> | Content | Step | string;\n response_format?:\n | Record<string, unknown>\n | ResponseFormat\n | Array<ResponseFormat>;\n role?: string;\n steps?: Array<Step>;\n outputs?: Array<Step | Content>;\n tools?: Array<Tool>;\n };\n\n // =========================================================================\n // Re-exported non-discriminated types from `./api_types/interactions.ts`\n // =========================================================================\n export type AllowedTools = InteractionsNamespace.Tools.AllowedTools;\n export type CodeExecutionCallStepArguments =\n InteractionsNamespace.CodeExecutionCallStepArguments;\n export type Error = InteractionsNamespace.Status;\n export type Status = InteractionsNamespace.Status;\n export interface FileSearchResultItem {\n title?: string;\n text?: string;\n file_search_store?: string;\n }\n export type GenerationConfig = Omit<\n InteractionsNamespace.GenerationConfig,\n \"image_config\"\n > & {\n top_k?: number;\n presence_penalty?: number;\n frequency_penalty?: number;\n response_logprobs?: boolean;\n logprobs?: number;\n image_config?: InteractionsNamespace.ImageConfig & {\n type?: \"image\";\n };\n };\n export type GoogleMapsCallStepArguments =\n InteractionsNamespace.GoogleMapsCallStepArguments;\n export type GoogleMapsCallArguments =\n InteractionsNamespace.GoogleMapsCallStepArguments;\n export type GoogleMapsResultItem =\n InteractionsNamespace.GoogleMapsResultItem;\n export type GoogleMapsResult = InteractionsNamespace.GoogleMapsResultItem;\n export type GoogleMapsResultPlaces =\n InteractionsNamespace.GoogleMapsResultPlaces;\n export type GoogleSearchCallStepArguments =\n InteractionsNamespace.GoogleSearchCallStepArguments;\n export type GoogleSearchResultItem =\n InteractionsNamespace.GoogleSearchResultItem;\n export type HarmCategory = InteractionsNamespace.HarmCategory;\n export type MediaResolution = InteractionsNamespace.MediaResolution;\n export type ModalityTokens = InteractionsNamespace.ModalityTokens;\n export type Model = InteractionsNamespace.ModelOption;\n export type ModelOption = InteractionsNamespace.ModelOption;\n export type ResponseModality = InteractionsNamespace.ResponseModality;\n export type ReviewSnippet = InteractionsNamespace.ReviewSnippet;\n export type PlaceCitationReviewSnippet =\n InteractionsNamespace.ReviewSnippet;\n export type RetrievalStepArguments =\n InteractionsNamespace.RetrievalStepArguments;\n export type RetrievalCallArguments =\n InteractionsNamespace.RetrievalStepArguments;\n export type SafetySetting = InteractionsNamespace.SafetySetting;\n export type ServiceTier = InteractionsNamespace.ServiceTier;\n export type SpeakerConfig = InteractionsNamespace.SpeakerConfig;\n export type SpeechConfig = InteractionsNamespace.SpeechConfig;\n export type ThinkingLevel = InteractionsNamespace.ThinkingLevel;\n export type ToolChoiceType =\n | \"auto\"\n | \"any\"\n | \"none\"\n | \"validated\"\n | (string & {});\n export type ToolChoiceConfig = InteractionsNamespace.ToolChoiceConfig;\n export type ToolChoice = ToolChoiceType | ToolChoiceConfig;\n export type UrlContextCallStepArguments =\n InteractionsNamespace.UrlContextCallArguments;\n export type UrlContextCallArguments =\n InteractionsNamespace.UrlContextCallArguments;\n export type UrlContextResultItem = InteractionsNamespace.UrlContextResult;\n export type UrlContextResult = InteractionsNamespace.UrlContextResult;\n export type Usage = InteractionsNamespace.Usage;\n export type VertexAISearchConfig =\n InteractionsNamespace.Tools.VertexAISearchConfig;\n export type VertexAiSearchConfig =\n InteractionsNamespace.Tools.VertexAISearchConfig;\n export type WebhookConfig = InteractionsNamespace.WebhookConfig;\n\n // =========================================================================\n // SSE Stream Event & Delta types from `interactions-openapi.json`\n // Note: sparktype did not emit the SSE `text/event-stream` response union\n // schemas into `./api_types/interactions.ts`, so we define them here with\n // narrowed discriminator literals (supporting both OpenAPI `step.*` /\n // `interaction.created` / `interaction.completed` and legacy `content.*` /\n // `interaction.start` / `interaction.complete` aliases).\n // =========================================================================\n\n export type InteractionSseEventInteraction = Omit<\n Interaction,\n \"steps\" | \"outputs\"\n > & {\n steps?: Array<Step>;\n outputs?: Array<Step | Content>;\n };\n\n export interface TextDelta {\n type: \"text\";\n text: string;\n }\n\n export interface TextAnnotationDelta {\n type: \"text_annotation_delta\" | \"text_annotation\";\n annotations?: Array<Annotation>;\n }\n\n export interface ImageDelta {\n type: \"image\";\n data?: string;\n mime_type?: ImageContent[\"mime_type\"];\n resolution?: MediaResolution;\n uri?: string;\n }\n\n export interface AudioDelta {\n type: \"audio\";\n channels?: number;\n data?: string;\n mime_type?: AudioContent[\"mime_type\"];\n rate?: number;\n sample_rate?: number;\n uri?: string;\n }\n\n export interface DocumentDelta {\n type: \"document\";\n data?: string;\n mime_type?: DocumentContent[\"mime_type\"];\n uri?: string;\n }\n\n export interface VideoDelta {\n type: \"video\";\n data?: string;\n mime_type?: VideoContent[\"mime_type\"];\n resolution?: MediaResolution;\n uri?: string;\n }\n\n export interface ThoughtSummaryDelta {\n type: \"thought_summary\";\n content?: Content;\n }\n\n export interface ThoughtSignatureDelta {\n type: \"thought_signature\";\n signature?: string;\n }\n\n export interface ArgumentsDelta {\n type: \"arguments_delta\" | \"function_call\";\n id?: string;\n name?: string;\n arguments?: string | Record<string, unknown>;\n }\n\n export interface CodeExecutionCallDelta {\n type: \"code_execution_call\";\n id?: string;\n arguments?: CodeExecutionCallStepArguments;\n signature?: string;\n }\n\n export interface CodeExecutionResultDelta {\n type: \"code_execution_result\";\n call_id?: string;\n is_error?: boolean;\n result?: string;\n signature?: string;\n }\n\n export interface GoogleSearchCallDelta {\n type: \"google_search_call\";\n id?: string;\n arguments?: GoogleSearchCallStepArguments;\n signature?: string;\n }\n\n export interface GoogleSearchResultDelta {\n type: \"google_search_result\";\n call_id?: string;\n is_error?: boolean;\n result?: Array<\n GoogleSearchResultItem & {\n title?: string;\n url?: string;\n rendered_content?: string;\n }\n >;\n signature?: string;\n }\n\n export interface UrlContextCallDelta {\n type: \"url_context_call\";\n id?: string;\n arguments?: UrlContextCallArguments;\n signature?: string;\n }\n\n export interface UrlContextResultDelta {\n type: \"url_context_result\";\n call_id?: string;\n is_error?: boolean;\n result?: Array<UrlContextResult>;\n signature?: string;\n }\n\n export interface FileSearchCallDelta {\n type: \"file_search_call\";\n id?: string;\n signature?: string;\n }\n\n export interface FileSearchResultDelta {\n type: \"file_search_result\";\n call_id?: string;\n result?: Array<FileSearchResultItem>;\n signature?: string;\n }\n\n export interface GoogleMapsCallDelta {\n type: \"google_maps_call\";\n id?: string;\n arguments?: GoogleMapsCallArguments;\n signature?: string;\n }\n\n export interface GoogleMapsResultDelta {\n type: \"google_maps_result\";\n call_id?: string;\n result?: Array<GoogleMapsResult>;\n signature?: string;\n }\n\n export interface McpServerToolCallDelta {\n type: \"mcp_server_tool_call\";\n id?: string;\n name?: string;\n server_name?: string;\n arguments?: string | Record<string, unknown>;\n signature?: string;\n }\n\n export interface McpServerToolResultDelta {\n type: \"mcp_server_tool_result\";\n call_id?: string;\n name?: string;\n server_name?: string;\n result?: Array<Content> | string | Record<string, unknown>;\n signature?: string;\n }\n\n export interface ProcessingCallDelta {\n type: \"processing_call\";\n id?: string;\n signature?: string;\n }\n\n export interface ProcessingResultDelta {\n type: \"processing_result\";\n call_id?: string;\n signature?: string;\n }\n\n export interface RetrievalCallDelta {\n type: \"retrieval_call\";\n id?: string;\n arguments?: RetrievalCallArguments;\n retrieval_type?: RetrievalCallStep[\"retrieval_type\"];\n signature?: string;\n }\n\n export interface RetrievalResultDelta {\n type: \"retrieval_result\";\n call_id?: string;\n is_error?: boolean;\n signature?: string;\n }\n\n export type StepDeltaData =\n | TextDelta\n | TextAnnotationDelta\n | ImageDelta\n | AudioDelta\n | DocumentDelta\n | VideoDelta\n | ThoughtSummaryDelta\n | ThoughtSignatureDelta\n | ArgumentsDelta\n | CodeExecutionCallDelta\n | CodeExecutionResultDelta\n | GoogleSearchCallDelta\n | GoogleSearchResultDelta\n | UrlContextCallDelta\n | UrlContextResultDelta\n | FileSearchCallDelta\n | FileSearchResultDelta\n | GoogleMapsCallDelta\n | GoogleMapsResultDelta\n | McpServerToolCallDelta\n | McpServerToolResultDelta\n | ProcessingCallDelta\n | ProcessingResultDelta\n | RetrievalCallDelta\n | RetrievalResultDelta;\n\n export interface InteractionCreatedEvent {\n event_id?: string;\n event_type: \"interaction.created\" | \"interaction.start\";\n interaction: InteractionSseEventInteraction;\n }\n\n export interface InteractionCompletedEvent {\n event_id?: string;\n event_type: \"interaction.completed\" | \"interaction.complete\";\n interaction: InteractionSseEventInteraction;\n }\n\n export interface InteractionStatusUpdate {\n continuation_token?: string;\n event_id?: string;\n event_type: \"interaction.status_update\";\n interaction_id: string;\n status: Interaction[\"status\"];\n usage?: Usage;\n }\n\n export interface StepStart {\n event_id?: string;\n event_type: \"step.start\" | \"content.start\";\n index: number;\n step?: Step;\n content?: Step | Content;\n }\n\n export interface StepDelta {\n delta: StepDeltaData;\n event_id?: string;\n event_type: \"step.delta\" | \"content.delta\";\n index: number;\n metadata?: {\n total_usage?: Usage;\n };\n }\n\n export interface StepStop {\n event_id?: string;\n event_type: \"step.stop\" | \"content.stop\";\n index: number;\n step_usage?: Usage;\n usage?: Usage;\n }\n\n export interface ErrorEvent {\n error?: Error;\n event_id?: string;\n event_type: \"error\";\n }\n\n export type InteractionSseEvent =\n | InteractionCreatedEvent\n | InteractionCompletedEvent\n | InteractionStatusUpdate\n | StepStart\n | StepDelta\n | StepStop\n | ErrorEvent;\n }\n}\n\nexport type {\n GenContentNamespace as GenContent,\n InteractionsNamespace as Interactions,\n};\n\n/**\n * Simplified speaker/name pair for multi-speaker config.\n * - `speaker` derived from SpeakerVoiceConfig[\"speaker\"]\n * - `name` is the prebuilt voice name\n */\nexport interface SpeechSpeakerName {\n speaker: Gemini.GenContent.SpeakerVoiceConfig.Speaker;\n name: Gemini.GenContent.PrebuiltVoiceConfig.VoiceName;\n}\n\n/** A voice can be a prebuilt voice name, a speaker/name pair, or an array of pairs */\nexport type SpeechVoice =\n | Gemini.GenContent.PrebuiltVoiceConfig.VoiceName\n | SpeechSpeakerName\n | SpeechSpeakerName[];\n\n/** Voice with language code (derived from SpeechConfig's languageCode) */\nexport interface SpeechVoiceLanguage {\n voice: SpeechVoice;\n languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;\n}\n\n/** Voices with language code */\nexport interface SpeechVoicesLanguage {\n voices: SpeechVoice;\n languageCode: Gemini.GenContent.SpeechConfig.LanguageCode;\n}\n\n/** Simplified language config (with voice or voices) */\nexport type SimplifiedSpeechLanguageConfig =\n | SpeechVoiceLanguage\n | SpeechVoicesLanguage;\n\n/** Top-level simplified config: just a voice, or voice+language */\nexport type SimplifiedSpeechConfig =\n | SpeechVoice\n | SimplifiedSpeechLanguageConfig;\n"],"mappings":";AAgVA,MAAa,sBAAyD,CACpE,QACA,UACF"}
@@ -1,9 +1,9 @@
1
1
  const require_const = require("../const.cjs");
2
- const require_misc = require("../utils/misc.cjs");
3
- const require_errors = require("../utils/errors.cjs");
4
2
  const require_gcp_auth = require("../utils/gcp-auth.cjs");
3
+ const require_errors = require("../utils/errors.cjs");
4
+ const require_misc = require("../utils/misc.cjs");
5
5
  let _langchain_core_utils_env = require("@langchain/core/utils/env");
6
- //#region src/clients/index.ts
6
+ // src/clients/index.ts
7
7
  /**
8
8
  * Abstract base class for API clients that interact with Google services.
9
9
  *
@@ -210,7 +210,6 @@ var WebApiClient = class extends ApiClient {
210
210
  return fetch(request);
211
211
  }
212
212
  };
213
- //#endregion
214
213
  exports.ApiClient = ApiClient;
215
214
  exports.WebApiClient = WebApiClient;
216
215
 
@@ -1,4 +1,3 @@
1
- //#region src/clients/index.d.ts
2
1
  /**
3
2
  * Abstract base class for API clients that interact with Google services.
4
3
  *
@@ -44,5 +43,4 @@ export declare abstract class ApiClient {
44
43
  */
45
44
  abstract fetch(request: Request): Promise<Response>;
46
45
  }
47
- //#endregion
48
46
  //# sourceMappingURL=index.d.cts.map
@@ -1,4 +1,3 @@
1
- //#region src/clients/index.d.ts
2
1
  /**
3
2
  * Abstract base class for API clients that interact with Google services.
4
3
  *
@@ -44,5 +43,4 @@ export declare abstract class ApiClient {
44
43
  */
45
44
  abstract fetch(request: Request): Promise<Response>;
46
45
  }
47
- //#endregion
48
46
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
1
  import { GCP_API_KEY_HEADER, GOOGLE_API_KEY_HEADER } from "../const.js";
2
- import { iife } from "../utils/misc.js";
3
- import { AuthError } from "../utils/errors.js";
4
2
  import { getGCPCredentialsAccessToken, normalizeGCPCredentials } from "../utils/gcp-auth.js";
3
+ import { AuthError } from "../utils/errors.js";
4
+ import { iife } from "../utils/misc.js";
5
5
  import { getEnvironmentVariable } from "@langchain/core/utils/env";
6
- //#region src/clients/index.ts
6
+ // src/clients/index.ts
7
7
  /**
8
8
  * Abstract base class for API clients that interact with Google services.
9
9
  *
@@ -210,7 +210,6 @@ var WebApiClient = class extends ApiClient {
210
210
  return fetch(request);
211
211
  }
212
212
  };
213
- //#endregion
214
213
  export { ApiClient, WebApiClient };
215
214
 
216
215
  //# sourceMappingURL=index.js.map
@@ -1,11 +1,11 @@
1
1
  const require_const = require("../const.cjs");
2
- const require_misc = require("../utils/misc.cjs");
3
- const require_errors = require("../utils/errors.cjs");
4
- const require_gcp_auth = require("../utils/gcp-auth.cjs");
5
2
  const require_index = require("./index.cjs");
3
+ const require_gcp_auth = require("../utils/gcp-auth.cjs");
4
+ const require_errors = require("../utils/errors.cjs");
5
+ const require_misc = require("../utils/misc.cjs");
6
6
  let _langchain_core_utils_env = require("@langchain/core/utils/env");
7
7
  let google_auth_library = require("google-auth-library");
8
- //#region src/clients/node.ts
8
+ // src/clients/node.ts
9
9
  /**
10
10
  * Node.js-specific API client for Google services.
11
11
  *
@@ -331,7 +331,6 @@ function ensureAuthScopes(authOptions, requiredScopes) {
331
331
  }
332
332
  return authOptions;
333
333
  }
334
- //#endregion
335
334
  exports.NodeApiClient = NodeApiClient;
336
335
  exports.ensureAuthScopes = ensureAuthScopes;
337
336
 
@@ -1,6 +1,5 @@
1
1
  import { GCPCredentials } from "../utils/gcp-auth.cjs";
2
2
  import { GoogleAuthOptions } from "google-auth-library";
3
- //#region src/clients/node.d.ts
4
3
  /**
5
4
  * Configuration parameters for the NodeApiClient.
6
5
  *
@@ -52,5 +51,4 @@ export interface NodeApiClientParams {
52
51
  */
53
52
  googleAuthOptions?: GoogleAuthOptions;
54
53
  }
55
- //#endregion
56
54
  //# sourceMappingURL=node.d.cts.map
@@ -1,6 +1,5 @@
1
1
  import { GCPCredentials } from "../utils/gcp-auth.js";
2
2
  import { GoogleAuth, GoogleAuthOptions } from "google-auth-library";
3
- //#region src/clients/node.d.ts
4
3
  /**
5
4
  * Configuration parameters for the NodeApiClient.
6
5
  *
@@ -52,5 +51,4 @@ export interface NodeApiClientParams {
52
51
  */
53
52
  googleAuthOptions?: GoogleAuthOptions;
54
53
  }
55
- //#endregion
56
54
  //# sourceMappingURL=node.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { GCP_API_KEY_HEADER, GOOGLE_API_KEY_HEADER, VERTEX_AI_AUTH_SCOPES } from "../const.js";
2
- import { iife } from "../utils/misc.js";
3
- import { ConfigurationError } from "../utils/errors.js";
4
- import { getGCPCredentialsAccessToken, normalizeGCPCredentials } from "../utils/gcp-auth.js";
5
2
  import { ApiClient } from "./index.js";
3
+ import { getGCPCredentialsAccessToken, normalizeGCPCredentials } from "../utils/gcp-auth.js";
4
+ import { ConfigurationError } from "../utils/errors.js";
5
+ import { iife } from "../utils/misc.js";
6
6
  import { getEnvironmentVariable } from "@langchain/core/utils/env";
7
7
  import { GoogleAuth } from "google-auth-library";
8
- //#region src/clients/node.ts
8
+ // src/clients/node.ts
9
9
  /**
10
10
  * Node.js-specific API client for Google services.
11
11
  *
@@ -331,7 +331,6 @@ function ensureAuthScopes(authOptions, requiredScopes) {
331
331
  }
332
332
  return authOptions;
333
333
  }
334
- //#endregion
335
334
  export { NodeApiClient, ensureAuthScopes };
336
335
 
337
336
  //# sourceMappingURL=node.js.map
package/dist/const.cjs CHANGED
@@ -1,9 +1,8 @@
1
- //#region src/const.ts
1
+ // src/const.ts
2
2
  const GOOGLE_API_KEY_HEADER = "x-goog-api-key";
3
3
  const GCP_API_KEY_HEADER = "Authorization";
4
4
  const GENERATIVE_AI_AUTH_SCOPES = ["https://www.googleapis.com/auth/generative-language"];
5
5
  const VERTEX_AI_AUTH_SCOPES = ["https://www.googleapis.com/auth/cloud-platform"];
6
- //#endregion
7
6
  exports.GCP_API_KEY_HEADER = GCP_API_KEY_HEADER;
8
7
  exports.GENERATIVE_AI_AUTH_SCOPES = GENERATIVE_AI_AUTH_SCOPES;
9
8
  exports.GOOGLE_API_KEY_HEADER = GOOGLE_API_KEY_HEADER;
package/dist/const.js CHANGED
@@ -1,9 +1,8 @@
1
- //#region src/const.ts
1
+ // src/const.ts
2
2
  const GOOGLE_API_KEY_HEADER = "x-goog-api-key";
3
3
  const GCP_API_KEY_HEADER = "Authorization";
4
4
  const GENERATIVE_AI_AUTH_SCOPES = ["https://www.googleapis.com/auth/generative-language"];
5
5
  const VERTEX_AI_AUTH_SCOPES = ["https://www.googleapis.com/auth/cloud-platform"];
6
- //#endregion
7
6
  export { GCP_API_KEY_HEADER, GENERATIVE_AI_AUTH_SCOPES, GOOGLE_API_KEY_HEADER, VERTEX_AI_AUTH_SCOPES };
8
7
 
9
8
  //# sourceMappingURL=const.js.map
@@ -2,7 +2,7 @@ const require_misc = require("../../utils/misc.cjs");
2
2
  const require_errors = require("../../utils/errors.cjs");
3
3
  let _langchain_core_messages = require("@langchain/core/messages");
4
4
  let _langchain_core_utils_uuid = require("@langchain/core/utils/uuid");
5
- //#region src/converters/generate_content/messages.ts
5
+ // src/converters/generate_content/messages.ts
6
6
  /**
7
7
  * Standard content block converter for Google Gemini API.
8
8
  * Converts deprecated Data content blocks to Gemini Part format.
@@ -393,6 +393,7 @@ function convertLegacyContentMessageToGeminiContent(message, messages) {
393
393
  if (typeof message.content === "string") {
394
394
  if (message.content.trim()) parts.push({ text: message.content });
395
395
  } else if (Array.isArray(message.content)) for (const item of message.content) {
396
+ if (typeof item === "object" && item?.type === "refusal") continue;
396
397
  const part = convertLegacyPartToGeminiPart(item);
397
398
  parts.push(part);
398
399
  }
@@ -773,7 +774,6 @@ const convertGeminiGenerateContentResponseToUsageMetadata = (data) => {
773
774
  output_token_details
774
775
  };
775
776
  };
776
- //#endregion
777
777
  exports.convertAIMessageToText = convertAIMessageToText;
778
778
  exports.convertGeminiCandidateToAIMessage = convertGeminiCandidateToAIMessage;
779
779
  exports.convertGeminiGenerateContentResponseToUsageMetadata = convertGeminiGenerateContentResponseToUsageMetadata;