Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat(live): add proactivity flags and decode new ListModels capabilities #355

Done

Description

@lawrancehoy-cyber

发生了什么 / What happened

改动 / Changes

  • internal/aistudio/types.go, internal/aistudio/models.go:
    • Add DefaultVoice (field 87 / row[86][3]) and MaxSessionDurationMinutes (field 89 / row[88][0]) to Model and decode them in decodeModel.
    • Map new ListModels capability enum codes observed in AI Studio (39 affective_dialog, 40 proactive_audio, 57 no_text_input, 66 live_mic, 67 live_camera, 68 live_screen, 72 proactive_video, 93 custom_voices, 94 turn_coverage, 100 context_update_instructions, 101 context_update_tools).
  • internal/aistudio/bidi.go, internal/aistudio/webchannel.go, internal/api/live.go:
    • Add optional ProactiveAudio, ProactiveVideo, EnableAffectiveDialog, and TurnCoverageAll options to BidiSetupRequest and liveSessionStartPayload.
    • Encode setup[5] (ProactivityConfig [proactiveAudio, proactiveVideo]), setup[11] (enableAffectiveDialog), and configuration[19] (realtimeInputConfig [null, null, null, 1] for TURN_COVERAGE_ALL).
    • Fall back to the model's DefaultVoice from ListModels when starting a live session without an explicit voice (for non-translation models).
  • internal/aistudio/bidi_proactivity_test.go: add unit tests covering proactivity/affective-dialog/turn-coverage encoding and ListModels capability + DefaultVoice/MaxSessionDurationMinutes decoding.

验证 / Verification

  • Ran go test -mod=readonly -trimpath ./internal/aistudio/... ./internal/api/... — all tests pass (internal/aistudio 0.049s, internal/api 0.092s).
  • Ran go vet -mod=readonly ./internal/aistudio/... ./internal/api/... — passed with no issues.

  • 修改涉及的所有代码均在本地实际跑通过,没有只靠肉眼检查
  • 所有新增或修改的逻辑均有对应的测试覆盖
  • 已阅读并理解仓库的整体结构,没有破坏现有架构或引入重复实现

版本 / Version

v0.3.16 (3a85bde)

Activity

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