Spaces:
Build error
Build error
add field descriptions
Browse files
planning_ai/chains/map_chain.py
CHANGED
@@ -24,8 +24,8 @@ class Aim(str, Enum):
|
|
24 |
|
25 |
|
26 |
class Place(BaseModel):
|
27 |
-
place: str
|
28 |
-
sentiment: int
|
29 |
|
30 |
|
31 |
class BriefSummary(BaseModel):
|
@@ -40,7 +40,7 @@ class BriefSummary(BaseModel):
|
|
40 |
)
|
41 |
places: Optional[list[Place]] = Field(
|
42 |
...,
|
43 |
-
description="
|
44 |
)
|
45 |
rating: int = Field(
|
46 |
...,
|
@@ -72,3 +72,4 @@ if __name__ == "__main__":
|
|
72 |
"""
|
73 |
|
74 |
result = map_chain.invoke({"context": test_document})
|
|
|
|
24 |
|
25 |
|
26 |
class Place(BaseModel):
|
27 |
+
place: str = Field(..., description="Place mentioned in the response.")
|
28 |
+
sentiment: int = Field(..., description="Related sentiment ranked 1 to 10.")
|
29 |
|
30 |
|
31 |
class BriefSummary(BaseModel):
|
|
|
40 |
)
|
41 |
places: Optional[list[Place]] = Field(
|
42 |
...,
|
43 |
+
description="All places mentioned in the response, with the positivity of the related sentiment ranked 1 to 10",
|
44 |
)
|
45 |
rating: int = Field(
|
46 |
...,
|
|
|
72 |
"""
|
73 |
|
74 |
result = map_chain.invoke({"context": test_document})
|
75 |
+
print(result)
|