From 5b4d576f33062134f9d7e1081c4c5d0c08840188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Pl=C3=A1tek?= Date: Wed, 18 Dec 2024 16:12:32 +0100 Subject: [PATCH] order of fields in structured outputs pydantic BaseModel matters (#175) Make it compatible with factgenie prompts --- factgenie/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/factgenie/models.py b/factgenie/models.py index e4dd73b..9bde9b4 100644 --- a/factgenie/models.py +++ b/factgenie/models.py @@ -53,12 +53,12 @@ def from_config(config, mode): class SpanAnnotation(BaseModel): + reason: str = Field(description="The reason for the annotation.") text: str = Field(description="The text which is annotated.") # Do not name it type since it is a reserved keyword in JSON schema annotation_type: int = Field( description="Index to the list of span annotation types defined for the annotation campaign." ) - reason: str = Field(description="The reason for the annotation.") class OutputAnnotations(BaseModel):