tune: raise context budget 700->1400 tokens + max_tokens 1200->1800 for 600-800 word answers
Browse files- app/domains/ayurveda.yaml +1 -1
- app/services/engine.py +1 -1
app/domains/ayurveda.yaml
CHANGED
|
@@ -21,7 +21,7 @@ retrieval:
|
|
| 21 |
|
| 22 |
llm:
|
| 23 |
temperature: 0.3
|
| 24 |
-
max_tokens:
|
| 25 |
|
| 26 |
prompts:
|
| 27 |
system: |
|
|
|
|
| 21 |
|
| 22 |
llm:
|
| 23 |
temperature: 0.3
|
| 24 |
+
max_tokens: 1800
|
| 25 |
|
| 26 |
prompts:
|
| 27 |
system: |
|
app/services/engine.py
CHANGED
|
@@ -690,7 +690,7 @@ async def stream_answer(
|
|
| 690 |
|
| 691 |
# Build prompt (history is trimmed + deduplicated inside _build_prompt)
|
| 692 |
trimmed_history = history[-(history_turns * 2):]
|
| 693 |
-
condensed_chunks, _ = condense_context(chunks, max_context_tokens=
|
| 694 |
messages = _build_prompt(config, query, condensed_chunks, trimmed_history)
|
| 695 |
|
| 696 |
# ── Step 4: Tier 2 — Stream buffer for OUT_OF_SYLLABUS detection ────────────
|
|
|
|
| 690 |
|
| 691 |
# Build prompt (history is trimmed + deduplicated inside _build_prompt)
|
| 692 |
trimmed_history = history[-(history_turns * 2):]
|
| 693 |
+
condensed_chunks, _ = condense_context(chunks, max_context_tokens=1400)
|
| 694 |
messages = _build_prompt(config, query, condensed_chunks, trimmed_history)
|
| 695 |
|
| 696 |
# ── Step 4: Tier 2 — Stream buffer for OUT_OF_SYLLABUS detection ────────────
|