output for result_var name is not needed
Browse files
python_code_executor_service.py
CHANGED
@@ -45,8 +45,8 @@ class CsvChatResult(BaseModel):
|
|
45 |
casual_response: str
|
46 |
# analysis_operations: List[AnalysisOperation]
|
47 |
# charts: Optional[List[ChartSpecification]] = None
|
48 |
-
analysis_operations: AnalysisOperation
|
49 |
-
charts: ChartSpecification = None
|
50 |
|
51 |
|
52 |
class PythonExecutor:
|
@@ -200,7 +200,7 @@ class PythonExecutor:
|
|
200 |
output_parts = [response.casual_response]
|
201 |
|
202 |
# Process single analysis operation
|
203 |
-
if response.analysis_operations:
|
204 |
operation = response.analysis_operations
|
205 |
execution_result = self.execute_code(operation.code.code)
|
206 |
|
@@ -223,7 +223,7 @@ class PythonExecutor:
|
|
223 |
output_parts.append("```\n" + output_str + "\n```")
|
224 |
|
225 |
# Process single chart
|
226 |
-
if response.charts:
|
227 |
output_parts.append("\n๐ Visualizations:")
|
228 |
chart = response.charts
|
229 |
if chart.code:
|
|
|
45 |
casual_response: str
|
46 |
# analysis_operations: List[AnalysisOperation]
|
47 |
# charts: Optional[List[ChartSpecification]] = None
|
48 |
+
analysis_operations: Optional[AnalysisOperation] = None
|
49 |
+
charts: Optional[ChartSpecification] = None
|
50 |
|
51 |
|
52 |
class PythonExecutor:
|
|
|
200 |
output_parts = [response.casual_response]
|
201 |
|
202 |
# Process single analysis operation
|
203 |
+
if response.analysis_operations is not None:
|
204 |
operation = response.analysis_operations
|
205 |
execution_result = self.execute_code(operation.code.code)
|
206 |
|
|
|
223 |
output_parts.append("```\n" + output_str + "\n```")
|
224 |
|
225 |
# Process single chart
|
226 |
+
if response.charts is not None:
|
227 |
output_parts.append("\n๐ Visualizations:")
|
228 |
chart = response.charts
|
229 |
if chart.code:
|