Repository navigation
feat(ai): finish engine wiring — briefings via provider, flyer honors key - #84
Merged
Merged
Conversation
… key Finishes the configurable-AI-engine wiring so the /admin/ai setting takes effect everywhere: - Adds optional maxTokens to the provider complete() interface (default 1024). - Migrates the morning/evening briefing and weekly briefing off the direct Anthropic SDK to resolveProvider() (maxTokens 2000 / 2600). - Flyer keeps the Anthropic SDK (PDF/vision is Anthropic-specific) but now reads the admin-configured Anthropic key/model via getAIConfig and returns a clear 503 if no Anthropic key is set. No more direct @anthropic-ai/sdk usage except the intentional flyer path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVdGmgvtEjp4ZSqcES7ThJ
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
Finishes the configurable AI-engine wiring (#79 follow-up, backlog item #2) so the
/admin/aiengine setting takes effect across all AI features.complete()now accepts an optionalmaxTokens(default 1024) — needed for the long JSON briefings./api/ai/briefing) and Weekly briefing (/api/ai/weekly-briefing): migrated off the direct Anthropic SDK toresolveProvider()(maxTokens 2000 / 2600). They now honor the configured engine + key./api/ai/flyer): PDF/vision input is Anthropic-specific, so it keeps the Anthropic SDK — but now reads the admin-configured Anthropic key/model viagetAIConfigand returns a clear503if no Anthropic key is set (instead of silently using only the env var).After this, the only
@anthropic-ai/sdkusage is the intentional flyer path.Verification
tsc✅ ·next lint✅ ·next build✅ · full suite 363/363 ✅. No migration.Note
If you switch the engine to OpenAI, flyer still needs an Anthropic key set in Admin → AI Engine (OpenAI chat can't ingest PDFs; an OpenAI-vision path for images would be a separate follow-up).
🤖 Generated with Claude Code
https://claude.ai/code/session_01BVdGmgvtEjp4ZSqcES7ThJ
Generated by Claude Code