Skip to content

[Feature]: New AI Studio wire capabilities (Google Lens grounding, transparent PNG background, GenerateContent videoConfig, Build Live parity) #365

Not planned

Description

@lawrancehoy-cyber

想要什么,用来做什么 / What you want and what for

想要什么,用来做什么 / What you want and what for

Protocol-level capabilities present in current AI Studio web bundles (m_b.js / YUh4Se.js) and live v0.3.17 traffic that are not yet wired in AIStudio2API:

  1. Grounding with Google Lens (SearchTypes field 3, capability 97, tool ID 10)

    • In m_b.js (@556174, @1581538) and YUh4Se.js (ZCf):
      • ListModels capability code 97 enables Grounding with Google Lens; field 48 toolNames code 10 maps to Google Lens (currently internal/aistudio/models.go:497 maps 1,2,3,5,6,7,8 and omits 10).
      • GoogleSearch (_.en) -> SearchTypes (_.Gv, field 2 / index 1) has 3 entries:
        • field 1 (index 0): webSearch (y_a)
        • field 2 (index 1): imageSearch (z_a)
        • field 3 (index 2): lensSearch (A_a: []) — currently internal/aistudio/tools.go:152-169 (encodeSearchTool) only encodes indices 0 and 1.
  2. Native Transparent / Opaque PNG Background Generation (capability 102)

    • In m_b.js (iQb @1583176 & TIa @319114):
      • GenerateContent ImageConfig (_.xYa, GenerationConfig field 27 / index 26):
        • field 1 (index 0): aspectRatio
        • field 2 (index 1): imageSize
        • field 3 (index 2): background enum (1 = auto, 2 = transparent, 3 = opaque) — gated by capability_code_102.
      • Interactions (CreateInteraction / CreateInteractionStream): outputFormat (interaction field 54/55, _.Eq field 3 / index 2) -> _.QIa field 6 (index 5): 1 = auto, 2 = transparent, 3 = opaque.
    • Currently internal/aistudio/generate.go:467 (encodeImageConfig), internal/aistudio/interaction.go:327, and internal/api/media.go:34 (openAIImageRequest for /v1/images/generations & /v1/images/edits, which has standard OpenAI background: "transparent" | "opaque" | "auto") do not encode or expose background.
  3. GenerateContent VideoConfig (GenerationConfig field 28 / index 27, _.IYa)

    • In m_b.js (iQb @1583176): for models with secondary_capability_code_14 && secondary_capability_code_17, GenerationConfig field 28 (index 27, WYa) encodes _.IYa:
      • field 5 (index 4): fps (1 = "24fps")
      • field 6 (index 5): aspectRatio (string)
      • field 7 (index 6): duration (google.protobuf.Duration [seconds])
      • field 8 (index 7): resolution (1 = "368p", 2 = "720p")
    • Currently encodeGenerationConfig (internal/aistudio/generate.go:270-355) leaves wire[27] empty.
  4. Build-channel Live (build_bidi.go), multimodal clientContent.turns, and Live message[8] frame

    • EncodeBuildBidiSetup (internal/aistudio/build_bidi.go:70-110) hardcodes bidiVariantConversation and fallback "Zephyr", omitting DefaultVoice, ProactiveAudio/Video, AffectiveDialog, TurnCoverage, Translation, Transcription, and custom voice_/voicekey_ voices; liveFrame (build_bidi.go:173) also blocks client_content and context_update on Build Live even though proxy:proxyBidiStreamedCall forwards official Gemini Live JSON directly.
    • geminiLiveTexts (internal/api/live_gemini.go:336-348) rejects non-text (inlineData) parts in clientContent.turns, whereas YUh4Se.js (hpi / _.GMc / EMc) supports multimodal Content turns bound via parts.map(_.$n).join(" ").
    • In live v0.3.17 sessions (gemini-4-live & gemini-3.1-flash-live-preview), upstream WebChannel emits [null,null,null,null,null,null,null,null,["1"]] / ["2"] (message[8], field 9) on every turn, which currently falls into raw provider on /v1/live.
  5. (Reference — Interactive Video / Genie 4 transport in YUh4Se.js)

    • Uses either MakerSuiteService/StartInteractiveVideoWebRtcSession (_.ckb) or WebChannel /v1/interactiveVideoBidiStream (useFetchStreams: true, Api oneof [1=setup(zpi: [model, prompt, refImageBlob]), 2=text, 3=keyDown, 5=keyUp], WAA binding $oi).

版本 / Version

v0.3.17 (5deae85)

Activity

  1. github-actions commented on Dec 3, 2026

    @github-actions

    每人最多同时打开 3 个 Issue,这个 Issue 已自动关闭。请等已有的 Issue 处理完再提,或把内容补充到已有的 Issue 里。

    Each user can have at most 3 open issues at a time, so this one was closed automatically. Please wait until your existing issues are resolved, or add this to one of them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions