feat: pluggable LLM provider with a real AI SDK adapter - #4
Merged
Conversation
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.
adds a new packages/llm that plugs a real model into the agent loop through the Vercel AI SDK. the agent-core LLMProvider interface stays the same, so the orchestrator doesn't know or care which backend it's talking to. createLLMProvider is key-gated: with OPENAI_API_KEY set it returns the AI SDK adapter, otherwise it falls back to the existing MockLLMProvider so CI and local dev keep running with no credentials. the adapter maps our message history (including tool calls and tool results) into AI SDK model messages and reconstructs tool names for prior results, and surfaces at most one decision per call since the orchestrator owns the loop. tests use the SDK's mock model to cover the tool-call and plain-answer paths plus the key gating, no network for now.