feat(server): adapt doc loader for server native (#9942)

This commit is contained in:
darkskygit
2025-02-26 08:05:20 +00:00
parent e1fd8f5d80
commit d25b216311
17 changed files with 121 additions and 55 deletions

View File

@@ -27,7 +27,7 @@ impl<R: Read> HtmlLoader<R> {
}
impl<R: Read + Send + Sync + 'static> Loader for HtmlLoader<R> {
fn load(mut self) -> Result<Vec<Document>, LoaderError> {
fn load(mut self) -> LoaderResult<Vec<Document>> {
let cleaned_html = readability::extractor::extract(&mut self.html, &self.url)?;
let doc =
Document::new(format!("{}\n{}", cleaned_html.title, cleaned_html.text)).with_metadata(