@@ -107,31 +107,16 @@ def convert(self, question:str, solution:str) -> Question:
107
107
)
108
108
109
109
final_prompt = ChatPromptTemplate .from_messages (
110
- [
111
- ("system" , """You are intelligent assistant to process the given input question,
112
- Please analyze the input question and respond with:
113
- 1. Main Content (String).
114
- 2. Relevant parts (Comma and new line separated list).
115
- Use format: "Main Content: <string>\\ nParts: <Part1>, \\ n<Part2>, \\ n...""" ),
116
- few_shot_prompt ,
117
- ("human" , "{input}" ),
118
- ]
119
- )
120
-
121
- # print(few_shot_prompt.format())
122
-
123
- # prompt = ChatPromptTemplate.from_messages([
124
- # SystemMessage(content="""Analyze text and respond with:
125
- # 1. Main Content (string)
126
- # 2. Relevant parts (coma and new line seperated list)
127
- # Use format: "Main Content: <string>\\nParts: <Part1>, \\n<Part2>, \\n..."""),
128
- # *[
129
- # HumanMessage(content=ex["input"])
130
- # for ex in self.examples
131
- # ],
132
- # *[AIMessage(content=f"Main Content: {ex['output'][0]} Parts: {', '.join(ex['output'][1])}") for ex in self.examples],
133
- # HumanMessage(content="{input}")
134
- # ])
110
+ [
111
+ ("system" , """You are intelligent assistant to process the given input question,
112
+ Please analyze the input question and respond with:
113
+ 1. Main Content (String).
114
+ 2. Relevant parts (Comma and new line separated list).
115
+ Use format: "Main Content: <string>\\ nParts: <Part1>, \\ n<Part2>, \\ n...""" ),
116
+ few_shot_prompt ,
117
+ ("human" , "{input}" ),
118
+ ]
119
+ )
135
120
136
121
chain = final_prompt | self .llm
137
122
@@ -152,5 +137,6 @@ def convert(self, question:str, solution:str) -> Question:
152
137
{\\ rm (f)}\\ hskip5pt \\ displaystyle{1\\ over i}
153
138
\\ end{array}
154
139
$'''
140
+ test_question2 = "Which city is the capital of China? \\ item Beijing \\ item Shanghai \\ item Guangzhou"
155
141
test_converter = QuestionConverter ()
156
- test_converter .convert (test_question , "" )
142
+ test_converter .convert (test_question2 , "" )
0 commit comments