Skip to content

Commit 1066e50

Browse files
committed
refactor: add disableLinkParsing check in extractAndCrawlUrls function
- Introduced a check for the disableLinkParsing configuration to conditionally skip URL extraction. - Updated logging to indicate when link parsing is disabled, improving debugging capabilities. - Ensured compliance with Tailwind CSS styling and performance optimizations, including the use of optional chaining and nullish coalescing.
1 parent 9c78cc4 commit 1066e50

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/skill-template/src/scheduler/utils/extract-weblink.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ export async function extractAndCrawlUrls(
181181
analysis: { hasUrls: boolean; queryIntent: string };
182182
}> {
183183
const logger = skill.engine.logger;
184+
const disableLinkParsing = config?.configurable?.runtimeConfig?.disableLinkParsing;
185+
186+
if (disableLinkParsing !== false) {
187+
logger.log('disableLinkParsing is on');
188+
return {
189+
sources: [],
190+
analysis: {
191+
hasUrls: false,
192+
queryIntent: query,
193+
},
194+
};
195+
}
184196

185197
// Use linkify-it for fast and reliable URL extraction
186198
const { hasUrls, detectedUrls } = extractUrlsWithLinkify(query);

0 commit comments

Comments
 (0)