Files
Henry Heng 0c6924bb08 Feat/Reasoning Support, Migrate LangChain to v1, Upgrade AI SDKs and Models (#5893)
* update langchain and all related scoped packages to v1, deprecate agents and llms, rename and upgrade chat models

* add reasoning capability to Agent and LLM

* add token cost to usageMetadata

* update azure and chat openai

* restore executable permission for husky pre-commit hook

* refactor(agentflow): implement extractResponseContent utility for consistent 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.

* added a mock implementation for the logger in the URL security utilities test file to isolate tests and improve reliability.

* chore: update package.json and pnpm-lock.yaml to add uuid dependency 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.

* gpt 5.4 models

* - Changed the stream conversion method in convertTextToSpeechStream to 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.

* - Refactors how agentflow nodes (Agent, ConditionAgent, LLM) handle images in chat messages so that base64 is only used during model invocation
- Storage and chat history keep file references only
- Added comprehensive test cases to ensure correct handling of base64 image data and file references

* fix unit test

* implement filename sanitization to prevent path traversal vulnerabilities

* fix(validator): normalize backslashes in file names for cross-platform compatibility

* updated utils to process messages with images, converting stored-file references to base64 for model invocation, and implement interfaces

* add sanitization to unwanted keys when processing images

* add uuid to components package.json

* move allow image uploads params on chat models

* add encodingformat to openai embeddings

* Refactor output parsing for reasoning models

* Update ConditionAgent to version 2.0, refactor system prompt handling, and enhance message preparation logic

* add claude settings local json to gitignore

* remove claude settings local json

---------

Co-authored-by: yau-wd <yau.ong@workday.com>
2026-03-16 19:21:29 +08:00

121 lines
1.4 KiB
Plaintext