Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test:

# Integration testing (requires API keys)
integration-test:
uv run pytest tests/integration_tests/ -m integration -v --dist=worksteal -n auto
uv run pytest packages/*/tests/integration_tests/ -m integration -v --dist=worksteal -n auto

# Security scanning (config reads from pyproject.toml)
security:
Expand Down
4 changes: 2 additions & 2 deletions packages/text-generation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "celeste-text-generation"
version = "0.1.0"
version = "0.1.1"
description = "Type-safe text generation for Celeste AI. Unified interface for OpenAI, Anthropic, Google, Mistral, Cohere, and more"
authors = [{name = "Kamilbenkirane", email = "kamil@withceleste.ai"}]
readme = "README.md"
Expand Down Expand Up @@ -29,7 +29,7 @@ Issues = "https://github.com/withceleste/celeste-python/issues"
celeste-ai = { workspace = true }

[project.entry-points."celeste.packages"]
text_generation = "celeste_text_generation:register_package"
text-generation = "celeste_text_generation:register_package"

[build-system]
requires = ["hatchling"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,6 @@
TextGenerationParameter.OUTPUT_SCHEMA: Schema(),
},
),
Model(
id="claude-sonnet-3-7",
provider=Provider.ANTHROPIC,
display_name="Claude Sonnet 3.7",
streaming=True,
parameter_constraints={
TextGenerationParameter.OUTPUT_SCHEMA: Schema(),
},
),
Model(
id="claude-opus-4-20250514",
provider=Provider.ANTHROPIC,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "celeste-ai"
version = "0.1.0"
version = "0.1.1"
description = "Open source, type-safe primitives for multi-modal AI. All capabilities, all providers, one interface"
authors = [{name = "Kamilbenkirane", email = "kamil@withceleste.ai"}]
readme = "README.md"
Expand Down
4 changes: 2 additions & 2 deletions src/celeste/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def model_post_init(self, __context: object) -> None:
"""Validate capability compatibility."""
if self.capability not in self.model.capabilities:
raise ValueError(
f"Model '{self.model.id}' does not support capability {self.capability.value}"
f"Model '{self.model.id}' does not support capability {self.capability}"
)

@property
Expand Down Expand Up @@ -240,7 +240,7 @@ def get_client_class(
"""
if (capability, provider) not in _clients:
raise NotImplementedError(
f"No client registered for {capability.value} with provider {provider.value}"
f"No client registered for {capability} with provider {provider}"
)
return _clients[(capability, provider)]

Expand Down
12 changes: 6 additions & 6 deletions src/celeste/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ class Capability(StrEnum):
"""Supported AI capabilities."""

# Text
TEXT_GENERATION = "text_generation"
TEXT_GENERATION = "text-generation"
EMBEDDINGS = "embeddings"

# Image
IMAGE_GENERATION = "image_generation"
IMAGE_INTELLIGENCE = "image_intelligence"
IMAGE_GENERATION = "image-generation"
IMAGE_INTELLIGENCE = "image-intelligence"

# Video
VIDEO_INTELLIGENCE = "video_intelligence"
VIDEO_GENERATION = "video_generation"
VIDEO_INTELLIGENCE = "video-intelligence"
VIDEO_GENERATION = "video-generation"

# Audio
AUDIO_INTELLIGENCE = "audio_intelligence"
AUDIO_INTELLIGENCE = "audio-intelligence"

# Search
SEARCH = "search"
Expand Down
1 change: 0 additions & 1 deletion tests/integration_tests/__init__.py

This file was deleted.

11 changes: 6 additions & 5 deletions tests/unit_tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_validation_failure_with_incompatible_capability(
# Arrange & Act & Assert
with pytest.raises(
ValidationError,
match=r"Model 'gpt-4' does not support capability image_generation",
match=rf"Model 'gpt-4' does not support capability {Capability.IMAGE_GENERATION}",
):
ConcreteClient(
model=text_model,
Expand Down Expand Up @@ -287,7 +287,7 @@ def test_validation_fails_with_model_lacking_any_capabilities(
# Act & Assert
with pytest.raises(
ValidationError,
match=r"Model 'broken-model' does not support capability text_generation",
match=rf"Model 'broken-model' does not support capability {Capability.TEXT_GENERATION}",
):
ConcreteClient(
model=empty_model,
Expand Down Expand Up @@ -335,7 +335,8 @@ def test_get_client_class_raises_for_unregistered_capability(self) -> None:

# Act & Assert
with pytest.raises(
NotImplementedError, match=r"No client registered for image_generation"
NotImplementedError,
match=rf"No client registered for {Capability.IMAGE_GENERATION}",
):
get_client_class(unregistered_capability, provider)

Expand Down Expand Up @@ -380,13 +381,13 @@ def test_registry_isolation_between_different_capabilities(self) -> None:
(
Capability.IMAGE_GENERATION,
Provider.ANTHROPIC,
"image_generation",
"image-generation",
"anthropic",
),
(
Capability.VIDEO_GENERATION,
Provider.OPENAI,
"video_generation",
"video-generation",
"openai",
),
],
Expand Down
12 changes: 6 additions & 6 deletions tests/unit_tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_capability_is_str_enum(self) -> None:
assert issubclass(Capability, Enum)
assert issubclass(Capability, str)
# Can create capability from string
cap = Capability("text_generation")
cap = Capability("text-generation")
assert cap == Capability.TEXT_GENERATION

def test_capability_set_operations(self) -> None:
Expand All @@ -103,19 +103,19 @@ def test_capability_values_are_unique(self) -> None:

# Act & Assert
assert text.value != image.value
assert text.value == "text_generation"
assert image.value == "image_generation"
assert text.value == "text-generation"
assert image.value == "image-generation"

def test_capability_string_conversion(self) -> None:
"""Capability converts from and to strings correctly."""
# Arrange & Act
from_string = Capability("text_generation")
from_string = Capability("text-generation")
from_enum = Capability.TEXT_GENERATION

# Assert
assert from_string == from_enum
assert from_enum.value == "text_generation"
assert from_enum == "text_generation"
assert from_enum.value == "text-generation"
assert from_enum == "text-generation"


class TestEnumImmutability:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_create_client_no_models_available_raises_error(self) -> None:

# Act & Assert
with pytest.raises(
ValueError, match=r"No model found for.*text_generation"
ValueError, match=rf"No model found for.*{Capability.TEXT_GENERATION}"
):
create_client(capability=Capability.TEXT_GENERATION)

Expand Down
Loading