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

Offen
#2,833 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@Venkaiahbabuneelam arbeitet bereits daran.

Seit 10.8.2026.

  • #2898 von @medisean — ohne Merge geschlossen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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()
Vorherrschende Sprache
Python
Sterne
4.1k
Forks
1.1k
Ø Merge
1 T. 21 Std.
Gemergte PRs (30 T.)
103

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus googleapis/python-genai

Alle Issues in googleapis/python-genai

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.