From fbd2b1b0800d01e3a938618b9e5dafdcd431db3c Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 30 Oct 2023 23:49:19 +0100 Subject: [PATCH 1/6] feat: add handling for GenerationMetadataStable --- horde_sdk/ai_horde_api/apimodels/base.py | 15 ++++++++++- .../apimodels/generate/_submit.py | 4 ++- horde_sdk/ai_horde_api/consts.py | 25 +++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/horde_sdk/ai_horde_api/apimodels/base.py b/horde_sdk/ai_horde_api/apimodels/base.py index 7f32f75..fb6c136 100644 --- a/horde_sdk/ai_horde_api/apimodels/base.py +++ b/horde_sdk/ai_horde_api/apimodels/base.py @@ -8,7 +8,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from typing_extensions import override -from horde_sdk.ai_horde_api.consts import KNOWN_SAMPLERS, POST_PROCESSOR_ORDER_TYPE +from horde_sdk.ai_horde_api.consts import KNOWN_SAMPLERS, POST_PROCESSOR_ORDER_TYPE, METADATA_TYPE, METADATA_VALUE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_BASE_URL from horde_sdk.ai_horde_api.fields import JobID, WorkerID from horde_sdk.generic_api.apimodels import HordeRequest, HordeResponseBaseModel @@ -198,3 +198,16 @@ class JobSubmitResponse(HordeResponseBaseModel): @classmethod def get_api_model_name(cls) -> str | None: return "GenerationSubmitted" + +class GenMetadataEntry(BaseModel): + """Represents a single generation metadata entry. + + v2 API Model: `GenerationMetadataStable` + """ + + type_: METADATA_TYPE = Field(alias="type") + """The relevance of the metadata field.""" + value: METADATA_VALUE = Field() + """The value of the metadata field.""" + ref: str = Field(le=255) + """Optionally a reference for the metadata (e.g. a lora ID)""" diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py index 0fe9157..228971d 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py @@ -4,7 +4,7 @@ from pydantic import model_validator from typing_extensions import override -from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest, JobRequestMixin, JobSubmitResponse +from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest, JobRequestMixin, JobSubmitResponse, GenMetadataEntry from horde_sdk.ai_horde_api.consts import GENERATION_STATE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_API_ENDPOINT_SUBPATH from horde_sdk.consts import HTTPMethod @@ -25,6 +25,8 @@ class ImageGenerationJobSubmitRequest(BaseAIHordeRequest, JobRequestMixin, APIKe """The seed for this generation.""" censored: bool = False """If True, this resulting image has been censored.""" + gen_metadata: GenMetadataEntry = None + """Extra metadata about faulted or defaulted componets of the generation""" @model_validator(mode="after") def validate_generation(self) -> ImageGenerationJobSubmitRequest: diff --git a/horde_sdk/ai_horde_api/consts.py b/horde_sdk/ai_horde_api/consts.py index 972ff60..823bda4 100644 --- a/horde_sdk/ai_horde_api/consts.py +++ b/horde_sdk/ai_horde_api/consts.py @@ -180,3 +180,28 @@ class KNOWN_ALCHEMY_TYPES(StrEnum): CodeFormers = KNOWN_FACEFIXERS.GFPGAN strip_background = KNOWN_MISC_POST_PROCESSORS.strip_background + +class METADATA_TYPE(StrEnum): + """The generation metadata types that are known to the API. + + (lora, ti, censorship, etc) + """ + + lora = auto() + ti = auto() + censorship = auto() + source_image = auto() + source_mask = auto() + +class METADATA_VALUE(StrEnum): + """The generation metadata values that are known to the API. + + (download_failed, baseline_mismatch, etc) + """ + + download_failed = auto() + parse_failed = auto() + baseline_mismatch = auto() + csam = auto() + nsfw = auto() + From 553f0d509cb78fd542e3d2e4836ac81cb12df732 Mon Sep 17 00:00:00 2001 From: db0 Date: Mon, 30 Oct 2023 23:58:07 +0100 Subject: [PATCH 2/6] chore: updated APIs --- .gitignore | 1 + .../example_payloads/_v2_generate_submit_post.json | 9 ++++++++- .../example_payloads/_v2_generate_text_async_post.json | 5 ++++- .../example_payloads/_v2_generate_text_submit_post.json | 9 ++++++++- .../_v2_generate_status_id_delete_200.json | 9 ++++++++- .../_v2_generate_status_id_get_200.json | 9 ++++++++- .../_v2_generate_text_pop_post_200.json | 3 +++ .../_v2_generate_text_status_id_delete_200.json | 9 ++++++++- .../_v2_generate_text_status_id_get_200.json | 9 ++++++++- 9 files changed, 56 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index ca9ee48..00f48be 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ out.json .vscode/settings.json examples/requested_images/*.* +_version.py \ No newline at end of file diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_submit_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_submit_post.json index 02f4b2d..b29e216 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_submit_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_submit_post.json @@ -3,5 +3,12 @@ "generation": "R2", "state": "ok", "seed": 0, - "censored": false + "censored": false, + "gen_metadata": [ + { + "type": "lora", + "value": "download_failed", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json index e243893..83293f1 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_async_post.json @@ -21,7 +21,10 @@ "sampler_order": [ 0 ], - "use_default_badwordsids": true + "use_default_badwordsids": true, + "stop_sequence": [ + "" + ] }, "softprompt": "a", "trusted_workers": false, diff --git a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_submit_post.json b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_submit_post.json index 3450bf4..387ca75 100644 --- a/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_submit_post.json +++ b/tests/test_data/ai_horde_api/example_payloads/_v2_generate_text_submit_post.json @@ -1,5 +1,12 @@ { "id": "00000000-0000-0000-0000-000000000000", "generation": "R2", - "state": "ok" + "state": "ok", + "gen_metadata": [ + { + "type": "censorship", + "value": "csam", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_delete_200.json index 9700fca..cee94c9 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_delete_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_delete_200.json @@ -18,7 +18,14 @@ "img": "", "seed": "", "id": "", - "censored": false + "censored": false, + "gen_metadata": [ + { + "type": "lora", + "value": "download_failed", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } ], "shared": false diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_get_200.json index 9700fca..cee94c9 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_status_id_get_200.json @@ -18,7 +18,14 @@ "img": "", "seed": "", "id": "", - "censored": false + "censored": false, + "gen_metadata": [ + { + "type": "lora", + "value": "download_failed", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } ], "shared": false diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json index c6b4857..0f2b55f 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_pop_post_200.json @@ -21,6 +21,9 @@ 0 ], "use_default_badwordsids": true, + "stop_sequence": [ + "" + ], "prompt": "" }, "id": "", diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_delete_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_delete_200.json index d2a8e3c..acd42f5 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_delete_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_delete_200.json @@ -16,7 +16,14 @@ "model": "", "state": "ok", "text": "", - "seed": 0 + "seed": 0, + "gen_metadata": [ + { + "type": "censorship", + "value": "csam", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } ] } diff --git a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_get_200.json b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_get_200.json index d2a8e3c..acd42f5 100644 --- a/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_get_200.json +++ b/tests/test_data/ai_horde_api/example_responses/_v2_generate_text_status_id_get_200.json @@ -16,7 +16,14 @@ "model": "", "state": "ok", "text": "", - "seed": 0 + "seed": 0, + "gen_metadata": [ + { + "type": "censorship", + "value": "csam", + "ref": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" + } + ] } ] } From cc81f7990d347fd25bf5d5763cca80356d262860 Mon Sep 17 00:00:00 2001 From: db0 Date: Tue, 31 Oct 2023 00:01:08 +0100 Subject: [PATCH 3/6] chore: lint --- .gitignore | 2 +- docs/request_field_names_and_descriptions.json | 6 +++++- docs/response_field_names_and_descriptions.json | 2 +- horde_sdk/ai_horde_api/apimodels/base.py | 1 + horde_sdk/ai_horde_api/apimodels/generate/_submit.py | 7 ++++++- horde_sdk/ai_horde_api/consts.py | 3 ++- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 00f48be..b3d07ea 100644 --- a/.gitignore +++ b/.gitignore @@ -140,4 +140,4 @@ out.json .vscode/settings.json examples/requested_images/*.* -_version.py \ No newline at end of file +_version.py diff --git a/docs/request_field_names_and_descriptions.json b/docs/request_field_names_and_descriptions.json index 5704fc1..ab5077f 100644 --- a/docs/request_field_names_and_descriptions.json +++ b/docs/request_field_names_and_descriptions.json @@ -345,6 +345,10 @@ [ "censored", null + ], + [ + "gen_metadata", + null ] ], "StatsImageModelsRequest": [ @@ -357,4 +361,4 @@ null ] ] -} +} \ No newline at end of file diff --git a/docs/response_field_names_and_descriptions.json b/docs/response_field_names_and_descriptions.json index c9831c3..ead830e 100644 --- a/docs/response_field_names_and_descriptions.json +++ b/docs/response_field_names_and_descriptions.json @@ -351,4 +351,4 @@ null ] ] -} +} \ No newline at end of file diff --git a/horde_sdk/ai_horde_api/apimodels/base.py b/horde_sdk/ai_horde_api/apimodels/base.py index fb6c136..352b613 100644 --- a/horde_sdk/ai_horde_api/apimodels/base.py +++ b/horde_sdk/ai_horde_api/apimodels/base.py @@ -199,6 +199,7 @@ class JobSubmitResponse(HordeResponseBaseModel): def get_api_model_name(cls) -> str | None: return "GenerationSubmitted" + class GenMetadataEntry(BaseModel): """Represents a single generation metadata entry. diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py index 228971d..a699765 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py @@ -4,7 +4,12 @@ from pydantic import model_validator from typing_extensions import override -from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest, JobRequestMixin, JobSubmitResponse, GenMetadataEntry +from horde_sdk.ai_horde_api.apimodels.base import ( + BaseAIHordeRequest, + JobRequestMixin, + JobSubmitResponse, + GenMetadataEntry, +) from horde_sdk.ai_horde_api.consts import GENERATION_STATE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_API_ENDPOINT_SUBPATH from horde_sdk.consts import HTTPMethod diff --git a/horde_sdk/ai_horde_api/consts.py b/horde_sdk/ai_horde_api/consts.py index 823bda4..663cf4c 100644 --- a/horde_sdk/ai_horde_api/consts.py +++ b/horde_sdk/ai_horde_api/consts.py @@ -181,6 +181,7 @@ class KNOWN_ALCHEMY_TYPES(StrEnum): strip_background = KNOWN_MISC_POST_PROCESSORS.strip_background + class METADATA_TYPE(StrEnum): """The generation metadata types that are known to the API. @@ -193,6 +194,7 @@ class METADATA_TYPE(StrEnum): source_image = auto() source_mask = auto() + class METADATA_VALUE(StrEnum): """The generation metadata values that are known to the API. @@ -204,4 +206,3 @@ class METADATA_VALUE(StrEnum): baseline_mismatch = auto() csam = auto() nsfw = auto() - From 3f2530de625c9d4df7154ddaa0aae1588644303f Mon Sep 17 00:00:00 2001 From: db0 Date: Tue, 31 Oct 2023 00:03:39 +0100 Subject: [PATCH 4/6] chore: lint --- docs/request_field_names_and_descriptions.json | 2 +- docs/response_field_names_and_descriptions.json | 2 +- horde_sdk/ai_horde_api/apimodels/base.py | 2 +- horde_sdk/ai_horde_api/apimodels/generate/_submit.py | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/request_field_names_and_descriptions.json b/docs/request_field_names_and_descriptions.json index ab5077f..02e6118 100644 --- a/docs/request_field_names_and_descriptions.json +++ b/docs/request_field_names_and_descriptions.json @@ -361,4 +361,4 @@ null ] ] -} \ No newline at end of file +} diff --git a/docs/response_field_names_and_descriptions.json b/docs/response_field_names_and_descriptions.json index ead830e..c9831c3 100644 --- a/docs/response_field_names_and_descriptions.json +++ b/docs/response_field_names_and_descriptions.json @@ -351,4 +351,4 @@ null ] ] -} \ No newline at end of file +} diff --git a/horde_sdk/ai_horde_api/apimodels/base.py b/horde_sdk/ai_horde_api/apimodels/base.py index 352b613..fd761ff 100644 --- a/horde_sdk/ai_horde_api/apimodels/base.py +++ b/horde_sdk/ai_horde_api/apimodels/base.py @@ -8,7 +8,7 @@ from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator from typing_extensions import override -from horde_sdk.ai_horde_api.consts import KNOWN_SAMPLERS, POST_PROCESSOR_ORDER_TYPE, METADATA_TYPE, METADATA_VALUE +from horde_sdk.ai_horde_api.consts import KNOWN_SAMPLERS, METADATA_TYPE, METADATA_VALUE, POST_PROCESSOR_ORDER_TYPE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_BASE_URL from horde_sdk.ai_horde_api.fields import JobID, WorkerID from horde_sdk.generic_api.apimodels import HordeRequest, HordeResponseBaseModel diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py index a699765..afac484 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py @@ -6,9 +6,9 @@ from horde_sdk.ai_horde_api.apimodels.base import ( BaseAIHordeRequest, + GenMetadataEntry, JobRequestMixin, JobSubmitResponse, - GenMetadataEntry, ) from horde_sdk.ai_horde_api.consts import GENERATION_STATE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_API_ENDPOINT_SUBPATH @@ -30,8 +30,8 @@ class ImageGenerationJobSubmitRequest(BaseAIHordeRequest, JobRequestMixin, APIKe """The seed for this generation.""" censored: bool = False """If True, this resulting image has been censored.""" - gen_metadata: GenMetadataEntry = None - """Extra metadata about faulted or defaulted componets of the generation""" + gen_metadata: GenMetadataEntry | None = None + """Extra metadata about faulted or defaulted components of the generation""" @model_validator(mode="after") def validate_generation(self) -> ImageGenerationJobSubmitRequest: From 577d1b2d4e165a0d7b6962c291a86c2d5e036a11 Mon Sep 17 00:00:00 2001 From: db0 Date: Tue, 31 Oct 2023 00:13:49 +0100 Subject: [PATCH 5/6] failing --- horde_sdk/ai_horde_api/apimodels/generate/_status.py | 4 +++- horde_sdk/ai_horde_api/apimodels/generate/_submit.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_status.py b/horde_sdk/ai_horde_api/apimodels/generate/_status.py index bfb5088..e62c7ae 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_status.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_status.py @@ -4,7 +4,7 @@ from pydantic import BaseModel, Field, field_validator from typing_extensions import override -from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest, JobRequestMixin +from horde_sdk.ai_horde_api.apimodels.base import BaseAIHordeRequest, GenMetadataEntry, JobRequestMixin from horde_sdk.ai_horde_api.apimodels.generate._progress import ResponseGenerationProgressMixin from horde_sdk.ai_horde_api.consts import GENERATION_STATE from horde_sdk.ai_horde_api.endpoints import AI_HORDE_API_ENDPOINT_SUBPATH @@ -36,6 +36,8 @@ class ImageGeneration(BaseModel): """The seed which generated this image.""" censored: bool """When true this image has been censored by the worker's safety filter.""" + gen_metadata: list[GenMetadataEntry] | None = None + """Extra metadata about faulted or defaulted components of the generation""" @field_validator("id_", mode="before") def validate_id(cls, v: str | JobID) -> JobID | str: diff --git a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py index afac484..50b14fd 100644 --- a/horde_sdk/ai_horde_api/apimodels/generate/_submit.py +++ b/horde_sdk/ai_horde_api/apimodels/generate/_submit.py @@ -30,7 +30,7 @@ class ImageGenerationJobSubmitRequest(BaseAIHordeRequest, JobRequestMixin, APIKe """The seed for this generation.""" censored: bool = False """If True, this resulting image has been censored.""" - gen_metadata: GenMetadataEntry | None = None + gen_metadata: list[GenMetadataEntry] | None = None """Extra metadata about faulted or defaulted components of the generation""" @model_validator(mode="after") From e0e9ac23e50b00b5f5ae01aba3f67c8a28832834 Mon Sep 17 00:00:00 2001 From: db0 Date: Tue, 31 Oct 2023 00:21:49 +0100 Subject: [PATCH 6/6] fix: max_length --- horde_sdk/ai_horde_api/apimodels/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/horde_sdk/ai_horde_api/apimodels/base.py b/horde_sdk/ai_horde_api/apimodels/base.py index fd761ff..77fdbf5 100644 --- a/horde_sdk/ai_horde_api/apimodels/base.py +++ b/horde_sdk/ai_horde_api/apimodels/base.py @@ -210,5 +210,5 @@ class GenMetadataEntry(BaseModel): """The relevance of the metadata field.""" value: METADATA_VALUE = Field() """The value of the metadata field.""" - ref: str = Field(le=255) + ref: str = Field(max_length=255) """Optionally a reference for the metadata (e.g. a lora ID)"""