refactor: rename BYTEDANCE to BYTEPLUS and migrate to provider mixins#84
Conversation
…plus Rename provider directories from 'bytedance' to 'byteplus' in both image-generation and video-generation capabilities to align with updated naming convention. ## Changes - Image generation: Rename bytedance/ → byteplus/ (7 files) - Video generation: Rename bytedance/ → byteplus/ (7 files) - Includes: README, __init__, client, config, models, parameters, streaming This is a directory rename only. Import statements and enum references will be updated in subsequent commits.
Update Provider enum, credentials, class names, variables, docstrings, and all references from ByteDance/BYTEDANCE/bytedance to BytePlus/BYTEPLUS/byteplus. ## Core Changes - Provider enum: BYTEDANCE → BYTEPLUS in core.py - Credentials: bytedance_api_key → byteplus_api_key, BYTEDANCE_API_KEY → BYTEPLUS_API_KEY - Package name: celeste_bytedance → celeste_byteplus ## Capability Changes - Class names: ByteDance* → BytePlus* (clients, streams) - Variable names: BYTEDANCE_* → BYTEPLUS_* (MODELS, PARAMETER_MAPPERS, etc.) - Docstrings/comments: ByteDance → BytePlus - Provider references: Provider.BYTEDANCE → Provider.BYTEPLUS - README files: Update environment variable names and provider names - Tests: Update Provider.BYTEDANCE → Provider.BYTEPLUS - Keywords: bytedance → byteplus in pyproject.toml ## Files Updated - Core: core.py, credentials.py - Image generation: client, models, parameters, streaming, config, __init__, README - Video generation: client, models, parameters, config, __init__, README - Tests: integration tests for both capabilities - Provider package: byteplus provider package files
…te to mixins Remove unused config.py files from BytePlus capability providers and migrate clients to use provider package mixins following the established pattern. ## Changes - Remove image-generation/providers/byteplus/config.py - Remove video-generation/providers/byteplus/config.py - Migrate clients to use BytePlusImagesClient and BytePlusVideosClient mixins - Add celeste-byteplus workspace dependency to both capability packages - Simplify client implementations by delegating HTTP requests to mixins Configuration is now centralized in the provider package (celeste_byteplus.images.config and celeste_byteplus.videos.config) following the established pattern from OpenAI, Mistral, and other providers.
Change BFL provider value from 'Black Forest Labs' to 'bfl' to match the lowercase convention expected by all providers. This fixes the test_all_providers_are_lowercase test failure.
Pull Request Review: Rename BYTEDANCE to BYTEPLUS and Migrate to Provider MixinsSummaryThis PR successfully accomplishes a major refactoring: renaming the provider from ByteDance to BytePlus and introducing a mixin-based architecture for code reuse. The changes are comprehensive, well-executed, and maintain consistency across the codebase. Strengths1. Excellent Architectural ImprovementThe migration to provider package mixins (BytePlusImagesClient and BytePlusVideosClient) is a significant improvement:
2. Thorough and Consistent RenamingThe rename from BYTEDANCE to BYTEPLUS is comprehensive across core enum, class names, environment variables, documentation, tests, and imports. 3. Clean Code Quality
4. Breaking Change DocumentationClear communication about breaking changes in the PR description with migration guide for users. Areas for Consideration1. BFL Provider FixThe PR includes an additional fix changing BFL provider value from "Black Forest Labs" to "bfl". This could have been a separate commit or called out more prominently in the PR description as it is unrelated to the BytePlus rename. 2. Test Coverage - Integration Test ChangeIn test_generate.py (line 45), the test was modified to remove an explicit model parameter. This change is not mentioned in the PR description - clarify if this is intentional refactor or a fix. 3. Async Polling ImplementationThe BytePlusVideosClient uses fixed 5-second polling intervals. Consider:
4. Error Handling EnhancementConsider creating custom exception classes (e.g., BytePlusAPIError) instead of generic ValueError for better debugging and alignment with existing exception hierarchy. 5. DocumentationConsider adding:
Potential Issues1. Missing Return Type HintIn packages/providers/byteplus/src/celeste_byteplus/images/client.py line 84, _parse_content returns Any which loses type safety. 2. Code DuplicationBoth BytePlusImagesClient and BytePlusVideosClient have _parse_usage methods with similar patterns. Consider extraction to common base. Security ReviewNo security concerns identified:
Performance
Testing
Recommendations: Consider tests for mixin pattern and polling timeout behavior. Final RecommendationsMust Address (Before Merge)None - the PR is in good shape for merging Should Address (Nice to Have)
Future Enhancements
ConclusionThis is a well-executed refactoring that improves code quality and architecture. The mixin pattern is a significant improvement that will pay dividends in maintainability. The rename is thorough and consistent. Recommendation: APPROVE with minor suggestions The code is production-ready. The suggestions above are primarily for future enhancements rather than blockers. Great work on maintaining consistency across such a large refactoring! Review generated with Claude Code |
Rename provider from 'bytedance' to 'byteplus' across the entire codebase and migrate capability clients to use provider package mixins.
Changes
Core Renames
BYTEDANCE→BYTEPLUSincore.pybytedance_api_key→byteplus_api_key,BYTEDANCE_API_KEY→BYTEPLUS_API_KEYceleste_bytedance→celeste_byteplusCapability Changes
bytedance/→byteplus/in both image and video generation capabilitiesByteDance*→BytePlus*(clients, streams)BYTEDANCE_*→BYTEPLUS_*(MODELS, PARAMETER_MAPPERS, etc.)Provider.BYTEDANCE→Provider.BYTEPLUSthroughoutBYTEDANCE_API_KEY→BYTEPLUS_API_KEY)Provider.BYTEPLUSbytedance→byteplusin pyproject.tomlProvider Package Migration
BytePlusImageGenerationClientnow extendsBytePlusImagesClientBytePlusVideoGenerationClientnow extendsBytePlusVideosClientconfig.pyfiles from capability packagesceleste_byteplus.images.config,celeste_byteplus.videos.config)celeste-byteplusworkspace dependency to both capability packagesAdditional Fixes
"Black Forest Labs"to"bfl"to match lowercase conventionRationale
Aligns provider naming with the actual API service (BytePlus) rather than the parent company name (ByteDance). The provider package was already named
byteplus, so this change brings consistency across the codebase.Breaking Changes
Yes - This is a breaking change:
Provider.BYTEDANCE→Provider.BYTEPLUSBYTEDANCE_API_KEY→BYTEPLUS_API_KEYByteDance*toBytePlus*Users will need to update their code to use the new enum value and environment variable name.
Testing