Skip to content

Commit e8f8b14

Browse files
refactor: rename BYTEDANCE to BYTEPLUS and migrate to provider mixins (withceleste#84)
* refactor(capabilities): rename bytedance provider directories to byteplus 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. * refactor: rename BYTEDANCE to BYTEPLUS across codebase 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 * chore(capabilities): remove redundant BytePlus config files and migrate 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. * fix(core): change BFL provider value to lowercase 'bfl' 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.
1 parent 6da3983 commit e8f8b14

File tree

40 files changed

+838
-636
lines changed

40 files changed

+838
-636
lines changed

packages/capabilities/image-generation/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ classifiers = [
1717
"Topic :: Scientific/Engineering :: Artificial Intelligence",
1818
"Typing :: Typed",
1919
]
20-
keywords = ["ai", "image-generation", "dall-e", "imagen", "openai", "google", "bytedance"]
20+
keywords = ["ai", "image-generation", "dall-e", "imagen", "openai", "google", "byteplus"]
2121

2222
[project.urls]
2323
Homepage = "https://withceleste.ai"
@@ -28,6 +28,7 @@ Issues = "https://github.com/withceleste/celeste-python/issues"
2828
[tool.uv.sources]
2929
celeste-ai = { workspace = true }
3030
celeste-bfl = { workspace = true }
31+
celeste-byteplus = { workspace = true }
3132
celeste-google = { workspace = true }
3233
celeste-openai = { workspace = true }
3334

packages/capabilities/image-generation/src/celeste_image_generation/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
from celeste import Model
44
from celeste_image_generation.providers.bfl.models import MODELS as BFL_MODELS
5-
from celeste_image_generation.providers.bytedance.models import (
6-
MODELS as BYTEDANCE_MODELS,
5+
from celeste_image_generation.providers.byteplus.models import (
6+
MODELS as BYTEPLUS_MODELS,
77
)
88
from celeste_image_generation.providers.google.models import MODELS as GOOGLE_MODELS
99
from celeste_image_generation.providers.openai.models import MODELS as OPENAI_MODELS
1010

1111
MODELS: list[Model] = [
1212
*BFL_MODELS,
13-
*BYTEDANCE_MODELS,
13+
*BYTEPLUS_MODELS,
1414
*GOOGLE_MODELS,
1515
*OPENAI_MODELS,
1616
]

packages/capabilities/image-generation/src/celeste_image_generation/providers/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def _get_providers() -> list[tuple[Provider, type[Client]]]:
1111
from celeste_image_generation.providers.bfl.client import (
1212
BFLImageGenerationClient,
1313
)
14-
from celeste_image_generation.providers.bytedance.client import (
15-
ByteDanceImageGenerationClient,
14+
from celeste_image_generation.providers.byteplus.client import (
15+
BytePlusImageGenerationClient,
1616
)
1717
from celeste_image_generation.providers.google.client import (
1818
GoogleImageGenerationClient,
@@ -23,7 +23,7 @@ def _get_providers() -> list[tuple[Provider, type[Client]]]:
2323

2424
return [
2525
(Provider.BFL, BFLImageGenerationClient),
26-
(Provider.BYTEDANCE, ByteDanceImageGenerationClient),
26+
(Provider.BYTEPLUS, BytePlusImageGenerationClient),
2727
(Provider.GOOGLE, GoogleImageGenerationClient),
2828
(Provider.OPENAI, OpenAIImageGenerationClient),
2929
]

packages/capabilities/image-generation/src/celeste_image_generation/providers/bytedance/__init__.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/capabilities/image-generation/src/celeste_image_generation/providers/bytedance/client.py

Lines changed: 0 additions & 156 deletions
This file was deleted.

packages/capabilities/image-generation/src/celeste_image_generation/providers/bytedance/config.py

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/capabilities/image-generation/src/celeste_image_generation/providers/bytedance/parameters.py

Lines changed: 0 additions & 101 deletions
This file was deleted.

packages/capabilities/image-generation/src/celeste_image_generation/providers/bytedance/README.md renamed to packages/capabilities/image-generation/src/celeste_image_generation/providers/byteplus/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# ByteDance Image Generation Provider
1+
# BytePlus Image Generation Provider
22

33
## Credentials
44

5-
**Environment variable:** `BYTEDANCE_API_KEY`
5+
**Environment variable:** `BYTEPLUS_API_KEY`
66

77
**Setup:**
88
1. Register at [console.byteplus.com](https://console.byteplus.com)
99
2. Activate model in ModelArk section
1010
3. Generate API key with image generation permissions
11-
4. Set environment variable: `export BYTEDANCE_API_KEY="your-key"`
11+
4. Set environment variable: `export BYTEPLUS_API_KEY="your-key"`
1212

1313
**Note:** Models must be activated in BytePlus console before use. If you get a 404 error, activate the model or use an Endpoint ID (`ep-xxx`) instead of Model ID.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"""BytePlus provider for image generation."""
2+
3+
from .client import BytePlusImageGenerationClient
4+
from .models import MODELS
5+
6+
__all__ = ["MODELS", "BytePlusImageGenerationClient"]

0 commit comments

Comments
 (0)