Skip to content

Commit 258266c

Browse files
authored
Merge pull request #30 from Sathvika-891/main
updated with one shot and base cot
2 parents 1e965ad + 89a1a3e commit 258266c

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

maslibpy/prompts/cot/cot_prompts.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
from typing import ClassVar
33

44
class CoT(BaseModel):
5-
available_patterns: ClassVar[list] = ['cot','reflection']
6-
# available_patterns: ClassVar[list] = ['cot', 'one_shot']
5+
6+
available_patterns: ClassVar[list] = ['cot', 'one_shot']
77

88
cot: bool = Field(default=False, description="Default cot prompt")
9-
reflection: bool = Field(default=False, description="Flag to use reflection")
10-
# one_shot: bool = Field(default=False, description="Cot prompt with single example")
9+
one_shot: bool = Field(default=False, description="Cot prompt with single example")
1110

1211
@model_validator(mode="before")
1312
@classmethod
@@ -73,16 +72,7 @@ def get_reflection_prompt(self):
7372

7473
def fetch_prompt(self):
7574
"""Returns the correct prompt based on the selected flag."""
76-
if self.reflection:
77-
return self.get_reflection_prompt()
78-
# elif self.cot:
75+
if self.one_shot:
76+
return self.get_cot_oneshot_prompt()
7977
self.cot=True
80-
return self.get_cot_prompt()
81-
# else:
82-
# raise Exception("Invalid Pattern Passed ,Available patterns are",self.available_patterns)
83-
84-
85-
# if self.one_shot:
86-
# return self.get_cot_oneshot_prompt()
87-
# self.cot=True
88-
# return self.get_cot_prompt()
78+
return self.get_cot_prompt()

0 commit comments

Comments
 (0)