Skip to content

Implement text processing module and top-level helper functions#6

Closed
jwesleye wants to merge 1 commit intomainfrom
implement-text-processing
Closed

Implement text processing module and top-level helper functions#6
jwesleye wants to merge 1 commit intomainfrom
implement-text-processing

Conversation

@jwesleye
Copy link
Copy Markdown
Collaborator

Summary

  • Implement complete text processing module with 10 essential functions for AI agents
  • Add top-level helper functions for convenient tool loading and management
  • Enable the requested workflow: boat.load_all_*_tools() and boat.merge_tool_lists()

Text Processing Functions Added

  • clean_whitespace: Normalize whitespace in text
  • normalize_line_endings: Convert line endings (unix/windows/mac)
  • strip_html_tags: Intelligent HTML tag removal
  • normalize_unicode: Unicode normalization (NFC/NFD/NFKC/NFKD)
  • to_snake_case: Convert to snake_case with proper handling
  • to_camel_case: Convert to camelCase/PascalCase
  • to_title_case: Convert to Title Case preserving delimiters
  • smart_split_lines: Smart text wrapping with word preservation
  • extract_sentences: Extract sentences with punctuation handling
  • join_with_oxford_comma: Join lists with proper Oxford comma

Helper Functions Added

  • load_all_filesystem_tools(): Get all file system tools as list
  • load_all_text_tools(): Get all text processing tools as list
  • merge_tool_lists(): Merge tool lists and individual functions
  • get_tool_info(): Inspect tool functions for metadata
  • list_all_available_tools(): Discover all tools by category

Usage Example

import basic_open_agent_tools as boat

fs_tools = boat.load_all_filesystem_tools()
text_tools = boat.load_all_text_tools()

def my_custom_tool(some_var: str) -> str:
    return some_var + some_var

agent_tools = boat.merge_tool_lists(fs_tools, text_tools, my_custom_tool)

Test Coverage

  • ✅ 32 tests passing (18 original + 14 new)
  • ✅ 18 file system tools + 10 text tools = 28 available tools
  • ✅ Full type safety with mypy
  • ✅ Code quality compliance with ruff
  • ✅ Comprehensive error handling and validation

🤖 Generated with Claude Code

- Add complete text processing module with 10 core functions:
  * clean_whitespace: Normalize whitespace in text
  * normalize_line_endings: Convert line endings (unix/windows/mac)
  * strip_html_tags: Intelligent HTML tag removal
  * normalize_unicode: Unicode normalization (NFC/NFD/NFKC/NFKD)
  * to_snake_case: Convert to snake_case with proper handling
  * to_camel_case: Convert to camelCase/PascalCase
  * to_title_case: Convert to Title Case preserving delimiters
  * smart_split_lines: Smart text wrapping with word preservation
  * extract_sentences: Extract sentences with punctuation handling
  * join_with_oxford_comma: Join lists with proper Oxford comma

- Add top-level helper functions for tool management:
  * load_all_filesystem_tools(): Get all file system tools as list
  * load_all_text_tools(): Get all text processing tools as list
  * merge_tool_lists(): Merge tool lists and individual functions
  * get_tool_info(): Inspect tool functions for metadata
  * list_all_available_tools(): Discover all tools by category

- Comprehensive test coverage with 32 passing tests
- Full type safety with mypy validation
- Code quality compliance with ruff linting
- Supports agent framework integration patterns

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@jwesleye jwesleye closed this Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant