HarishMaths commited on
Commit
295049e
·
verified ·
1 Parent(s): 47c0299

Upload output_schema.py

Browse files
Files changed (1) hide show
  1. src/output_schema.py +37 -0
src/output_schema.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from typing import List, Optional, Union
2
+ from pydantic import BaseModel, Field
3
+
4
+ class LLMCorrectionOutput(BaseModel):
5
+ text: List[str] = Field(
6
+ ...,
7
+ description="A list of exact text fragments from the Jupyter notebook cells where corrections need to be applied. Each fragment must be minimal and only include the part with issues."
8
+ )
9
+ corrected_text: List[str] = Field(
10
+ ...,
11
+ description="A list of corrected text fragments, aligned by index with `text`. Each entry must contain only the corrected version."
12
+ )
13
+ is_grammar_error: List[bool] = Field(
14
+ ...,
15
+ description="A list of booleans aligned by index with `text`. True if the issue is a grammatical/punctuation/capitalization/spelling error, False if it is a stylistic enhancement."
16
+ )
17
+
18
+ class LLMFactualCheckOutput(BaseModel):
19
+ text: List[str] = Field(
20
+ ...,
21
+ description="Exact text fragments from the notebook that contain factual errors."
22
+ )
23
+ corrected_text: List[str] = Field(
24
+ ...,
25
+ description="Corrected factual statements aligned with `text`."
26
+ )
27
+
28
+ class EvaluationSuggestions(BaseModel):
29
+ key_suggestions: List[str] = Field(
30
+ description="A list of actionable suggestions that highlight the most critical improvements across business context, objectives, conclusions & recommendations, and alignment."
31
+ )
32
+
33
+ class NotebookFlowEvaluation(BaseModel):
34
+ suggestions: List[str] = Field(
35
+ ...,
36
+ description="Actionable suggestions to improve the notebook's logical flow, instructional design, or overall quality."
37
+ )