[chore]: rm langchain deps#2123
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
No issues found across 4 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Main as Application Code
participant Stagehand as Stagehand Core
participant LLMClient as LLMClient (Abstract)
participant ConcreteClients as OpenAI / Anthropic / Google / Vercel Clients
participant LLMProviders as LLM Provider APIs
Note over Main,LLMProviders: Current Architecture: No LangChain integration
Main->>Stagehand: Create Stagehand instance with desired LLM client
alt Using Native Client (e.g., ChatOpenAI from package)
Main->>ConcreteClients: Instantiate ChatOpenAI client
Main->>Stagehand: Stagehand({ llmClient: chatOpenAI })
else Using Vercel AI SDK client
Main->>ConcreteClients: Create Vercel AI provider (openai, anthropic...)
Main->>Stagehand: Stagehand({ llmClient: vercelAIClient })
end
Stagehand->>LLMClient: Calls createChatCompletion(options)
LLMClient->>ConcreteClients: Dispatches to the correct provider implementation
alt Successful request
ConcreteClients->>LLMProviders: HTTP POST to LLM API (OpenAI, Anthropic, etc.)
LLMProviders-->>ConcreteClients: LLM response (text + usage)
ConcreteClients-->>LLMClient: Return ChatCompletion
LLMClient-->>Stagehand: Return structured response
Stagehand-->>Main: Return extracted result
else Request fails / rate-limited
ConcreteClients->>LLMProviders: HTTP POST
LLMProviders-->>ConcreteClients: Error response (e.g. 429, 500)
ConcreteClients-->>LLMClient: Throw error
LLMClient-->>Stagehand: Propagate error
Stagehand-->>Main: Return error
end
Note over Main,LLMProviders: Not in play: @langchain/core, @langchain/openai
Note over ConcreteClients: Active integrations: OpenAI, Anthropic, Google, Vercel AI SDK
miguelg719
approved these changes
May 14, 2026
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.
why
what changed
lanchain/coreandlangchain/openaifrom dependenciesSummary by cubic
Removed unused LangChain dependencies and examples from
packages/coreto reduce install size and simplify the codebase. No API or runtime behavior changes.Dependencies
@langchain/coreand@langchain/openaifrompackages/core/package.json.pnpm-lock.yamlto drop related transitive packages.Refactors
packages/core/examples/langchain-client.tsandpackages/core/examples/custom-client-langchain.ts.Written for commit e46cfa4. Summary will update on new commits.