Feat/Reasoning Support, Migrate LangChain to v1, Upgrade AI SDKs and Models#5893
Feat/Reasoning Support, Migrate LangChain to v1, Upgrade AI SDKs and Models#5893HenryHengZJ wants to merge 12 commits intomainfrom
Conversation
…nts and llms, rename and upgrade chat models
# Conflicts: # pnpm-lock.yaml
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on modernizing the codebase by migrating to Langchain V1 and incorporating new AI models. It also enhances the Agentflow component with improved reasoning capabilities and deprecates older agent implementations in favor of newer, more flexible solutions. The changes aim to improve the performance, maintainability, and user experience of the Flowise platform. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a major upgrade to Langchain v1 and other dependencies, which is a significant undertaking. The changes are extensive and touch many parts of the codebase, including dependency updates, API migrations, and refactoring of several components.
Key changes include:
- Upgrading Langchain, OpenAI, and Zod to new major versions.
- Migrating deprecated agents and chains to
@langchain/classic. - Introducing new features like 'thinking/reasoning' steps for agents and cost calculation, which enhances visibility into agent execution.
- Refactoring several chat model components to support new features and align with updated APIs.
- Deprecating older agent implementations in favor of the new AgentFlow components.
The overall changes look solid and well-executed. I've added a few minor comments regarding type safety and error handling. Great work on this large-scale update!
Note: Security Review did not run due to the size of the PR.
| } catch { | ||
| return undefined | ||
| } |
There was a problem hiding this comment.
This empty catch block swallows errors silently, which can make debugging difficult if something goes wrong during cost calculation. It's a good practice to at least log the error to have visibility into potential issues.
} catch (error) {
console.error(`Error calculating usage cost: ${error}`)
return undefined
}|
|
||
| const dbConfig: QdrantLibArgs = { | ||
| client, | ||
| client: client as any, |
|
|
||
| const storeConfig: RedisVectorStoreConfig = { | ||
| redisClient: redisClient, | ||
| redisClient: redisClient as any, |
There was a problem hiding this comment.
|
Looking forward to this one, especially with gemini-3.1-flash-lite-preview working with the thought signature issue <3 |
…sistent response handling - Introduced extractResponseContent function to streamline response content extraction across various components. - Updated multiple files to utilize the new utility, enhancing code readability and maintainability. - Adjusted model configurations and added new parameters for Gemini models to improve functionality.
# Conflicts: # pnpm-lock.yaml
…ies test file to isolate tests and improve reliability.
…and mock multer-azure-blob-storage in Jest config - Added uuid dependency with version 10.0.0 and request>uuid with version 3.4.0 in package.json. - Updated pnpm-lock.yaml to reflect the new uuid dependency and its deprecation notice. - Modified Jest configuration to mock multer-azure-blob-storage to avoid module resolution issues with uuid/v4.
…o utilize Readable.fromWeb, enhancing compatibility with web streams. - Added '/api/v1/chatmessage/abort' to the WHITELIST_URLS array to allow for aborting chat messages in the API.
This PR upgrades the entire LangChain ecosystem from v0.3.x to v1.x, updates related SDKs (OpenAI, Anthropic, Mistral, etc.), deprecates legacy LLM nodes in favor of Chat Models, removes obsolete agents, and adds reasoning/thinking support to the UI and backend.
Key Changes
LangChain v1 Upgrade (270 files changed, ~5,900 additions / ~5,300 deletions)
@langchain/core:0.3.61→1.1.20langchain:^0.3.5→1.2.18@langchain/openai:0.6.3→1.2.5@langchain/anthropic:0.3.33→1.3.20@langchain/google-genai:0.2.3→2.1.15@langchain/*scoped packages upgraded to their respective v1 releases@langchain/deepseek,@langchain/classic,@langchain/redis,@langchain/tavily,@langchain/textsplittersSDK Upgrades
openai:4.96.0→6.19.0@anthropic-ai/sdk: added at^0.73.0@mistralai/mistralai:0.1.3→1.14.0@aws-sdk/client-bedrock-runtime:3.422.0→3.966.0langsmith:0.1.6→0.4.12zod:3.22.4→^3.25.76 || ^4uuid:^9.0.1→^10.0.0(across all packages)Deprecate Legacy LLM Nodes
All LLM nodes now display a
DEPRECATINGbadge with a message pointing users to the equivalent Chat Model:Remove Obsolete Agents
Remove Deprecated Utilities
FlowiseGoogleAICacheManager,GoogleGenerativeAIContextCache)utils/common.ts,utils/output_parsers.ts,utils/tools.ts,utils/types.ts,utils/zod_to_genai_parameters.ts(replaced by upstream@langchain/google-genaiv2)UnstructuredFolder.tsReasoning / Thinking Support
ThinkingCardUI component — collapsible card that displays model reasoning content (thinking tokens) with duration indicator, auto-expands while thinkingreasonContentfield onChatMessageentity with DB migrations for SQLite, Postgres, MySQL, and MariaDBstreamThinkingEventto bothSSEStreamerandRedisEventPublisherfor real-time thinking token deliveryusageMetadatanow includes token cost informationChat Model Updates
@langchain/anthropicv1 API changesFlowiseChatGoogleGenerativeAIto use upstream v2 SDK@langchain/*v1 module structureTest Plan
DEPRECATINGbadge and still function