Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: config default root models to allow new API fields #276

Open
wants to merge 1 commit into
base: releases
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion horde_sdk/ai_horde_api/apimodels/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ class ImageGenerateParamMixin(HordeAPIDataObject):
"""

model_config = (
ConfigDict(frozen=True) if not os.getenv("TESTS_ONGOING") else ConfigDict(frozen=True, extra="forbid")
ConfigDict(frozen=True, extra="allow")
if not os.getenv("TESTS_ONGOING")
else ConfigDict(frozen=True, extra="forbid")
)

sampler_name: KNOWN_SAMPLERS | str = KNOWN_SAMPLERS.k_lms
Expand Down
5 changes: 4 additions & 1 deletion horde_sdk/generic_api/apimodels.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class HordeAPIDataObject(BaseModel):
ConfigDict(
frozen=True,
use_attribute_docstrings=True,
extra="allow",
)
if not os.getenv("TESTS_ONGOING")
else ConfigDict(
Expand Down Expand Up @@ -98,7 +99,9 @@ class HordeResponseBaseModel(HordeResponse, BaseModel):
"""Base class for all Horde API response data models (leveraging pydantic)."""

model_config = (
ConfigDict(frozen=True) if not os.getenv("TESTS_ONGOING") else ConfigDict(frozen=True, extra="forbid")
ConfigDict(frozen=True, extra="allow")
if not os.getenv("TESTS_ONGOING")
else ConfigDict(frozen=True, extra="forbid")
)


Expand Down
Loading