Added support for You.com's Web search & Web contents#5921
Added support for You.com's Web search & Web contents#5921kevmalek wants to merge 1 commit intoFlowiseAI:mainfrom
Conversation
…he ability to fetch the latest news and Web contents, giving an agent the ability to fetch a web page in either markdown or html form quickly
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 significantly enhances Flowise's agent capabilities by integrating You.com's web search and content extraction services. It provides users with direct access to real-time web data, allowing for more dynamic and informed agentic workflows without the need for custom integrations. The changes introduce dedicated nodes and a shared credential for seamless setup and usage. 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
|
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces support for You.com's search and web content extraction tools. The changes include new credential and tool nodes, and a new dependency. The implementation is well-structured. I've provided one suggestion to improve the maintainability of the code by simplifying how input parameters are handled.
| const count = nodeData.inputs?.count as number | ||
| const freshness = nodeData.inputs?.freshness as string | ||
| const country = nodeData.inputs?.country as string | ||
| const safesearch = nodeData.inputs?.safesearch as string | ||
| const livecrawl = nodeData.inputs?.livecrawl as string | ||
| const livecrawl_formats = nodeData.inputs?.livecrawl_formats as string | ||
|
|
||
| if (count) config.count = count | ||
| if (freshness) config.freshness = freshness | ||
| if (country) config.country = country | ||
| if (safesearch) config.safesearch = safesearch | ||
| if (livecrawl) config.livecrawl = livecrawl | ||
| if (livecrawl_formats) config.livecrawl_formats = livecrawl_formats |
There was a problem hiding this comment.
The logic for building the config object can be made more concise and maintainable. Instead of manually handling each input parameter, you can iterate through the this.inputs array. This will automatically handle any future additions or removals of input parameters, reducing the chance of errors.
| const count = nodeData.inputs?.count as number | |
| const freshness = nodeData.inputs?.freshness as string | |
| const country = nodeData.inputs?.country as string | |
| const safesearch = nodeData.inputs?.safesearch as string | |
| const livecrawl = nodeData.inputs?.livecrawl as string | |
| const livecrawl_formats = nodeData.inputs?.livecrawl_formats as string | |
| if (count) config.count = count | |
| if (freshness) config.freshness = freshness | |
| if (country) config.country = country | |
| if (safesearch) config.safesearch = safesearch | |
| if (livecrawl) config.livecrawl = livecrawl | |
| if (livecrawl_formats) config.livecrawl_formats = livecrawl_formats | |
| const inputs = nodeData.inputs ?? {} | |
| for (const input of this.inputs) { | |
| if (inputs[input.name]) { | |
| config[input.name] = inputs[input.name] | |
| } | |
| } |
There was a problem hiding this comment.
Code Review
This pull request introduces new integrations for You.com services, adding a dedicated credential type for You.com API keys. It includes two new tools: 'You.com Search' for real-time web searches, offering parameters such as result count, freshness, country filtering, safe search levels, and live crawling options; and 'You.com Web Contents' for extracting full page content from URLs, with configurable output formats (Markdown, HTML, Metadata) and crawl timeout. To facilitate these integrations, the @youdotcom-oss/langchain dependency has been added to the project.
Summary
Adds two new You.com tool nodes to Flowise,
YouDotComSearchandYouDotComWebContents, along with a sharedYouDotComApicredential, enabling real-time web search and URL content extraction within Flowise agent flows.Motivation
You.com's Search API provides structured, AI-optimized web and news results ideal for RAG and agentic workflows. These nodes make it easy for Flowise users to give their agents live web access without writing custom integrations.
Changes
packages/components/credentials/YouDotComApi.credential.ts— new credential type for You.com API keyspackages/components/nodes/tools/YouDotComSearch/YouDotComSearch.ts— new tool node wrappingyouSearchfrom@youdotcom-oss/langchainpackages/components/nodes/tools/YouDotComSearch/Youcom_logo.jpg— node iconpackages/components/nodes/tools/YouDotComWebContents/YouDotComWebContents.ts— new tool node for URL content extractionpackages/components/nodes/tools/YouDotComWebContents/Youcom_logo.jpg— node iconpackages/components/package.json— added@youdotcom-oss/langchaindependencyImplementation Details
@youdotcom-oss/langchain(youSearchandyouContents) which returnDynamicStructuredToolinstances compatible with any LangChain agent. Langchain.js is no longer accepting new integrations into its monorepo, hence the additional dependency.query/urlsinputs are supplied at runtime by the LLM agent