Spaces:
Build error
Build error
allow for mixed response
Browse files
planning_ai/chains/map_chain.py
CHANGED
@@ -32,8 +32,9 @@ class BriefSummary(BaseModel):
|
|
32 |
"""A summary of the response with generated metadata"""
|
33 |
|
34 |
summary: str = Field(..., description="A summary of the response.")
|
35 |
-
stance: Literal["SUPPORT", "OPPOSE", "NEUTRAL"] = Field(
|
36 |
-
...,
|
|
|
37 |
)
|
38 |
aims: list[Aim] = Field(
|
39 |
..., description="A list of aims associated with the response."
|
@@ -47,12 +48,6 @@ class BriefSummary(BaseModel):
|
|
47 |
description="How constructive the response is, from a rating of 1 to 10.",
|
48 |
)
|
49 |
|
50 |
-
@validator("summary")
|
51 |
-
def summary_must_not_be_empty(cls, v):
|
52 |
-
if not v.strip():
|
53 |
-
raise ValueError("Summary cannot be empty.")
|
54 |
-
return v
|
55 |
-
|
56 |
def __str__(self) -> str:
|
57 |
return f"{self.summary}\n" f"Related Aims: {self.aims}"
|
58 |
|
|
|
32 |
"""A summary of the response with generated metadata"""
|
33 |
|
34 |
summary: str = Field(..., description="A summary of the response.")
|
35 |
+
stance: Literal["SUPPORT", "OPPOSE", "MIXED", "NEUTRAL"] = Field(
|
36 |
+
...,
|
37 |
+
description="Overall stance of the response. Either SUPPORT, OPPOSE, MIXED, or NEUTRAL.",
|
38 |
)
|
39 |
aims: list[Aim] = Field(
|
40 |
..., description="A list of aims associated with the response."
|
|
|
48 |
description="How constructive the response is, from a rating of 1 to 10.",
|
49 |
)
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
def __str__(self) -> str:
|
52 |
return f"{self.summary}\n" f"Related Aims: {self.aims}"
|
53 |
|