Support editing the last prompt with full input options (Text, Media & Audio) in ChatSession

オープン
#2,833 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Venkaiahbabuneelam がすでに取り組んでいます。

2026年8月10日 から。

  • #2898 @medisean による — マージされずにクローズ

評価

この issue はまだ評価されていません。

説明

priority: p3 type: feature request
Problem Statement

When editing the last sent prompt in a chat flow, the interface should support all input modes present in the main prompt bar, specifically media attachments (photos/files) and microphone/voice dictation.

Currently, users can only edit text strings, requiring them to delete or rewrite messages from scratch if they forget to attach a photo or want to correct a prompt using voice input.

Proposed Solution

In python-genai, ChatSession should provide a native method to update the last prompt with text, media, or audio/voice inputs and regenerate the response.

Example API Usage
chat = client.chats.create(model="gemini-2.5-flash")
chat.send_message("Initial text prompt")

# Easily update the last prompt with full input options
chat.update_last_prompt(
    text="Updated prompt text",
    image=pil_image,     # Support for photos/files
    audio=audio_bytes    # Support for voice/dictation
)
response = chat.regenerate_last_turn()
主要言語
Python
スター
4.1k
フォーク
1.1k
平均マージ
1日 21時間
マージ済み PR(30日)
103

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleapis/python-genai のほかの issue

googleapis/python-genai の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。