Spaces:
Sleeping
Sleeping
AkshayM commited on
Commit ·
afb97f7
1
Parent(s): a2a3e4f
chore: white-box temperature 0.75 -> 0.3 (stream + analyze)
Browse files
src/agents/document_agent.py
CHANGED
|
@@ -120,7 +120,7 @@ class DocumentAgent:
|
|
| 120 |
if cached:
|
| 121 |
answer_tokens = estimate_tokens(cached)
|
| 122 |
return cached, prompt_tokens, answer_tokens
|
| 123 |
-
temperature = 0.5 if mode == Mode.black_box else 0.
|
| 124 |
max_tokens = 5120 if mode == Mode.white_box else None
|
| 125 |
reasoning_effort = "instant" if mode == Mode.black_box else "high"
|
| 126 |
reasoning_summary = False if mode == Mode.black_box else True
|
|
@@ -343,7 +343,7 @@ class DocumentAgent:
|
|
| 343 |
prompt_tokens = estimate_tokens(prompt)
|
| 344 |
total_tokens = prompt_tokens
|
| 345 |
answer_buf: list[str] = []
|
| 346 |
-
temperature = 0.5 if req.mode == Mode.black_box else 0.
|
| 347 |
max_tokens = 5120 if req.mode == Mode.white_box else None
|
| 348 |
reasoning_effort = "medium" if req.mode == Mode.black_box else "high"
|
| 349 |
reasoning_summary = False if req.mode == Mode.black_box else None
|
|
@@ -477,7 +477,7 @@ class DocumentAgent:
|
|
| 477 |
logger.info("analyze_document: calling LLM with context length=%d chars", len(ctx))
|
| 478 |
try:
|
| 479 |
raw = await self.llm.chat(prompt, system="You are a research analyst. Output JSON only.",
|
| 480 |
-
max_tokens=4096, temperature=0.
|
| 481 |
except (CircuitBreakerOpenError, LLMError) as e:
|
| 482 |
logger.warning("LLM unavailable for analyze_document: %s — returning raw-context analysis", e)
|
| 483 |
raw_citations = "\n\n".join(f"[{i+1}] **{c.source}**" + (f" (p. {c.page})" if c.page else "") + f":\n {c.quote[:300]}" for i, c in enumerate(citations[:10]))
|
|
|
|
| 120 |
if cached:
|
| 121 |
answer_tokens = estimate_tokens(cached)
|
| 122 |
return cached, prompt_tokens, answer_tokens
|
| 123 |
+
temperature = 0.5 if mode == Mode.black_box else 0.3
|
| 124 |
max_tokens = 5120 if mode == Mode.white_box else None
|
| 125 |
reasoning_effort = "instant" if mode == Mode.black_box else "high"
|
| 126 |
reasoning_summary = False if mode == Mode.black_box else True
|
|
|
|
| 343 |
prompt_tokens = estimate_tokens(prompt)
|
| 344 |
total_tokens = prompt_tokens
|
| 345 |
answer_buf: list[str] = []
|
| 346 |
+
temperature = 0.5 if req.mode == Mode.black_box else 0.3
|
| 347 |
max_tokens = 5120 if req.mode == Mode.white_box else None
|
| 348 |
reasoning_effort = "medium" if req.mode == Mode.black_box else "high"
|
| 349 |
reasoning_summary = False if req.mode == Mode.black_box else None
|
|
|
|
| 477 |
logger.info("analyze_document: calling LLM with context length=%d chars", len(ctx))
|
| 478 |
try:
|
| 479 |
raw = await self.llm.chat(prompt, system="You are a research analyst. Output JSON only.",
|
| 480 |
+
max_tokens=4096, temperature=0.3, reasoning_effort="high", reasoning_summary=True, reasoning_summary_wait=True)
|
| 481 |
except (CircuitBreakerOpenError, LLMError) as e:
|
| 482 |
logger.warning("LLM unavailable for analyze_document: %s — returning raw-context analysis", e)
|
| 483 |
raw_citations = "\n\n".join(f"[{i+1}] **{c.source}**" + (f" (p. {c.page})" if c.page else "") + f":\n {c.quote[:300]}" for i, c in enumerate(citations[:10]))
|