zyratlo commented on code in PR #8910:
URL: https://github.com/apache/texera/pull/8910#discussion_r4391230927
##########
frontend/src/app/workspace/service/notebook-migration/migration-llm.ts:
##########
@@ -111,15 +111,66 @@ function toDerivedNotebook(cells: DerivedCell[]):
Notebook {
outputs: [],
execution_count: null,
})),
- metadata: {
- kernelspec: { display_name: "Python 3", language: "python", name:
"python3" },
- language_info: { name: "python" },
- },
+ metadata: structuredClone(metadata),
nbformat: 4,
nbformat_minor: 4,
};
}
+const PYTHON_NOTEBOOK_DOCUMENTATION: string[] = [
+ TEXERA_OVERVIEW,
+ TUPLE_DOCUMENTATION,
+ TABLE_DOCUMENTATION,
+ OPERATOR_DOCUMENTATION,
+ EXAMPLE_OF_GOOD_CONVERSION,
+ VISUALIZER_DOCUMENTATION,
+ UDF_INPUT_PORT_DOCUMENTATION,
+ EXAMPLE_OF_MULTIPLE_UDF_CONVERSION,
+];
+
+// The script prelude differs in exactly one entry. The notebook worked
example is written in
+// `# START CELL1` form, and a system-message example of that weight would
push the model to
+// answer in cell ids for an input that has no cells. The notebook array is
left untouched so
+// existing conversions see byte-identical context.
+const PYTHON_SCRIPT_DOCUMENTATION: string[] =
PYTHON_NOTEBOOK_DOCUMENTATION.map(doc =>
+ doc === EXAMPLE_OF_MULTIPLE_UDF_CONVERSION ?
EXAMPLE_OF_MULTIPLE_UDF_CONVERSION_SCRIPT : doc
+);
+
+// Differs from the script prelude in the same single entry: its worked
example shows banner
+// lines, an entry point calling into other files, and definitions inlined
rather than imported.
+const PYTHON_FOLDER_DOCUMENTATION: string[] =
PYTHON_SCRIPT_DOCUMENTATION.map(doc =>
+ doc === EXAMPLE_OF_MULTIPLE_UDF_CONVERSION_SCRIPT ?
EXAMPLE_OF_MULTIPLE_UDF_CONVERSION_FOLDER : doc
+);
+
+export type MigrationLanguage = "python";
+
+interface MigrationPromptSet {
+ notebookDocumentation: string[];
+ notebookWorkflowPrompt: string;
+ notebookMappingPrompt: string;
+ scriptDocumentation: string[];
+ scriptWorkflowPrompt: string;
+ scriptMappingPrompt: string;
+ operatorType: string;
Review Comment:
The frontend has no compile time operator registry. Operator types come from
backend metadata at runtime, and `OperatorPredicate["operatorType"]` is
`string`. The one literal per language is covered by tests: the spec asserts
`PythonUDFV2` for Python, and the R PR's specs assert `RUDF`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]