feat(orchestrator): Harden VFS and enhance artifact awareness across workers
This commit is contained in:
@@ -9,6 +9,14 @@ The user will provide a task and a plan.
|
||||
- Do NOT assume a dataframe `df` is already loaded unless explicitly stated. You usually need to query it first.
|
||||
- The database schema is described in the prompt. Use it to construct valid SQL queries.
|
||||
|
||||
**Virtual File System (VFS):**
|
||||
- An in-memory file system is available as `vfs`. Use it to persist intermediate data or large artifacts.
|
||||
- `vfs.write(filename, content, metadata=None)`: Save a file (content can be any serializable object).
|
||||
- `vfs.read(filename) -> (content, metadata)`: Read a file.
|
||||
- `vfs.list() -> list[str]`: List all files.
|
||||
- `vfs.delete(filename)`: Delete a file.
|
||||
- Prefer using VFS for intermediate DataFrames or complex data structures instead of printing everything.
|
||||
|
||||
**Plotting:**
|
||||
- If you need to plot any data, use the `plots` list to store the figures.
|
||||
- Example: `plots.append(fig)` or `plots.append(plt.gcf())`.
|
||||
@@ -18,7 +26,8 @@ The user will provide a task and a plan.
|
||||
- Produce FULL, COMPLETE CODE that includes all steps and solves the task!
|
||||
- Always include the import statements at the top of the code (e.g., `import pandas as pd`, `import matplotlib.pyplot as plt`).
|
||||
- Always include print statements to output the results of your code.
|
||||
- Use `db.query_df("SELECT ...")` to get data."""
|
||||
- Use `db.query_df("SELECT ...")` to get data.
|
||||
"""
|
||||
|
||||
CODE_GENERATOR_USER = """TASK:
|
||||
{question}
|
||||
@@ -43,6 +52,7 @@ Return a complete, corrected python code that incorporates the fixes for the err
|
||||
- You have access to a database client via the variable `db`.
|
||||
- Use `db.query_df(sql)` to run queries.
|
||||
- Use `plots.append(fig)` for plots.
|
||||
- You have access to `vfs` for persistent in-memory storage.
|
||||
- Always include imports and print statements."""
|
||||
|
||||
ERROR_CORRECTOR_USER = """FAILED CODE:
|
||||
|
||||
Reference in New Issue
Block a user