phase-8:server code enhancements.
This commit is contained in:
committed by
saikiranvella
parent
93aac355cc
commit
ff1b99910b
@@ -657,6 +657,14 @@ Both `market-calls.json` and `portfolio.json` use `writeFileSync` with no concur
|
||||
|
||||
Update `StockScorer.test.js` to cover the three new scoring factors: analyst consensus scoring (including the `numberOfAnalysts < 3` guard), DCF margin of safety scoring (positive/negative/null cases), and the new 52W risk flags.
|
||||
|
||||
#### 8l — Anthropic prompt caching for LLMAnalyst
|
||||
|
||||
`LLMAnalyst.analyze()` sends a large system prompt on every `/api/analyze` call. Enabling Anthropic prompt caching would cache the static system prompt across calls, reducing latency and token costs significantly.
|
||||
|
||||
Target: add `cache_control: { type: 'ephemeral' }` to the system prompt message block in `AnthropicClient.complete()` (or in `LLMAnalyst.analyze()` if the system prompt is built there). Use the `anthropic-beta: prompt-caching-2024-07-31` header. The cache has a 5-minute TTL and applies to the longest common prefix of consecutive requests — ideal for the static analysis instructions that never change between calls.
|
||||
|
||||
See: https://docs.anthropic.com/en/docs/build-with-claude/prompt-caching
|
||||
|
||||
---
|
||||
|
||||
## Adding a New Asset Type
|
||||
|
||||
Reference in New Issue
Block a user