Graphify / schemas.py
Game4all's picture
Initial commit
51f2dc1
raw
history blame
1.19 kB
from pydantic import BaseModel, Field
# ============================================= Entity + Relations extraction
class ExtractEntitiesRequest(BaseModel):
content: str
class ExtractEntitiesResponse(BaseModel):
entities: list[str] = Field(..., description="A list of entities")
class ExtractedRelation(BaseModel):
start: str = Field(..., description="The first entity in the relationship")
to: str = Field(..., description="The second entity of the relationship")
tag: str = Field(..., description="A tag describing the relationship", examples=[
"related_to", "born_in", "made", "created"])
description: str = Field(...,
description="A detailled description of the relationship")
class ExtractedRelationsResponse(BaseModel):
relations: list[ExtractedRelation]
# ======================================================== Create search plan ==================
class CreateSearchPlanRequest(BaseModel):
query: str
class CreateSearchPlanResponse(BaseModel):
sub_queries: list[str] = Field(...,
description="A list of subqueries formulated as questions")