Skip to content

Commit

Permalink
order of fields in structured outputs pydantic BaseModel matters (#175)
Browse files Browse the repository at this point in the history
Make it compatible with factgenie prompts
  • Loading branch information
oplatek authored Dec 18, 2024
1 parent 758d18b commit 5b4d576
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 5b4d576

Please sign in to comment.