feat(v3.0): wire API-based summarizer from config#26
Open
RichardHightower wants to merge 2 commits intomainfrom
Open
feat(v3.0): wire API-based summarizer from config#26RichardHightower wants to merge 2 commits intomainfrom
RichardHightower wants to merge 2 commits intomainfrom
Conversation
- Read provider/model/api_key_env from SummarizerSettings config - Construct ApiSummarizer (OpenAI or Anthropic) when API key available - Fallback to MockSummarizer with warning when no API key found - Add build_summarizer() function for testable summarizer construction - Add unit tests for provider selection and env var lookup - Update planning docs for v3.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wires the existing
ApiSummarizer(OpenAI + Anthropic) into the daemon from config and environment variables. Previously hardcoded toMockSummarizerwith a TODO comment.What changed
crates/memory-daemon/src/commands.rsbuild_summarizer()function: reads provider/model from config, resolves API key from env var or config, constructsApiSummarizeror falls back toMockSummarizerwith warning. 7 unit tests.crates/memory-types/src/config.rsapi_key_env: Option<String>toSummarizerSettingsfor custom env var override (serde(default)for backward compat).planning/STATE.md,.planning/ROADMAP.mdHow it works
Set the corresponding env var (
OPENAI_API_KEYorANTHROPIC_API_KEY) and the daemon picks it up automatically. Without an API key, it falls back to MockSummarizer with a warning log.Design decisions
api_key_env.Option<String>withserde(default), existing configs unchanged.OpenAI,openai,OPENAIall work.Tests
7 unit tests covering: