[PR #215] feat: add temporary single-call mode #219

Open
opened 2026-02-13 17:28:07 -06:00 by mirrors · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/HanaokaYuzu/Gemini-API/pull/215
Author: @JidaDiao
Created: 1/19/2026
Status: 🔄 Open

Base: masterHead: 002-add-temporary-chat


📝 Commits (8)

  • 04eb796 feat: add temporary chat mode support
  • 820b427 chore: add temporary chat demo script
  • 8552500 test: use local src import in temporary chat tests
  • 8cee2b4 test: exercise temporary chat integration flow
  • be91649 chore: remove temporary chat demo script
  • 3442e34 test: bootstrap src imports for tests
  • 0317e41 test: assert temporary responses lack metadata
  • 814febf test: validate temporary request flag

📊 Changes

5 files changed (+196 additions, -50 deletions)

View changed files

📝 src/gemini_webapi/client.py (+121 -50)
📝 src/gemini_webapi/constants.py (+2 -0)
📝 src/gemini_webapi/exceptions.py (+8 -0)
tests/__init__.py (+8 -0)
tests/test_temporary_chat.py (+57 -0)

📄 Description

Why

Some API-driven apps only need stateless, single-turn requests. This adds a temporary mode to reduce the number of web UI history records (avoid junk chat entries) while keeping one-off calls simple.

What

  • Add temporary flag to generate_content and mark the request payload
  • Reject temporary in ChatSession (single-call only)
  • Add TemporaryChatNotSupported and TEMPORARY_CHAT_FLAG_INDEX
  • Add/adjust tests for temporary single-call flow and request flag
  • Bootstrap tests to import local src (avoid installed package drift)

Limitations

  • Temporary mode is single-call only; multi-turn chat is not supported.

Tests

  • python -m unittest tests/test_temporary_chat.py

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/HanaokaYuzu/Gemini-API/pull/215 **Author:** [@JidaDiao](https://github.com/JidaDiao) **Created:** 1/19/2026 **Status:** 🔄 Open **Base:** `master` ← **Head:** `002-add-temporary-chat` --- ### 📝 Commits (8) - [`04eb796`](https://github.com/HanaokaYuzu/Gemini-API/commit/04eb796f4090bbbbb94ae965855537a425badaac) feat: add temporary chat mode support - [`820b427`](https://github.com/HanaokaYuzu/Gemini-API/commit/820b4270d22fc34ea77dec96599e97ffe54bf84a) chore: add temporary chat demo script - [`8552500`](https://github.com/HanaokaYuzu/Gemini-API/commit/8552500d55eda0e1f91407170af10ee09f2c0de6) test: use local src import in temporary chat tests - [`8cee2b4`](https://github.com/HanaokaYuzu/Gemini-API/commit/8cee2b417f9cbda0a3df9f56fc57b645210065de) test: exercise temporary chat integration flow - [`be91649`](https://github.com/HanaokaYuzu/Gemini-API/commit/be9164962be58520a77482f82cff0e7d5f7c8c67) chore: remove temporary chat demo script - [`3442e34`](https://github.com/HanaokaYuzu/Gemini-API/commit/3442e3460102468c1f7597228148c61d7b8e1677) test: bootstrap src imports for tests - [`0317e41`](https://github.com/HanaokaYuzu/Gemini-API/commit/0317e414d565f115f64556f2ed382f82ef7dba75) test: assert temporary responses lack metadata - [`814febf`](https://github.com/HanaokaYuzu/Gemini-API/commit/814febff40286ce63498b1f7fe593041591ebfb1) test: validate temporary request flag ### 📊 Changes **5 files changed** (+196 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `src/gemini_webapi/client.py` (+121 -50) 📝 `src/gemini_webapi/constants.py` (+2 -0) 📝 `src/gemini_webapi/exceptions.py` (+8 -0) ➕ `tests/__init__.py` (+8 -0) ➕ `tests/test_temporary_chat.py` (+57 -0) </details> ### 📄 Description ## Why Some API-driven apps only need stateless, single-turn requests. This adds a temporary mode to reduce the number of web UI history records (avoid junk chat entries) while keeping one-off calls simple. ## What - Add `temporary` flag to `generate_content` and mark the request payload - Reject `temporary` in `ChatSession` (single-call only) - Add `TemporaryChatNotSupported` and `TEMPORARY_CHAT_FLAG_INDEX` - Add/adjust tests for temporary single-call flow and request flag - Bootstrap `tests` to import local `src` (avoid installed package drift) ## Limitations - Temporary mode is single-call only; multi-turn chat is not supported. ## Tests - `python -m unittest tests/test_temporary_chat.py` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mirrors/Gemini-API#219
No description provided.