langchain/libs
Lei Zhang 748a6ae609
community[patch]: add HTTP response headers Content-Type to metadata of RecursiveUrlLoader document (#20875)
**Description:** 
The RecursiveUrlLoader loader offers a link_regex parameter that can
filter out URLs. However, this filtering capability is limited, and if
the internal links of the website change, unexpected resources may be
loaded. These resources, such as font files, can cause problems in
subsequent embedding processing.

>
https://blog.langchain.dev/assets/fonts/source-sans-pro-v21-latin-ext_latin-regular.woff2?v=0312715cbf

We can add the Content-Type in the HTTP response headers to the document
metadata so developers can choose which resources to use. This allows
developers to make their own choices.

For example, the following may be a good choice for text knowledge.

- text/plain - simple text file
- text/html - HTML web page
- text/xml - XML format file
- text/json - JSON format data
- application/pdf - PDF file
- application/msword - Word document

and ignore the following

- text/css - CSS stylesheet
- text/javascript - JavaScript script
- application/octet-stream - binary data
- image/jpeg - JPEG image
- image/png - PNG image
- image/gif - GIF image
- image/svg+xml - SVG image
- audio/mpeg - MPEG audio files
- video/mp4 - MP4 video file
- application/font-woff - WOFF font file
- application/font-ttf - TTF font file
- application/zip - ZIP compressed file
- application/octet-stream - binary data

**Twitter handle:** @coolbeevip

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
2024-04-25 11:29:41 -07:00
..
cli templates: readme langsmith not private beta (#20173) 2024-04-12 13:08:10 -07:00
community community[patch]: add HTTP response headers Content-Type to metadata of RecursiveUrlLoader document (#20875) 2024-04-25 11:29:41 -07:00
core core[minor], langchain[patch], community[patch]: mv StructuredQuery (#20849) 2024-04-25 09:40:26 -07:00
experimental experimental[patch]: Makes regex customizable in text_splitter.py (SemanticChunker class) (#20485) 2024-04-25 00:32:40 +00:00
langchain core[minor], langchain[patch], community[patch]: mv StructuredQuery (#20849) 2024-04-25 09:40:26 -07:00
partners upstage: release 0.1.2 (#20898) 2024-04-25 10:41:19 -07:00
standard-tests standard-tests: split tool calling test (#20803) 2024-04-23 20:59:45 +00:00
text-splitters text-splitters[patch]: fix MarkdownHeaderTextSplitter fails to parse headers with non-printable characters (#20645) 2024-04-25 00:07:42 +00:00