fix(voice): prefer concise complete answers by default

This commit is contained in:
amirhosein mazaheri
2026-10-14 12:34:36 +03:30
parent 1f7c2bd195
commit d7b6d24465
4 changed files with 26 additions and 8 deletions
+12 -3
View File
@@ -1,10 +1,19 @@
"""Fixed OpenAI delivery revision; no document facts or unreviewed examples.""" """Fixed OpenAI delivery revision; no document facts or unreviewed examples."""
from hashlib import sha256 from hashlib import sha256
STYLE_REVISION = 'iranian-persian-conversational-v6' STYLE_REVISION = 'iranian-persian-conversational-v7'
STYLE = """Delivery style (subordinate to the grounding policy above): STYLE = """Delivery style (subordinate to the grounding policy above):
Answer the specific question directly. For a simple factual question, use one or Give the requested fact or answer in the first sentence. Default to the shortest
two short complete sentences. Call evidence tools silently. If an acknowledgement is needed, say only «یه لحظه…» complete answer: one or two short sentences for a simple factual question, and a
few short sentences for a multi-part question. Answer all requested parts.
Do not restate the question, introduce your answer, repeat evidence disclaimers,
list unrelated services, or end every answer with an invitation to ask more.
For hours, state the days and times plus any material exception. For a person,
state the supported name and exact role/organization; if ambiguous, ask one
focused clarification instead of changing the role. For eligibility, retain
all conditions and exclusions needed for the user's case.
When the user explicitly asks for a full explanation, steps or detail, provide
the necessary detail; brevity is a default, not a fixed sentence or token cap. Call evidence tools silently. If an acknowledgement is needed, say only «یه لحظه…»
once per user turn; do not describe reviewing documents. Add explanations or further detail only when the user asks once per user turn; do not describe reviewing documents. Add explanations or further detail only when the user asks
or when they are necessary to interpret the answer correctly. or when they are necessary to interpret the answer correctly.
Preserve necessary numbers, conditions, exceptions and negation; Preserve necessary numbers, conditions, exceptions and negation;
+1 -1
View File
@@ -5,7 +5,7 @@ services:
extends: extends:
file: docker-compose.yml file: docker-compose.yml
service: api service: api
image: rag-api-model-switch:20261014 image: rag-api-brief-answers:20261014
container_name: rag-api-mini container_name: rag-api-mini
environment: environment:
OPENAI_REALTIME_MODEL: gpt-realtime-2.1-mini OPENAI_REALTIME_MODEL: gpt-realtime-2.1-mini
+11 -2
View File
@@ -1,7 +1,7 @@
# Isolated OpenAI Mini candidate and rollback # Isolated OpenAI Mini candidate and rollback
The original rag-api container is retained, with its image, environment and mounts. The original rag-api container is retained, with its image, environment and mounts.
The candidate rag-api-mini uses the separately built rag-api-model-switch:20261014 The candidate rag-api-mini uses the separately built rag-api-brief-answers:20261014
image and changes only OPENAI_REALTIME_MODEL to gpt-realtime-2.1-mini via image and changes only OPENAI_REALTIME_MODEL to gpt-realtime-2.1-mini via
docker-compose.voice-candidate.yml. Local .env remains the original profile. docker-compose.voice-candidate.yml. Local .env remains the original profile.
The old image is also tagged rag-api-rollback:20261014. The old image is also tagged rag-api-rollback:20261014.
@@ -15,7 +15,7 @@ session. Do not run compose down, container rm, or image pruning for this workfl
Build the candidate without replacing the current container: Build the candidate without replacing the current container:
```powershell ```powershell
docker build -t rag-api-model-switch:20261014 . docker build -t rag-api-brief-answers:20261014 .
``` ```
Switch after tests pass (if startup/readiness fails, stop the candidate and start Switch after tests pass (if startup/readiness fails, stop the candidate and start
@@ -59,3 +59,12 @@ Original container ID remains
65c9fa765c150467bde2d6336b09fb46d5ffe451d1117eb1ab93a7bacff1037d, 65c9fa765c150467bde2d6336b09fb46d5ffe451d1117eb1ab93a7bacff1037d,
with its original image and configuration; it is stopped, not removed. with its original image and configuration; it is stopped, not removed.
The unrelated pre-existing .gitignore edit is excluded from this change. The unrelated pre-existing .gitignore edit is excluded from this change.
## Concise delivery default
OpenAI delivery v7 requests the supported fact first, short complete answers by
default, all requested parts and material conditions/exceptions preserved, and
full detail on explicit request. Repeated introductions, generic service menus
and invitations are discouraged. Output-token limits and speed are unchanged.
This is model instruction guidance, not a measured quality or cost guarantee.
The existing original rag-api container remains the rollback target.
+2 -2
View File
@@ -53,6 +53,6 @@ def test_gemini_effective_policy_and_evidence_revision_are_pinned():
@pytest.mark.parametrize('voice', ['marin', 'cedar']) @pytest.mark.parametrize('voice', ['marin', 'cedar'])
def test_unverified_pairs_do_not_accept_baseline_cancellation_error(voice): def test_voice_change_keeps_protocol_cancellation_signature(voice):
assert not RealtimeAdapter(Transport(), voice=voice).is_no_active(dict( assert RealtimeAdapter(Transport(), voice=voice).is_no_active(dict(
type='invalid_request_error', code='response_cancel_not_active', param=None)) type='invalid_request_error', code='response_cancel_not_active', param=None))