Skip to content

NET-1329 simplify cache TTL to module const and per-call override#329

Merged
AkhileshNair2201 merged 3 commits into
feat/sdk-cachingfrom
NET-1329-simplify-cache-ttl
Jul 13, 2026
Merged

NET-1329 simplify cache TTL to module const and per-call override#329
AkhileshNair2201 merged 3 commits into
feat/sdk-cachingfrom
NET-1329-simplify-cache-ttl

Conversation

@AkhileshNair2201

@AkhileshNair2201 AkhileshNair2201 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

TICKET (https://getnetra.atlassian.net/browse/NET-1329)

Summary

  • Drop cache_ttl_seconds init config and NETRA_CACHE_TTL_SECONDS env — they were unused; callers only ever hit the default.
  • Prompts now use module constant PROMPT_CACHE_TTL_SECONDS (60); override only via per-call cache_ttl (same pattern as models’ MODEL_PRICING_CACHE_TTL_SECONDS).
  • Update README and CHANGELOG to match.

Why

Init/env TTL added config surface without real usage. Aligning prompts with the Phase 2 models pattern keeps one clear rule: module default + per-call override.

Test plan

  • pytest prompts/models/init/cache suites
  • Confirm no callers rely on cache_ttl_seconds / NETRA_CACHE_TTL_SECONDS

Made with Cursor

AkhileshNair2201 and others added 3 commits July 10, 2026 18:57
Co-authored-by: Cursor <cursoragent@cursor.com>
…/netra-sdk-py into NET-1329-simplify-cache-ttl
Co-authored-by: Cursor <cursoragent@cursor.com>
@AkhileshNair2201 AkhileshNair2201 merged commit be6fa6d into feat/sdk-caching Jul 13, 2026
AkhileshNair2201 added a commit that referenced this pull request Jul 13, 2026
…328)

* feat: add opt-in TTL caching for get_prompt

Co-authored-by: Cursor <cursoragent@cursor.com>

* update doc

* remove 0.1.95 changelog

* fix: address PR review feedback for get_prompt caching

Restore the 0.1.95 changelog entry, bump to 0.1.96, skip cache writes
for non-positive TTL, and add shutdown and edge-case tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix

* fix: align instrumentation tests with current APIs and close LiteLLM/FastAPI gaps

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(models): add opt-in TTL caching for get_model_pricing

* chore: remove phase-2-spec from models caching commit

* docs(models): fix get_model_pricing returns docs and note cache mutation

Co-authored-by: Cursor <cursoragent@cursor.com>

* NET-1329 simplify cache TTL to module const and per-call override (#329)

* NET-1329 simplify cache TTL to module const and per-call override

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(prompts): assert default cache TTL is prompts-owned constant

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: document opt-in TTL caching for get_model_pricing

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants