File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,9 +80,8 @@ def parse_response(self, input_str: str):
8080 if not in_code_block :
8181 ignore_code_block = False
8282 else :
83- if line .strip ():
84- is_code = in_code_block and not ignore_code_block
85- result .append ({"code" : is_code , "content" : line })
83+ is_code = in_code_block and not ignore_code_block
84+ result .append ({"code" : is_code , "content" : line })
8685 return result
8786
8887 def execute_code (self , code : str ):
@@ -124,9 +123,9 @@ def run(self):
124123
125124 for r in gpt_response_parsed :
126125 if r ["code" ]:
127- print (f"{ COLOR_GREEN } { r ['content' ]} { COLOR_RESET } \n " )
126+ print (f"{ COLOR_GREEN } { r ['content' ]} { COLOR_RESET } " )
128127 else :
129- print (f"{ COLOR_GRAY } { r ['content' ]} { COLOR_RESET } \n " )
128+ print (f"{ COLOR_GRAY } { r ['content' ]} { COLOR_RESET } " )
130129
131130 if gpt_code .strip ():
132131 result = self .execute_code (gpt_code )
You can’t perform that action at this time.
0 commit comments