AS AgentScopeAPI 手册 / API Reference

TikaReader

public class TikaReader extends AbstractChunkingReader
源码Source io/agentscope/core/rag/reader/TikaReader.java:59–173

Tika 读取器,把私有文档转化为可检索的知识。位于 io.agentscope.core.rag.reader 包,继承自 AbstractChunkingReader。核心成员包括 read、getSupportedFormats、TikaReader。

TikaReader is a document reader that uses Apache Tika to extract text from various document formats.

It supports various document formats (e.g. DOC, XSL, PDF, PPT ...) and splitting strategies.

Example usage:

`TikaReader reader = new TikaReader();
ReaderInput input = ReaderInput.fromPath("/path/to/file");
List<Document> documents = reader.read(input).block();
`

构造器摘要Constructor Summary

构造器Constructor说明Description
public TikaReader(int chunkSize, SplitStrategy splitStrategy, int overlapSize, ContentHandler handler)
初始化 `TikaReader` 实例。
Creates a new TikaReader with the specified configuration.
public TikaReader()
创建新的TikaReader 使用默认设置。
Creates a new TikaReader with default settings.

方法摘要Method Summary

方法Method说明Description
public Mono<List<Document>> read(ReaderInput input)
设置读取。
Performs the read operation.
public List<String> getSupportedFormats()
获取 `getSupportedFormats`。
Returns the supported formats.

构造器详情Constructor Detail

TikaReader

public TikaReader(int chunkSize, SplitStrategy splitStrategy, int overlapSize, ContentHandler handler)

初始化 TikaReader 实例。

Creates a new TikaReader with the specified configuration.

参数Parameters
名称Name类型Type说明Description
chunkSizeint分块大小(类型 `int`)。the target size for each chunk (interpreted based on strategy)
splitStrategySplitStrategy已拆分 Strategy(类型 `SplitStrategy`)。the strategy for splitting text
overlapSizeintoverlap 大小(类型 `int`)。the number of characters/tokens to overlap between chunks
handlerContentHandler处理器(类型 `ContentHandler`)。the content handler to use for text extraction
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if parameters are invalid
源码Source io/agentscope/core/rag/reader/TikaReader.java:77–84

TikaReader

public TikaReader()

创建新的TikaReader 使用默认设置。

Creates a new TikaReader with default settings.

源码Source io/agentscope/core/rag/reader/TikaReader.java:91–93

方法详情Method Detail

read

public Mono<List<Document>> read(ReaderInput input)

设置读取。

Performs the read operation.

参数Parameters
名称Name类型Type说明Description
inputReaderInput输入消息(类型 `ReaderInput`)。The input.
返回Returns Mono<List<Document>>
返回Mono>。Returns mono.
源码Source io/agentscope/core/rag/reader/TikaReader.java:95–116

getSupportedFormats

public List<String> getSupportedFormats()

获取 getSupportedFormats。

Returns the supported formats.

返回Returns List<String>
返回列出。Returns list.
源码Source io/agentscope/core/rag/reader/TikaReader.java:118–140

继承成员Inherited Members

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.