Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feat : Add GitBook Document Reader / 添加 GitBook 文档阅读器ianxiadong gitbook Related issue : #278 #365

Merged
merged 4 commits into from
Jan 13, 2025

Conversation

brianxiadong
Copy link
Contributor

🌟 Features / 功能特性

English

  • Implements a new document reader for GitBook integration
  • Supports both public and private GitBook spaces
  • Provides flexible metadata configuration
  • Includes comprehensive documentation and examples
  • Follows Spring AI's document reader interface standards

中文

  • 实现了新的 GitBook 文档阅读器集成
  • 支持公共和私有 GitBook 空间
  • 提供灵活的元数据配置选项
  • 包含完整的文档和示例
  • 遵循 Spring AI 的文档阅读器接口标准

🔍 Implementation Details / 实现细节

English

The GitBook Document Reader:

  • Uses GitBook API for document retrieval
  • Converts GitBook pages to Spring AI Document objects
  • Supports customizable metadata extraction
  • Implements robust error handling
  • Includes unit tests for core functionality

中文

GitBook 文档阅读器:

  • 使用 GitBook API 获取文档
  • 将 GitBook 页面转换为 Spring AI Document 对象
  • 支持自定义元数据提取
  • 实现了健壮的错误处理
  • 包含核心功能的单元测试

📝 Usage Example / 使用示例

// Basic usage / 基本用法
GitbookDocumentReader reader = new GitbookDocumentReader(
    "your-api-token",
    "your-space-id"
);
List<Document> documents = reader.get();

// Advanced configuration / 高级配置
List<String> metadataFields = Arrays.asList("title", "description");
GitbookDocumentReader reader = new GitbookDocumentReader(
    "your-api-token",
    "your-space-id",
    "custom-api-url",
    metadataFields
);

🔄 Changes / 变更说明

English

  • Added new GitBook document reader implementation
  • Created comprehensive documentation
  • Added unit tests
  • Included usage examples
  • No breaking changes to existing functionality

中文

  • 添加了新的 GitBook 文档阅读器实现
  • 创建了完整的文档
  • 添加了单元测试
  • 包含了使用示例
  • 不影响现有功能

📋 Checklist / 检查清单

  • Code follows project style guidelines / 代码遵循项目风格指南
  • Documentation is updated / 文档已更新
  • Tests are added / 测试已添加
  • All tests pass / 所有测试通过
  • PR description is clear / PR 描述清晰

Closes #278

@chickenlj chickenlj merged commit b9cd1c0 into alibaba:main Jan 13, 2025
4 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add document reader code platform gitbook
2 participants