Skip to content

Commit

Permalink
order of fields in structured outputs pydantic BaseModel matters
Browse files Browse the repository at this point in the history
Make it compatible with factgenie prompts
  • Loading branch information
oplatek committed Dec 18, 2024
1 parent 758d18b commit d841377
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion factgenie/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit d841377

Please sign in to comment.