diff --git a/arcllm/__init__.py b/arcllm/__init__.py index 4647f80..debf79c 100644 --- a/arcllm/__init__.py +++ b/arcllm/__init__.py @@ -69,7 +69,7 @@ from __future__ import annotations -__version__ = "0.4.1" +__version__ = "0.4.2" __all__ = [ "APIConnectionError", "APIError", diff --git a/arcllm/types.py b/arcllm/types.py index fbb4412..8091392 100644 --- a/arcllm/types.py +++ b/arcllm/types.py @@ -427,11 +427,17 @@ def model_dump(self) -> dict[str, Any]: class EmbeddingResponse(msgspec.Struct): - """Response from an embedding request.""" + """Response from an embedding request. - model: str - data: list[EmbeddingData] - usage: EmbeddingUsage + All fields default — matches the litellm-compat contract where test + fixtures construct ``EmbeddingResponse()`` with no args and populate + fields after the fact. Adapters always set every field on real + responses, so this is purely for caller ergonomics. + """ + + model: str = "" + data: list[EmbeddingData] = [] + usage: EmbeddingUsage | None = None object: str = "list" def model_dump(self) -> dict[str, Any]: @@ -439,7 +445,7 @@ def model_dump(self) -> dict[str, Any]: return { "model": self.model, "data": [d.model_dump() for d in self.data], - "usage": self.usage.model_dump(), + "usage": self.usage.model_dump() if self.usage is not None else None, "object": self.object, } diff --git a/pyproject.toml b/pyproject.toml index 0b7db88..d46cbc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "arcllm-sdk" -version = "0.4.1" +version = "0.4.2" description = "The arc connecting you to every LLM. Minimal dependencies, maximum performance." readme = "README.md" license = "Apache-2.0"