cjber commited on
Commit
0d9117e
·
1 Parent(s): 9a4ccc3

add documentation

Browse files
Files changed (1) hide show
  1. planning_ai/states.py +30 -0
planning_ai/states.py CHANGED
@@ -7,6 +7,22 @@ from planning_ai.chains.map_chain import BriefSummary
7
 
8
 
9
  class OverallState(TypedDict):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  documents: list[str]
11
 
12
  final_summary: str
@@ -19,6 +35,20 @@ class OverallState(TypedDict):
19
 
20
 
21
  class DocumentState(TypedDict):
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  document: str
23
  summary: BriefSummary
24
  hallucination: HallucinationChecker
 
7
 
8
 
9
  class OverallState(TypedDict):
10
+ """Represents the overall state of document processing.
11
+
12
+ This class is a TypedDict that encapsulates the overall state of the document
13
+ processing workflow. It includes information about the documents, summaries,
14
+ hallucinations, filenames, and iterations.
15
+
16
+ Attributes:
17
+ documents (list[str]): A list of document texts.
18
+ final_summary (str): The final aggregated summary of all documents.
19
+ summaries (Annotated[list, operator.add]): A list of initial summaries for each document.
20
+ summaries_fixed (Annotated[list, operator.add]): A list of summaries after fixing hallucinations.
21
+ hallucinations (Annotated[list, operator.add]): A list of detected hallucinations in summaries.
22
+ filenames (List[Path]): A list of file paths corresponding to the documents.
23
+ iterations (list[int]): A list of iteration counts for processing each document.
24
+ """
25
+
26
  documents: list[str]
27
 
28
  final_summary: str
 
35
 
36
 
37
  class DocumentState(TypedDict):
38
+ """Represents the state of an individual document during processing.
39
+
40
+ This class is a TypedDict that encapsulates the state of a single document
41
+ during the processing workflow. It includes the document text, summary,
42
+ hallucination details, filename, and iteration count.
43
+
44
+ Attributes:
45
+ document (str): The text of the document.
46
+ summary (BriefSummary): The summary of the document.
47
+ hallucination (HallucinationChecker): The hallucination details for the document's summary.
48
+ filename (Path): The file path of the document.
49
+ iteration (int): The current iteration count for processing the document.
50
+ """
51
+
52
  document: str
53
  summary: BriefSummary
54
  hallucination: HallucinationChecker